From fdf44c7d1a6ffaadeec23c4496c2cd3ea7476e48 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:23:53 +0000 Subject: [PATCH] SDK regeneration --- acs/credentials.go | 17 +- acs/types.go | 99 +++++++++++ acs/users.go | 8 +- connect_webviews.go | 9 +- core/request_option.go | 2 +- devices.go | 58 +++++++ devices/client/client.go | 3 + devices/simulate.go | 42 +++++ devices/simulate/client.go | 99 +++++++++++ devices/unmanaged.go | 58 +++++++ events.go | 6 +- locks.go | 58 +++++++ thermostats.go | 73 +++++++- thermostats/client/client.go | 20 +-- types.go | 316 +++++++++++++++++++++++++++++++---- 15 files changed, 800 insertions(+), 68 deletions(-) create mode 100644 devices/simulate.go create mode 100644 devices/simulate/client.go diff --git a/acs/credentials.go b/acs/credentials.go index a1a036d..39b48f6 100644 --- a/acs/credentials.go +++ b/acs/credentials.go @@ -15,14 +15,15 @@ type CredentialsAssignRequest struct { } type CredentialsCreateRequest struct { - AcsUserId string `json:"acs_user_id" url:"acs_user_id"` - AccessMethod CredentialsCreateRequestAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - Code *string `json:"code,omitempty" url:"code,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - ExternalType *string `json:"external_type,omitempty" url:"external_type,omitempty"` - VisionlineMetadata *CredentialsCreateRequestVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - StartsAt *time.Time `json:"starts_at,omitempty" url:"starts_at,omitempty"` - EndsAt *time.Time `json:"ends_at,omitempty" url:"ends_at,omitempty"` + CredentialManagerAcsSystemId *string `json:"credential_manager_acs_system_id,omitempty" url:"credential_manager_acs_system_id,omitempty"` + AcsUserId string `json:"acs_user_id" url:"acs_user_id"` + AccessMethod CredentialsCreateRequestAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` + Code *string `json:"code,omitempty" url:"code,omitempty"` + IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` + AllowedAcsEntranceIds []string `json:"allowed_acs_entrance_ids,omitempty" url:"allowed_acs_entrance_ids,omitempty"` + VisionlineMetadata *CredentialsCreateRequestVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` + StartsAt *time.Time `json:"starts_at,omitempty" url:"starts_at,omitempty"` + EndsAt *time.Time `json:"ends_at,omitempty" url:"ends_at,omitempty"` } func (c *CredentialsCreateRequest) UnmarshalJSON(data []byte) error { diff --git a/acs/types.go b/acs/types.go index e2fa740..6f249ad 100644 --- a/acs/types.go +++ b/acs/types.go @@ -1395,6 +1395,7 @@ type EntrancesGetResponseAcsEntrance struct { DisplayName string `json:"display_name" url:"display_name"` AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` CreatedAt time.Time `json:"created_at" url:"created_at"` + LatchMetadata *EntrancesGetResponseAcsEntranceLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` VisionlineMetadata *EntrancesGetResponseAcsEntranceVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage @@ -1441,6 +1442,38 @@ func (e *EntrancesGetResponseAcsEntrance) String() string { return fmt.Sprintf("%#v", e) } +type EntrancesGetResponseAcsEntranceLatchMetadata struct { + AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` + Name string `json:"name" url:"name"` + Type string `json:"type" url:"type"` + IsConnected bool `json:"is_connected" url:"is_connected"` + + _rawJSON json.RawMessage +} + +func (e *EntrancesGetResponseAcsEntranceLatchMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler EntrancesGetResponseAcsEntranceLatchMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = EntrancesGetResponseAcsEntranceLatchMetadata(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *EntrancesGetResponseAcsEntranceLatchMetadata) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + type EntrancesGetResponseAcsEntranceVisionlineMetadata struct { DoorName string `json:"door_name" url:"door_name"` DoorCategory EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` @@ -1771,6 +1804,7 @@ type EntrancesListResponseAcsEntrancesItem struct { DisplayName string `json:"display_name" url:"display_name"` AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` CreatedAt time.Time `json:"created_at" url:"created_at"` + LatchMetadata *EntrancesListResponseAcsEntrancesItemLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` VisionlineMetadata *EntrancesListResponseAcsEntrancesItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage @@ -1817,6 +1851,38 @@ func (e *EntrancesListResponseAcsEntrancesItem) String() string { return fmt.Sprintf("%#v", e) } +type EntrancesListResponseAcsEntrancesItemLatchMetadata struct { + AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` + Name string `json:"name" url:"name"` + Type string `json:"type" url:"type"` + IsConnected bool `json:"is_connected" url:"is_connected"` + + _rawJSON json.RawMessage +} + +func (e *EntrancesListResponseAcsEntrancesItemLatchMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler EntrancesListResponseAcsEntrancesItemLatchMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = EntrancesListResponseAcsEntrancesItemLatchMetadata(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *EntrancesListResponseAcsEntrancesItemLatchMetadata) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + type EntrancesListResponseAcsEntrancesItemVisionlineMetadata struct { DoorName string `json:"door_name" url:"door_name"` DoorCategory EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` @@ -1939,6 +2005,7 @@ type UsersListAccessibleEntrancesResponseAcsEntrancesItem struct { DisplayName string `json:"display_name" url:"display_name"` AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` CreatedAt time.Time `json:"created_at" url:"created_at"` + LatchMetadata *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` VisionlineMetadata *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage @@ -1985,6 +2052,38 @@ func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItem) String() string { return fmt.Sprintf("%#v", u) } +type UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata struct { + AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` + Name string `json:"name" url:"name"` + Type string `json:"type" url:"type"` + IsConnected bool `json:"is_connected" url:"is_connected"` + + _rawJSON json.RawMessage +} + +func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata) String() string { + if len(u._rawJSON) > 0 { + if value, err := core.StringifyJSON(u._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + type UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata struct { DoorName string `json:"door_name" url:"door_name"` DoorCategory UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` diff --git a/acs/users.go b/acs/users.go index cb06c7a..6262582 100644 --- a/acs/users.go +++ b/acs/users.go @@ -21,7 +21,9 @@ type UsersCreateRequest struct { UserIdentityId *string `json:"user_identity_id,omitempty" url:"user_identity_id,omitempty"` AccessSchedule *UsersCreateRequestAccessSchedule `json:"access_schedule,omitempty" url:"access_schedule,omitempty"` FullName *string `json:"full_name,omitempty" url:"full_name,omitempty"` - // Deprecated: use email_address. + // --- + // deprecated: use email_address. + // --- Email *string `json:"email,omitempty" url:"email,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` @@ -494,7 +496,9 @@ type UsersUpdateRequest struct { AccessSchedule *UsersUpdateRequestAccessSchedule `json:"access_schedule,omitempty" url:"access_schedule,omitempty"` AcsUserId string `json:"acs_user_id" url:"acs_user_id"` FullName *string `json:"full_name,omitempty" url:"full_name,omitempty"` - // Deprecated: use email_address. + // --- + // deprecated: use email_address. + // --- Email *string `json:"email,omitempty" url:"email,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` diff --git a/connect_webviews.go b/connect_webviews.go index a80ee5a..6dbd0e7 100644 --- a/connect_webviews.go +++ b/connect_webviews.go @@ -71,7 +71,8 @@ const ( AcceptedProviderAssaAbloyCredentialService AcceptedProvider = "assa_abloy_credential_service" AcceptedProviderSeamBridge AcceptedProvider = "seam_bridge" AcceptedProviderTedee AcceptedProvider = "tedee" - AcceptedProviderHoneywell AcceptedProvider = "honeywell" + AcceptedProviderHoneywellResideo AcceptedProvider = "honeywell_resideo" + AcceptedProviderLatch AcceptedProvider = "latch" AcceptedProviderYaleAccess AcceptedProvider = "yale_access" AcceptedProviderHidCm AcceptedProvider = "hid_cm" AcceptedProviderGoogleNest AcceptedProvider = "google_nest" @@ -149,8 +150,10 @@ func NewAcceptedProviderFromString(s string) (AcceptedProvider, error) { return AcceptedProviderSeamBridge, nil case "tedee": return AcceptedProviderTedee, nil - case "honeywell": - return AcceptedProviderHoneywell, nil + case "honeywell_resideo": + return AcceptedProviderHoneywellResideo, nil + case "latch": + return AcceptedProviderLatch, nil case "yale_access": return AcceptedProviderYaleAccess, nil case "hid_cm": diff --git a/core/request_option.go b/core/request_option.go index 4dc1758..d1bd58f 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -58,7 +58,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/seamapi/go") - headers.Set("X-Fern-SDK-Version", "v0.2.16") + headers.Set("X-Fern-SDK-Version", "v0.3.0") return headers } diff --git a/devices.go b/devices.go index 854056d..3c609bb 100644 --- a/devices.go +++ b/devices.go @@ -31,6 +31,8 @@ type DevicesListRequest struct { CreatedBefore *time.Time `json:"created_before,omitempty" url:"created_before,omitempty"` UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` CustomMetadataHas map[string]*DevicesListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` + IncludeIf []DevicesListRequestIncludeIfItem `json:"include_if,omitempty" url:"include_if,omitempty"` + ExcludeIf []DevicesListRequestExcludeIfItem `json:"exclude_if,omitempty" url:"exclude_if,omitempty"` } func (d *DevicesListRequest) UnmarshalJSON(data []byte) error { @@ -221,6 +223,62 @@ func (d *DevicesListRequestCustomMetadataHasValue) Accept(visitor DevicesListReq } } +type DevicesListRequestExcludeIfItem string + +const ( + DevicesListRequestExcludeIfItemCanRemotelyUnlock DevicesListRequestExcludeIfItem = "can_remotely_unlock" + DevicesListRequestExcludeIfItemCanRemotelyLock DevicesListRequestExcludeIfItem = "can_remotely_lock" + DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes DevicesListRequestExcludeIfItem = "can_program_online_access_codes" + DevicesListRequestExcludeIfItemCanSimulateRemoval DevicesListRequestExcludeIfItem = "can_simulate_removal" +) + +func NewDevicesListRequestExcludeIfItemFromString(s string) (DevicesListRequestExcludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return DevicesListRequestExcludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return DevicesListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return DevicesListRequestExcludeIfItemCanSimulateRemoval, nil + } + var t DevicesListRequestExcludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DevicesListRequestExcludeIfItem) Ptr() *DevicesListRequestExcludeIfItem { + return &d +} + +type DevicesListRequestIncludeIfItem string + +const ( + DevicesListRequestIncludeIfItemCanRemotelyUnlock DevicesListRequestIncludeIfItem = "can_remotely_unlock" + DevicesListRequestIncludeIfItemCanRemotelyLock DevicesListRequestIncludeIfItem = "can_remotely_lock" + DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes DevicesListRequestIncludeIfItem = "can_program_online_access_codes" + DevicesListRequestIncludeIfItemCanSimulateRemoval DevicesListRequestIncludeIfItem = "can_simulate_removal" +) + +func NewDevicesListRequestIncludeIfItemFromString(s string) (DevicesListRequestIncludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return DevicesListRequestIncludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return DevicesListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return DevicesListRequestIncludeIfItemCanSimulateRemoval, nil + } + var t DevicesListRequestIncludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DevicesListRequestIncludeIfItem) Ptr() *DevicesListRequestIncludeIfItem { + return &d +} + type DevicesListResponse struct { Devices []*Device `json:"devices,omitempty" url:"devices,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/devices/client/client.go b/devices/client/client.go index e10ce41..c244c91 100644 --- a/devices/client/client.go +++ b/devices/client/client.go @@ -9,6 +9,7 @@ import ( errors "errors" seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" + simulate "github.com/seamapi/go/devices/simulate" unmanaged "github.com/seamapi/go/devices/unmanaged" option "github.com/seamapi/go/option" io "io" @@ -20,6 +21,7 @@ type Client struct { caller *core.Caller header http.Header + Simulate *simulate.Client Unmanaged *unmanaged.Client } @@ -34,6 +36,7 @@ func NewClient(opts ...option.RequestOption) *Client { }, ), header: options.ToHeader(), + Simulate: simulate.NewClient(opts...), Unmanaged: unmanaged.NewClient(opts...), } } diff --git a/devices/simulate.go b/devices/simulate.go new file mode 100644 index 0000000..85461b6 --- /dev/null +++ b/devices/simulate.go @@ -0,0 +1,42 @@ +// This file was auto-generated by Fern from our API Definition. + +package devices + +import ( + json "encoding/json" + fmt "fmt" + core "github.com/seamapi/go/core" +) + +type SimulateRemoveRequest struct { + DeviceId string `json:"device_id" url:"device_id"` +} + +type SimulateRemoveResponse struct { + Ok bool `json:"ok" url:"ok"` + + _rawJSON json.RawMessage +} + +func (s *SimulateRemoveResponse) UnmarshalJSON(data []byte) error { + type unmarshaler SimulateRemoveResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SimulateRemoveResponse(value) + s._rawJSON = json.RawMessage(data) + return nil +} + +func (s *SimulateRemoveResponse) String() string { + if len(s._rawJSON) > 0 { + if value, err := core.StringifyJSON(s._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} diff --git a/devices/simulate/client.go b/devices/simulate/client.go new file mode 100644 index 0000000..59d0edd --- /dev/null +++ b/devices/simulate/client.go @@ -0,0 +1,99 @@ +// This file was auto-generated by Fern from our API Definition. + +package simulate + +import ( + bytes "bytes" + context "context" + json "encoding/json" + errors "errors" + seamapigo "github.com/seamapi/go" + core "github.com/seamapi/go/core" + devices "github.com/seamapi/go/devices" + option "github.com/seamapi/go/option" + io "io" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...option.RequestOption) *Client { + options := core.NewRequestOptions(opts...) + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller( + &core.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + header: options.ToHeader(), + } +} + +func (c *Client) Remove( + ctx context.Context, + request *devices.SimulateRemoveRequest, + opts ...option.RequestOption, +) (*devices.SimulateRemoveResponse, error) { + options := core.NewRequestOptions(opts...) + + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + if options.BaseURL != "" { + baseURL = options.BaseURL + } + endpointURL := baseURL + "/" + "devices/simulate/remove" + + headers := core.MergeHeaders(c.header.Clone(), options.ToHeader()) + + errorDecoder := func(statusCode int, body io.Reader) error { + raw, err := io.ReadAll(body) + if err != nil { + return err + } + apiError := core.NewAPIError(statusCode, errors.New(string(raw))) + decoder := json.NewDecoder(bytes.NewReader(raw)) + switch statusCode { + case 400: + value := new(seamapigo.BadRequestError) + value.APIError = apiError + if err := decoder.Decode(value); err != nil { + return apiError + } + return value + case 401: + value := new(seamapigo.UnauthorizedError) + value.APIError = apiError + if err := decoder.Decode(value); err != nil { + return apiError + } + return value + } + return apiError + } + + var response *devices.SimulateRemoveResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + MaxAttempts: options.MaxAttempts, + Headers: headers, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: errorDecoder, + }, + ); err != nil { + return nil, err + } + return response, nil +} diff --git a/devices/unmanaged.go b/devices/unmanaged.go index 6be5f29..375db9c 100644 --- a/devices/unmanaged.go +++ b/devices/unmanaged.go @@ -28,6 +28,8 @@ type UnmanagedListRequest struct { CreatedBefore *time.Time `json:"created_before,omitempty" url:"created_before,omitempty"` UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` CustomMetadataHas map[string]*UnmanagedListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` + IncludeIf []UnmanagedListRequestIncludeIfItem `json:"include_if,omitempty" url:"include_if,omitempty"` + ExcludeIf []UnmanagedListRequestExcludeIfItem `json:"exclude_if,omitempty" url:"exclude_if,omitempty"` } func (u *UnmanagedListRequest) UnmarshalJSON(data []byte) error { @@ -155,6 +157,62 @@ func (u *UnmanagedListRequestCustomMetadataHasValue) Accept(visitor UnmanagedLis } } +type UnmanagedListRequestExcludeIfItem string + +const ( + UnmanagedListRequestExcludeIfItemCanRemotelyUnlock UnmanagedListRequestExcludeIfItem = "can_remotely_unlock" + UnmanagedListRequestExcludeIfItemCanRemotelyLock UnmanagedListRequestExcludeIfItem = "can_remotely_lock" + UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_online_access_codes" + UnmanagedListRequestExcludeIfItemCanSimulateRemoval UnmanagedListRequestExcludeIfItem = "can_simulate_removal" +) + +func NewUnmanagedListRequestExcludeIfItemFromString(s string) (UnmanagedListRequestExcludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return UnmanagedListRequestExcludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return UnmanagedListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return UnmanagedListRequestExcludeIfItemCanSimulateRemoval, nil + } + var t UnmanagedListRequestExcludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UnmanagedListRequestExcludeIfItem) Ptr() *UnmanagedListRequestExcludeIfItem { + return &u +} + +type UnmanagedListRequestIncludeIfItem string + +const ( + UnmanagedListRequestIncludeIfItemCanRemotelyUnlock UnmanagedListRequestIncludeIfItem = "can_remotely_unlock" + UnmanagedListRequestIncludeIfItemCanRemotelyLock UnmanagedListRequestIncludeIfItem = "can_remotely_lock" + UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_online_access_codes" + UnmanagedListRequestIncludeIfItemCanSimulateRemoval UnmanagedListRequestIncludeIfItem = "can_simulate_removal" +) + +func NewUnmanagedListRequestIncludeIfItemFromString(s string) (UnmanagedListRequestIncludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return UnmanagedListRequestIncludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return UnmanagedListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return UnmanagedListRequestIncludeIfItemCanSimulateRemoval, nil + } + var t UnmanagedListRequestIncludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UnmanagedListRequestIncludeIfItem) Ptr() *UnmanagedListRequestIncludeIfItem { + return &u +} + type UnmanagedListResponse struct { Devices []*seamapigo.UnmanagedDevice `json:"devices,omitempty" url:"devices,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/events.go b/events.go index bf7fe60..3a3d378 100644 --- a/events.go +++ b/events.go @@ -25,6 +25,7 @@ type EventsListRequest struct { EventType *EventType `json:"event_type,omitempty" url:"event_type,omitempty"` EventTypes []EventType `json:"event_types,omitempty" url:"event_types,omitempty"` ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` + Limit *float64 `json:"limit,omitempty" url:"limit,omitempty"` } type EventsGetResponse struct { @@ -116,9 +117,8 @@ func (e *EventsListRequestBetweenItem) Accept(visitor EventsListRequestBetweenIt } type EventsListResponse struct { - Events []*Event `json:"events,omitempty" url:"events,omitempty"` - Message *string `json:"message,omitempty" url:"message,omitempty"` - Ok bool `json:"ok" url:"ok"` + Events []*Event `json:"events,omitempty" url:"events,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/locks.go b/locks.go index f226189..1aaa09b 100644 --- a/locks.go +++ b/locks.go @@ -27,6 +27,8 @@ type LocksListRequest struct { CreatedBefore *time.Time `json:"created_before,omitempty" url:"created_before,omitempty"` UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` CustomMetadataHas map[string]*LocksListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` + IncludeIf []LocksListRequestIncludeIfItem `json:"include_if,omitempty" url:"include_if,omitempty"` + ExcludeIf []LocksListRequestExcludeIfItem `json:"exclude_if,omitempty" url:"exclude_if,omitempty"` } func (l *LocksListRequest) UnmarshalJSON(data []byte) error { @@ -160,6 +162,62 @@ func (l *LocksListRequestCustomMetadataHasValue) Accept(visitor LocksListRequest } } +type LocksListRequestExcludeIfItem string + +const ( + LocksListRequestExcludeIfItemCanRemotelyUnlock LocksListRequestExcludeIfItem = "can_remotely_unlock" + LocksListRequestExcludeIfItemCanRemotelyLock LocksListRequestExcludeIfItem = "can_remotely_lock" + LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes LocksListRequestExcludeIfItem = "can_program_online_access_codes" + LocksListRequestExcludeIfItemCanSimulateRemoval LocksListRequestExcludeIfItem = "can_simulate_removal" +) + +func NewLocksListRequestExcludeIfItemFromString(s string) (LocksListRequestExcludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return LocksListRequestExcludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return LocksListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return LocksListRequestExcludeIfItemCanSimulateRemoval, nil + } + var t LocksListRequestExcludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (l LocksListRequestExcludeIfItem) Ptr() *LocksListRequestExcludeIfItem { + return &l +} + +type LocksListRequestIncludeIfItem string + +const ( + LocksListRequestIncludeIfItemCanRemotelyUnlock LocksListRequestIncludeIfItem = "can_remotely_unlock" + LocksListRequestIncludeIfItemCanRemotelyLock LocksListRequestIncludeIfItem = "can_remotely_lock" + LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes LocksListRequestIncludeIfItem = "can_program_online_access_codes" + LocksListRequestIncludeIfItemCanSimulateRemoval LocksListRequestIncludeIfItem = "can_simulate_removal" +) + +func NewLocksListRequestIncludeIfItemFromString(s string) (LocksListRequestIncludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return LocksListRequestIncludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return LocksListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return LocksListRequestIncludeIfItemCanSimulateRemoval, nil + } + var t LocksListRequestIncludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (l LocksListRequestIncludeIfItem) Ptr() *LocksListRequestIncludeIfItem { + return &l +} + type LocksListResponse struct { Locks []*Device `json:"locks,omitempty" url:"locks,omitempty"` Devices []*Device `json:"devices,omitempty" url:"devices,omitempty"` diff --git a/thermostats.go b/thermostats.go index f60d9e1..17be589 100644 --- a/thermostats.go +++ b/thermostats.go @@ -50,6 +50,8 @@ type ThermostatsListRequest struct { CreatedBefore *time.Time `json:"created_before,omitempty" url:"created_before,omitempty"` UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` CustomMetadataHas map[string]*ThermostatsListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` + IncludeIf []ThermostatsListRequestIncludeIfItem `json:"include_if,omitempty" url:"include_if,omitempty"` + ExcludeIf []ThermostatsListRequestExcludeIfItem `json:"exclude_if,omitempty" url:"exclude_if,omitempty"` } func (t *ThermostatsListRequest) UnmarshalJSON(data []byte) error { @@ -87,7 +89,8 @@ type ThermostatsSetFanModeRequest struct { } type ThermostatsCoolResponse struct { - Ok bool `json:"ok" url:"ok"` + ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -146,7 +149,8 @@ func (t *ThermostatsGetResponse) String() string { } type ThermostatsHeatCoolResponse struct { - Ok bool `json:"ok" url:"ok"` + ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -175,7 +179,8 @@ func (t *ThermostatsHeatCoolResponse) String() string { } type ThermostatsHeatResponse struct { - Ok bool `json:"ok" url:"ok"` + ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -276,6 +281,62 @@ func (t *ThermostatsListRequestCustomMetadataHasValue) Accept(visitor Thermostat } } +type ThermostatsListRequestExcludeIfItem string + +const ( + ThermostatsListRequestExcludeIfItemCanRemotelyUnlock ThermostatsListRequestExcludeIfItem = "can_remotely_unlock" + ThermostatsListRequestExcludeIfItemCanRemotelyLock ThermostatsListRequestExcludeIfItem = "can_remotely_lock" + ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_online_access_codes" + ThermostatsListRequestExcludeIfItemCanSimulateRemoval ThermostatsListRequestExcludeIfItem = "can_simulate_removal" +) + +func NewThermostatsListRequestExcludeIfItemFromString(s string) (ThermostatsListRequestExcludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return ThermostatsListRequestExcludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return ThermostatsListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return ThermostatsListRequestExcludeIfItemCanSimulateRemoval, nil + } + var t ThermostatsListRequestExcludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t ThermostatsListRequestExcludeIfItem) Ptr() *ThermostatsListRequestExcludeIfItem { + return &t +} + +type ThermostatsListRequestIncludeIfItem string + +const ( + ThermostatsListRequestIncludeIfItemCanRemotelyUnlock ThermostatsListRequestIncludeIfItem = "can_remotely_unlock" + ThermostatsListRequestIncludeIfItemCanRemotelyLock ThermostatsListRequestIncludeIfItem = "can_remotely_lock" + ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_online_access_codes" + ThermostatsListRequestIncludeIfItemCanSimulateRemoval ThermostatsListRequestIncludeIfItem = "can_simulate_removal" +) + +func NewThermostatsListRequestIncludeIfItemFromString(s string) (ThermostatsListRequestIncludeIfItem, error) { + switch s { + case "can_remotely_unlock": + return ThermostatsListRequestIncludeIfItemCanRemotelyUnlock, nil + case "can_remotely_lock": + return ThermostatsListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_online_access_codes": + return ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil + case "can_simulate_removal": + return ThermostatsListRequestIncludeIfItemCanSimulateRemoval, nil + } + var t ThermostatsListRequestIncludeIfItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t ThermostatsListRequestIncludeIfItem) Ptr() *ThermostatsListRequestIncludeIfItem { + return &t +} + type ThermostatsListResponse struct { Thermostats []*Device `json:"thermostats,omitempty" url:"thermostats,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -307,7 +368,8 @@ func (t *ThermostatsListResponse) String() string { } type ThermostatsOffResponse struct { - Ok bool `json:"ok" url:"ok"` + ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -358,7 +420,8 @@ func (t ThermostatsSetFanModeRequestFanModeSetting) Ptr() *ThermostatsSetFanMode } type ThermostatsSetFanModeResponse struct { - Ok bool `json:"ok" url:"ok"` + ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/thermostats/client/client.go b/thermostats/client/client.go index 884ec78..902df95 100644 --- a/thermostats/client/client.go +++ b/thermostats/client/client.go @@ -42,7 +42,7 @@ func (c *Client) Cool( ctx context.Context, request *seamapigo.ThermostatsCoolRequest, opts ...option.RequestOption, -) (*seamapigo.ThermostatsCoolResponse, error) { +) (*seamapigo.ActionAttempt, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -98,7 +98,7 @@ func (c *Client) Cool( ); err != nil { return nil, err } - return response, nil + return response.ActionAttempt, nil } func (c *Client) Get( @@ -168,7 +168,7 @@ func (c *Client) Heat( ctx context.Context, request *seamapigo.ThermostatsHeatRequest, opts ...option.RequestOption, -) (*seamapigo.ThermostatsHeatResponse, error) { +) (*seamapigo.ActionAttempt, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -224,14 +224,14 @@ func (c *Client) Heat( ); err != nil { return nil, err } - return response, nil + return response.ActionAttempt, nil } func (c *Client) HeatCool( ctx context.Context, request *seamapigo.ThermostatsHeatCoolRequest, opts ...option.RequestOption, -) (*seamapigo.ThermostatsHeatCoolResponse, error) { +) (*seamapigo.ActionAttempt, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -287,7 +287,7 @@ func (c *Client) HeatCool( ); err != nil { return nil, err } - return response, nil + return response.ActionAttempt, nil } func (c *Client) List( @@ -357,7 +357,7 @@ func (c *Client) Off( ctx context.Context, request *seamapigo.ThermostatsOffRequest, opts ...option.RequestOption, -) (*seamapigo.ThermostatsOffResponse, error) { +) (*seamapigo.ActionAttempt, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -413,14 +413,14 @@ func (c *Client) Off( ); err != nil { return nil, err } - return response, nil + return response.ActionAttempt, nil } func (c *Client) SetFanMode( ctx context.Context, request *seamapigo.ThermostatsSetFanModeRequest, opts ...option.RequestOption, -) (*seamapigo.ThermostatsSetFanModeResponse, error) { +) (*seamapigo.ActionAttempt, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -476,7 +476,7 @@ func (c *Client) SetFanMode( ); err != nil { return nil, err } - return response, nil + return response.ActionAttempt, nil } func (c *Client) Update( diff --git a/types.go b/types.go index 2c31fef..25744e3 100644 --- a/types.go +++ b/types.go @@ -163,9 +163,13 @@ type AcsAccessGroup struct { AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` WorkspaceId string `json:"workspace_id" url:"workspace_id"` Name string `json:"name" url:"name"` + // --- // deprecated: use external_type + // --- AccessGroupType AcsAccessGroupAccessGroupType `json:"access_group_type,omitempty" url:"access_group_type,omitempty"` + // --- // deprecated: use external_type_display_name + // --- AccessGroupTypeDisplayName string `json:"access_group_type_display_name" url:"access_group_type_display_name"` ExternalType AcsAccessGroupExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` @@ -215,7 +219,9 @@ func (a *AcsAccessGroup) String() string { return fmt.Sprintf("%#v", a) } +// --- // deprecated: use external_type +// --- type AcsAccessGroupAccessGroupType string const ( @@ -276,9 +282,13 @@ type AcsSystem struct { AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` ExternalType AcsSystemExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` + // --- // deprecated: use external_type + // --- SystemType AcsSystemSystemType `json:"system_type,omitempty" url:"system_type,omitempty"` + // --- // deprecated: use external_type_display_name + // --- SystemTypeDisplayName string `json:"system_type_display_name" url:"system_type_display_name"` Name string `json:"name" url:"name"` CreatedAt time.Time `json:"created_at" url:"created_at"` @@ -286,6 +296,7 @@ type AcsSystem struct { ConnectedAccountIds []string `json:"connected_account_ids,omitempty" url:"connected_account_ids,omitempty"` ImageUrl string `json:"image_url" url:"image_url"` ImageAltText string `json:"image_alt_text" url:"image_alt_text"` + CanAutomateEnrollment *bool `json:"can_automate_enrollment,omitempty" url:"can_automate_enrollment,omitempty"` _rawJSON json.RawMessage } @@ -341,6 +352,7 @@ const ( AcsSystemExternalTypeHidCredentialManagerOrganization AcsSystemExternalType = "hid_credential_manager_organization" AcsSystemExternalTypeVisionlineSystem AcsSystemExternalType = "visionline_system" AcsSystemExternalTypeAssaAbloyCredentialService AcsSystemExternalType = "assa_abloy_credential_service" + AcsSystemExternalTypeLatchBuilding AcsSystemExternalType = "latch_building" ) func NewAcsSystemExternalTypeFromString(s string) (AcsSystemExternalType, error) { @@ -359,6 +371,8 @@ func NewAcsSystemExternalTypeFromString(s string) (AcsSystemExternalType, error) return AcsSystemExternalTypeVisionlineSystem, nil case "assa_abloy_credential_service": return AcsSystemExternalTypeAssaAbloyCredentialService, nil + case "latch_building": + return AcsSystemExternalTypeLatchBuilding, nil } var t AcsSystemExternalType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -368,7 +382,9 @@ func (a AcsSystemExternalType) Ptr() *AcsSystemExternalType { return &a } +// --- // deprecated: use external_type +// --- type AcsSystemSystemType string const ( @@ -379,6 +395,7 @@ const ( AcsSystemSystemTypeHidCredentialManagerOrganization AcsSystemSystemType = "hid_credential_manager_organization" AcsSystemSystemTypeVisionlineSystem AcsSystemSystemType = "visionline_system" AcsSystemSystemTypeAssaAbloyCredentialService AcsSystemSystemType = "assa_abloy_credential_service" + AcsSystemSystemTypeLatchBuilding AcsSystemSystemType = "latch_building" ) func NewAcsSystemSystemTypeFromString(s string) (AcsSystemSystemType, error) { @@ -397,6 +414,8 @@ func NewAcsSystemSystemTypeFromString(s string) (AcsSystemSystemType, error) { return AcsSystemSystemTypeVisionlineSystem, nil case "assa_abloy_credential_service": return AcsSystemSystemTypeAssaAbloyCredentialService, nil + case "latch_building": + return AcsSystemSystemTypeLatchBuilding, nil } var t AcsSystemSystemType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -421,7 +440,9 @@ type AcsUser struct { UserIdentityEmailAddress *string `json:"user_identity_email_address,omitempty" url:"user_identity_email_address,omitempty"` UserIdentityPhoneNumber *string `json:"user_identity_phone_number,omitempty" url:"user_identity_phone_number,omitempty"` FullName *string `json:"full_name,omitempty" url:"full_name,omitempty"` - // Deprecated: use email_address. + // --- + // deprecated: use email_address. + // --- Email *string `json:"email,omitempty" url:"email,omitempty"` EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` @@ -1264,6 +1285,10 @@ type Device struct { DeviceId string `json:"device_id" url:"device_id"` // Type of the device. DeviceType DeviceType `json:"device_type,omitempty" url:"device_type,omitempty"` + // Optional nickname to describe the device, settable through Seam + Nickname *string `json:"nickname,omitempty" url:"nickname,omitempty"` + // Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + DisplayName string `json:"display_name" url:"display_name"` // Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health. CapabilitiesSupported []DeviceCapabilitiesSupportedItem `json:"capabilities_supported,omitempty" url:"capabilities_supported,omitempty"` // Properties of the device. @@ -1284,7 +1309,9 @@ type Device struct { IsManaged bool `json:"is_managed" url:"is_managed"` CustomMetadata map[string]*DeviceCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` + CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` _rawJSON json.RawMessage } @@ -1504,9 +1531,15 @@ func (d *DeviceLocation) String() string { type DeviceProperties struct { // Indicates whether the device is online. Online bool `json:"online" url:"online"` - // Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices. - Name string `json:"name" url:"name"` - Model *DevicePropertiesModel `json:"model,omitempty" url:"model,omitempty"` + // --- + // deprecated: use device.display_name instead + // --- + // Name of the device. + Name string `json:"name" url:"name"` + // Represents the accessory keypad state. + AccessoryKeypad *DevicePropertiesAccessoryKeypad `json:"accessory_keypad,omitempty" url:"accessory_keypad,omitempty"` + Appearance *DevicePropertiesAppearance `json:"appearance,omitempty" url:"appearance,omitempty"` + Model *DevicePropertiesModel `json:"model,omitempty" url:"model,omitempty"` // Indicates whether the device has direct power. HasDirectPower *bool `json:"has_direct_power,omitempty" url:"has_direct_power,omitempty"` // Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. @@ -1525,9 +1558,13 @@ type DeviceProperties struct { OnlineAccessCodesEnabled *bool `json:"online_access_codes_enabled,omitempty" url:"online_access_codes_enabled,omitempty"` // Indicates whether it is currently possible to use offline access codes for the device. OfflineAccessCodesEnabled *bool `json:"offline_access_codes_enabled,omitempty" url:"offline_access_codes_enabled,omitempty"` - // Deprecated. Use model.accessory_keypad_supported. + // --- + // deprecated: use model.accessory_keypad_supported + // --- SupportsAccessoryKeypad *bool `json:"supports_accessory_keypad,omitempty" url:"supports_accessory_keypad,omitempty"` - // Deprecated. Use offline_access_codes_enabled. + // --- + // deprecated: use offline_access_codes_enabled + // --- SupportsOfflineAccessCodes *bool `json:"supports_offline_access_codes,omitempty" url:"supports_offline_access_codes,omitempty"` AssaAbloyCredentialServiceMetadata *DevicePropertiesAssaAbloyCredentialServiceMetadata `json:"assa_abloy_credential_service_metadata,omitempty" url:"assa_abloy_credential_service_metadata,omitempty"` AugustMetadata *DevicePropertiesAugustMetadata `json:"august_metadata,omitempty" url:"august_metadata,omitempty"` @@ -1551,7 +1588,7 @@ type DeviceProperties struct { IgloohomeMetadata *DevicePropertiesIgloohomeMetadata `json:"igloohome_metadata,omitempty" url:"igloohome_metadata,omitempty"` NestMetadata *DevicePropertiesNestMetadata `json:"nest_metadata,omitempty" url:"nest_metadata,omitempty"` EcobeeMetadata *DevicePropertiesEcobeeMetadata `json:"ecobee_metadata,omitempty" url:"ecobee_metadata,omitempty"` - HoneywellMetadata *DevicePropertiesHoneywellMetadata `json:"honeywell_metadata,omitempty" url:"honeywell_metadata,omitempty"` + HoneywellResideoMetadata *DevicePropertiesHoneywellResideoMetadata `json:"honeywell_resideo_metadata,omitempty" url:"honeywell_resideo_metadata,omitempty"` HubitatMetadata *DevicePropertiesHubitatMetadata `json:"hubitat_metadata,omitempty" url:"hubitat_metadata,omitempty"` DormakabaOracodeMetadata *DevicePropertiesDormakabaOracodeMetadata `json:"dormakaba_oracode_metadata,omitempty" url:"dormakaba_oracode_metadata,omitempty"` WyzeMetadata *DevicePropertiesWyzeMetadata `json:"wyze_metadata,omitempty" url:"wyze_metadata,omitempty"` @@ -1592,6 +1629,67 @@ func (d *DeviceProperties) String() string { return fmt.Sprintf("%#v", d) } +// Represents the accessory keypad state. +type DevicePropertiesAccessoryKeypad struct { + // Indicates if the accessory_keypad is connected to the device. + IsConnected bool `json:"is_connected" url:"is_connected"` + + _rawJSON json.RawMessage +} + +func (d *DevicePropertiesAccessoryKeypad) UnmarshalJSON(data []byte) error { + type unmarshaler DevicePropertiesAccessoryKeypad + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DevicePropertiesAccessoryKeypad(value) + d._rawJSON = json.RawMessage(data) + return nil +} + +func (d *DevicePropertiesAccessoryKeypad) String() string { + if len(d._rawJSON) > 0 { + if value, err := core.StringifyJSON(d._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DevicePropertiesAppearance struct { + // Name of the device as seen from the provider API and application, not settable through Seam. + Name string `json:"name" url:"name"` + + _rawJSON json.RawMessage +} + +func (d *DevicePropertiesAppearance) UnmarshalJSON(data []byte) error { + type unmarshaler DevicePropertiesAppearance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DevicePropertiesAppearance(value) + d._rawJSON = json.RawMessage(data) + return nil +} + +func (d *DevicePropertiesAppearance) String() string { + if len(d._rawJSON) > 0 { + if value, err := core.StringifyJSON(d._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + type DevicePropertiesAssaAbloyCredentialServiceMetadata struct { HasActiveEndpoint bool `json:"has_active_endpoint" url:"has_active_endpoint"` Endpoints []*DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem `json:"endpoints,omitempty" url:"endpoints,omitempty"` @@ -2182,25 +2280,25 @@ func (d *DevicePropertiesGenieMetadata) String() string { return fmt.Sprintf("%#v", d) } -type DevicePropertiesHoneywellMetadata struct { - HoneywellDeviceId string `json:"honeywell_device_id" url:"honeywell_device_id"` - DeviceName string `json:"device_name" url:"device_name"` +type DevicePropertiesHoneywellResideoMetadata struct { + HoneywellResideoDeviceId string `json:"honeywell_resideo_device_id" url:"honeywell_resideo_device_id"` + DeviceName string `json:"device_name" url:"device_name"` _rawJSON json.RawMessage } -func (d *DevicePropertiesHoneywellMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler DevicePropertiesHoneywellMetadata +func (d *DevicePropertiesHoneywellResideoMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler DevicePropertiesHoneywellResideoMetadata var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DevicePropertiesHoneywellMetadata(value) + *d = DevicePropertiesHoneywellResideoMetadata(value) d._rawJSON = json.RawMessage(data) return nil } -func (d *DevicePropertiesHoneywellMetadata) String() string { +func (d *DevicePropertiesHoneywellResideoMetadata) String() string { if len(d._rawJSON) > 0 { if value, err := core.StringifyJSON(d._rawJSON); err == nil { return value @@ -2612,10 +2710,14 @@ func (d *DevicePropertiesMinutMetadataLatestSensorValuesTemperature) String() st } type DevicePropertiesModel struct { + // Indicates whether the device can connect a accessory keypad. + CanConnectAccessoryKeypad *bool `json:"can_connect_accessory_keypad,omitempty" url:"can_connect_accessory_keypad,omitempty"` // Display name of the device model. DisplayName string `json:"display_name" url:"display_name"` // Display name that corresponds to the manufacturer-specific terminology for the device. ManufacturerDisplayName string `json:"manufacturer_display_name" url:"manufacturer_display_name"` + // Indicates whether the device has a built in accessory keypad. + HasBuiltInKeypad *bool `json:"has_built_in_keypad,omitempty" url:"has_built_in_keypad,omitempty"` // Indicates whether the device supports offline access codes. OfflineAccessCodesSupported *bool `json:"offline_access_codes_supported,omitempty" url:"offline_access_codes_supported,omitempty"` // Indicates whether the device supports online access codes. @@ -2918,12 +3020,13 @@ func (d *DevicePropertiesSmartthingsMetadata) String() string { } type DevicePropertiesTedeeMetadata struct { - DeviceId float64 `json:"device_id" url:"device_id"` - SerialNumber string `json:"serial_number" url:"serial_number"` - DeviceName string `json:"device_name" url:"device_name"` - DeviceModel string `json:"device_model" url:"device_model"` - BridgeId float64 `json:"bridge_id" url:"bridge_id"` - BridgeName string `json:"bridge_name" url:"bridge_name"` + DeviceId float64 `json:"device_id" url:"device_id"` + SerialNumber string `json:"serial_number" url:"serial_number"` + DeviceName string `json:"device_name" url:"device_name"` + DeviceModel string `json:"device_model" url:"device_model"` + BridgeId float64 `json:"bridge_id" url:"bridge_id"` + BridgeName string `json:"bridge_name" url:"bridge_name"` + KeypadId *float64 `json:"keypad_id,omitempty" url:"keypad_id,omitempty"` _rawJSON json.RawMessage } @@ -3046,7 +3149,7 @@ func (d *DevicePropertiesWyzeMetadata) String() string { } type DeviceProvider struct { - DeviceProviderName string `json:"device_provider_name" url:"device_provider_name"` + DeviceProviderName DeviceProviderDeviceProviderName `json:"device_provider_name,omitempty" url:"device_provider_name,omitempty"` DisplayName string `json:"display_name" url:"display_name"` ImageUrl string `json:"image_url" url:"image_url"` ProviderCategories []DeviceProviderProviderCategoriesItem `json:"provider_categories,omitempty" url:"provider_categories,omitempty"` @@ -3077,13 +3180,141 @@ func (d *DeviceProvider) String() string { return fmt.Sprintf("%#v", d) } +type DeviceProviderDeviceProviderName string + +const ( + DeviceProviderDeviceProviderNameAkuvox DeviceProviderDeviceProviderName = "akuvox" + DeviceProviderDeviceProviderNameAugust DeviceProviderDeviceProviderName = "august" + DeviceProviderDeviceProviderNameAvigilonAlta DeviceProviderDeviceProviderName = "avigilon_alta" + DeviceProviderDeviceProviderNameBrivo DeviceProviderDeviceProviderName = "brivo" + DeviceProviderDeviceProviderNameButterflymx DeviceProviderDeviceProviderName = "butterflymx" + DeviceProviderDeviceProviderNameSchlage DeviceProviderDeviceProviderName = "schlage" + DeviceProviderDeviceProviderNameSmartthings DeviceProviderDeviceProviderName = "smartthings" + DeviceProviderDeviceProviderNameYale DeviceProviderDeviceProviderName = "yale" + DeviceProviderDeviceProviderNameGenie DeviceProviderDeviceProviderName = "genie" + DeviceProviderDeviceProviderNameDoorking DeviceProviderDeviceProviderName = "doorking" + DeviceProviderDeviceProviderNameSalto DeviceProviderDeviceProviderName = "salto" + DeviceProviderDeviceProviderNameLockly DeviceProviderDeviceProviderName = "lockly" + DeviceProviderDeviceProviderNameTtlock DeviceProviderDeviceProviderName = "ttlock" + DeviceProviderDeviceProviderNameLinear DeviceProviderDeviceProviderName = "linear" + DeviceProviderDeviceProviderNameNoiseaware DeviceProviderDeviceProviderName = "noiseaware" + DeviceProviderDeviceProviderNameNuki DeviceProviderDeviceProviderName = "nuki" + DeviceProviderDeviceProviderNameSeamRelayAdmin DeviceProviderDeviceProviderName = "seam_relay_admin" + DeviceProviderDeviceProviderNameIgloo DeviceProviderDeviceProviderName = "igloo" + DeviceProviderDeviceProviderNameKwikset DeviceProviderDeviceProviderName = "kwikset" + DeviceProviderDeviceProviderNameMinut DeviceProviderDeviceProviderName = "minut" + DeviceProviderDeviceProviderNameMy2N DeviceProviderDeviceProviderName = "my_2n" + DeviceProviderDeviceProviderNameControlbyweb DeviceProviderDeviceProviderName = "controlbyweb" + DeviceProviderDeviceProviderNameNest DeviceProviderDeviceProviderName = "nest" + DeviceProviderDeviceProviderNameIgloohome DeviceProviderDeviceProviderName = "igloohome" + DeviceProviderDeviceProviderNameEcobee DeviceProviderDeviceProviderName = "ecobee" + DeviceProviderDeviceProviderNameHubitat DeviceProviderDeviceProviderName = "hubitat" + DeviceProviderDeviceProviderNameFourSuites DeviceProviderDeviceProviderName = "four_suites" + DeviceProviderDeviceProviderNameDormakabaOracode DeviceProviderDeviceProviderName = "dormakaba_oracode" + DeviceProviderDeviceProviderNamePti DeviceProviderDeviceProviderName = "pti" + DeviceProviderDeviceProviderNameWyze DeviceProviderDeviceProviderName = "wyze" + DeviceProviderDeviceProviderNameSeamPassport DeviceProviderDeviceProviderName = "seam_passport" + DeviceProviderDeviceProviderNameVisionline DeviceProviderDeviceProviderName = "visionline" + DeviceProviderDeviceProviderNameAssaAbloyCredentialService DeviceProviderDeviceProviderName = "assa_abloy_credential_service" + DeviceProviderDeviceProviderNameSeamBridge DeviceProviderDeviceProviderName = "seam_bridge" + DeviceProviderDeviceProviderNameTedee DeviceProviderDeviceProviderName = "tedee" + DeviceProviderDeviceProviderNameHoneywellResideo DeviceProviderDeviceProviderName = "honeywell_resideo" + DeviceProviderDeviceProviderNameLatch DeviceProviderDeviceProviderName = "latch" +) + +func NewDeviceProviderDeviceProviderNameFromString(s string) (DeviceProviderDeviceProviderName, error) { + switch s { + case "akuvox": + return DeviceProviderDeviceProviderNameAkuvox, nil + case "august": + return DeviceProviderDeviceProviderNameAugust, nil + case "avigilon_alta": + return DeviceProviderDeviceProviderNameAvigilonAlta, nil + case "brivo": + return DeviceProviderDeviceProviderNameBrivo, nil + case "butterflymx": + return DeviceProviderDeviceProviderNameButterflymx, nil + case "schlage": + return DeviceProviderDeviceProviderNameSchlage, nil + case "smartthings": + return DeviceProviderDeviceProviderNameSmartthings, nil + case "yale": + return DeviceProviderDeviceProviderNameYale, nil + case "genie": + return DeviceProviderDeviceProviderNameGenie, nil + case "doorking": + return DeviceProviderDeviceProviderNameDoorking, nil + case "salto": + return DeviceProviderDeviceProviderNameSalto, nil + case "lockly": + return DeviceProviderDeviceProviderNameLockly, nil + case "ttlock": + return DeviceProviderDeviceProviderNameTtlock, nil + case "linear": + return DeviceProviderDeviceProviderNameLinear, nil + case "noiseaware": + return DeviceProviderDeviceProviderNameNoiseaware, nil + case "nuki": + return DeviceProviderDeviceProviderNameNuki, nil + case "seam_relay_admin": + return DeviceProviderDeviceProviderNameSeamRelayAdmin, nil + case "igloo": + return DeviceProviderDeviceProviderNameIgloo, nil + case "kwikset": + return DeviceProviderDeviceProviderNameKwikset, nil + case "minut": + return DeviceProviderDeviceProviderNameMinut, nil + case "my_2n": + return DeviceProviderDeviceProviderNameMy2N, nil + case "controlbyweb": + return DeviceProviderDeviceProviderNameControlbyweb, nil + case "nest": + return DeviceProviderDeviceProviderNameNest, nil + case "igloohome": + return DeviceProviderDeviceProviderNameIgloohome, nil + case "ecobee": + return DeviceProviderDeviceProviderNameEcobee, nil + case "hubitat": + return DeviceProviderDeviceProviderNameHubitat, nil + case "four_suites": + return DeviceProviderDeviceProviderNameFourSuites, nil + case "dormakaba_oracode": + return DeviceProviderDeviceProviderNameDormakabaOracode, nil + case "pti": + return DeviceProviderDeviceProviderNamePti, nil + case "wyze": + return DeviceProviderDeviceProviderNameWyze, nil + case "seam_passport": + return DeviceProviderDeviceProviderNameSeamPassport, nil + case "visionline": + return DeviceProviderDeviceProviderNameVisionline, nil + case "assa_abloy_credential_service": + return DeviceProviderDeviceProviderNameAssaAbloyCredentialService, nil + case "seam_bridge": + return DeviceProviderDeviceProviderNameSeamBridge, nil + case "tedee": + return DeviceProviderDeviceProviderNameTedee, nil + case "honeywell_resideo": + return DeviceProviderDeviceProviderNameHoneywellResideo, nil + case "latch": + return DeviceProviderDeviceProviderNameLatch, nil + } + var t DeviceProviderDeviceProviderName + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DeviceProviderDeviceProviderName) Ptr() *DeviceProviderDeviceProviderName { + return &d +} + type DeviceProviderProviderCategoriesItem string const ( - DeviceProviderProviderCategoriesItemStable DeviceProviderProviderCategoriesItem = "stable" - DeviceProviderProviderCategoriesItemConsumerSmartlocks DeviceProviderProviderCategoriesItem = "consumer_smartlocks" - DeviceProviderProviderCategoriesItemThermostats DeviceProviderProviderCategoriesItem = "thermostats" - DeviceProviderProviderCategoriesItemNoiseSensors DeviceProviderProviderCategoriesItem = "noise_sensors" + DeviceProviderProviderCategoriesItemStable DeviceProviderProviderCategoriesItem = "stable" + DeviceProviderProviderCategoriesItemConsumerSmartlocks DeviceProviderProviderCategoriesItem = "consumer_smartlocks" + DeviceProviderProviderCategoriesItemThermostats DeviceProviderProviderCategoriesItem = "thermostats" + DeviceProviderProviderCategoriesItemNoiseSensors DeviceProviderProviderCategoriesItem = "noise_sensors" + DeviceProviderProviderCategoriesItemAccessControlSystems DeviceProviderProviderCategoriesItem = "access_control_systems" ) func NewDeviceProviderProviderCategoriesItemFromString(s string) (DeviceProviderProviderCategoriesItem, error) { @@ -3096,6 +3327,8 @@ func NewDeviceProviderProviderCategoriesItemFromString(s string) (DeviceProvider return DeviceProviderProviderCategoriesItemThermostats, nil case "noise_sensors": return DeviceProviderProviderCategoriesItemNoiseSensors, nil + case "access_control_systems": + return DeviceProviderProviderCategoriesItemAccessControlSystems, nil } var t DeviceProviderProviderCategoriesItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -3296,16 +3529,12 @@ func (e *EnrollmentAutomation) String() string { } type Event struct { - EventId string `json:"event_id" url:"event_id"` - DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` - AcsCredentialId *string `json:"acs_credential_id,omitempty" url:"acs_credential_id,omitempty"` - AcsUserId *string `json:"acs_user_id,omitempty" url:"acs_user_id,omitempty"` - ClientSessionId *string `json:"client_session_id,omitempty" url:"client_session_id,omitempty"` - EnrollmentAutomationId *string `json:"enrollment_automation_id,omitempty" url:"enrollment_automation_id,omitempty"` - EventType string `json:"event_type" url:"event_type"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - OccurredAt time.Time `json:"occurred_at" url:"occurred_at"` + EventId string `json:"event_id" url:"event_id"` + DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` + EventType string `json:"event_type" url:"event_type"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + OccurredAt time.Time `json:"occurred_at" url:"occurred_at"` _rawJSON json.RawMessage } @@ -3769,6 +3998,10 @@ type Phone struct { // Unique identifier for the device. DeviceId string `json:"device_id" url:"device_id"` DeviceType PhoneDeviceType `json:"device_type,omitempty" url:"device_type,omitempty"` + // Optional nickname to describe the device, settable through Seam + Nickname *string `json:"nickname,omitempty" url:"nickname,omitempty"` + // Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + DisplayName string `json:"display_name" url:"display_name"` // Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health. CapabilitiesSupported []PhoneCapabilitiesSupportedItem `json:"capabilities_supported,omitempty" url:"capabilities_supported,omitempty"` Properties *PhoneProperties `json:"properties,omitempty" url:"properties,omitempty"` @@ -3786,7 +4019,9 @@ type Phone struct { IsManaged bool `json:"is_managed" url:"is_managed"` CustomMetadata map[string]*PhoneCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` + CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` _rawJSON json.RawMessage } @@ -4392,7 +4627,9 @@ type UnmanagedDevice struct { IsManaged bool `json:"is_managed" url:"is_managed"` Properties *UnmanagedDeviceProperties `json:"properties,omitempty" url:"properties,omitempty"` CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` + CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` DeviceProvider *UnmanagedDeviceDeviceProvider `json:"device_provider,omitempty" url:"device_provider,omitempty"` _rawJSON json.RawMessage @@ -4533,7 +4770,10 @@ func (u *UnmanagedDeviceErrorsItem) String() string { } type UnmanagedDeviceProperties struct { - // Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices. + // --- + // deprecated: use device.display_name instead + // --- + // Name of the device. Name string `json:"name" url:"name"` // Indicates whether the device is online. Online bool `json:"online" url:"online"` @@ -4639,10 +4879,14 @@ func (u UnmanagedDevicePropertiesBatteryStatus) Ptr() *UnmanagedDeviceProperties } type UnmanagedDevicePropertiesModel struct { + // Indicates whether the device can connect a accessory keypad. + CanConnectAccessoryKeypad *bool `json:"can_connect_accessory_keypad,omitempty" url:"can_connect_accessory_keypad,omitempty"` // Display name of the device model. DisplayName string `json:"display_name" url:"display_name"` // Display name that corresponds to the manufacturer-specific terminology for the device. ManufacturerDisplayName string `json:"manufacturer_display_name" url:"manufacturer_display_name"` + // Indicates whether the device has a built in accessory keypad. + HasBuiltInKeypad *bool `json:"has_built_in_keypad,omitempty" url:"has_built_in_keypad,omitempty"` // Indicates whether the device supports offline access codes. OfflineAccessCodesSupported *bool `json:"offline_access_codes_supported,omitempty" url:"offline_access_codes_supported,omitempty"` // Indicates whether the device supports online access codes.