-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUnmanagedDevice.php
More file actions
100 lines (97 loc) · 4.52 KB
/
UnmanagedDevice.php
File metadata and controls
100 lines (97 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
namespace Seam\Objects;
class UnmanagedDevice
{
public static function from_json(mixed $json): UnmanagedDevice|null
{
if (!$json) {
return null;
}
return new self(
capabilities_supported: $json->capabilities_supported,
connected_account_id: $json->connected_account_id,
created_at: $json->created_at,
custom_metadata: $json->custom_metadata,
device_id: $json->device_id,
device_type: $json->device_type,
errors: array_map(
fn($e) => UnmanagedDeviceErrors::from_json($e),
$json->errors ?? [],
),
is_managed: $json->is_managed,
properties: UnmanagedDeviceProperties::from_json($json->properties),
warnings: array_map(
fn($w) => UnmanagedDeviceWarnings::from_json($w),
$json->warnings ?? [],
),
workspace_id: $json->workspace_id,
can_configure_auto_lock: $json->can_configure_auto_lock ?? null,
can_hvac_cool: $json->can_hvac_cool ?? null,
can_hvac_heat: $json->can_hvac_heat ?? null,
can_hvac_heat_cool: $json->can_hvac_heat_cool ?? null,
can_program_offline_access_codes: $json->can_program_offline_access_codes ??
null,
can_program_online_access_codes: $json->can_program_online_access_codes ??
null,
can_program_thermostat_programs_as_different_each_day: $json->can_program_thermostat_programs_as_different_each_day ??
null,
can_program_thermostat_programs_as_same_each_day: $json->can_program_thermostat_programs_as_same_each_day ??
null,
can_program_thermostat_programs_as_weekday_weekend: $json->can_program_thermostat_programs_as_weekday_weekend ??
null,
can_remotely_lock: $json->can_remotely_lock ?? null,
can_remotely_unlock: $json->can_remotely_unlock ?? null,
can_run_thermostat_programs: $json->can_run_thermostat_programs ??
null,
can_simulate_connection: $json->can_simulate_connection ?? null,
can_simulate_disconnection: $json->can_simulate_disconnection ??
null,
can_simulate_hub_connection: $json->can_simulate_hub_connection ??
null,
can_simulate_hub_disconnection: $json->can_simulate_hub_disconnection ??
null,
can_simulate_paid_subscription: $json->can_simulate_paid_subscription ??
null,
can_simulate_removal: $json->can_simulate_removal ?? null,
can_turn_off_hvac: $json->can_turn_off_hvac ?? null,
can_unlock_with_code: $json->can_unlock_with_code ?? null,
location: isset($json->location)
? UnmanagedDeviceLocation::from_json($json->location)
: null,
);
}
public function __construct(
public array $capabilities_supported,
public string $connected_account_id,
public string $created_at,
public mixed $custom_metadata,
public string $device_id,
public string $device_type,
public array $errors,
public bool $is_managed,
public UnmanagedDeviceProperties $properties,
public array $warnings,
public string $workspace_id,
public bool|null $can_configure_auto_lock,
public bool|null $can_hvac_cool,
public bool|null $can_hvac_heat,
public bool|null $can_hvac_heat_cool,
public bool|null $can_program_offline_access_codes,
public bool|null $can_program_online_access_codes,
public bool|null $can_program_thermostat_programs_as_different_each_day,
public bool|null $can_program_thermostat_programs_as_same_each_day,
public bool|null $can_program_thermostat_programs_as_weekday_weekend,
public bool|null $can_remotely_lock,
public bool|null $can_remotely_unlock,
public bool|null $can_run_thermostat_programs,
public bool|null $can_simulate_connection,
public bool|null $can_simulate_disconnection,
public bool|null $can_simulate_hub_connection,
public bool|null $can_simulate_hub_disconnection,
public bool|null $can_simulate_paid_subscription,
public bool|null $can_simulate_removal,
public bool|null $can_turn_off_hvac,
public bool|null $can_unlock_with_code,
public UnmanagedDeviceLocation|null $location,
) {}
}