diff --git a/access_codes.go b/access_codes.go index 62b1fec..49e46f0 100644 --- a/access_codes.go +++ b/access_codes.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" core "github.com/seamapi/go/core" + time "time" ) type AccessCodesCreateRequest struct { @@ -72,6 +73,183 @@ type AccessCodesPullBackupAccessCodeRequest struct { AccessCodeId string `json:"access_code_id" url:"access_code_id"` } +type AccessCode struct { + // Unique identifier for a group of access codes that share the same code. + CommonCodeKey *string `json:"common_code_key,omitempty" url:"common_code_key,omitempty"` + // Indicates whether the code is set on the device according to a preconfigured schedule. + IsScheduledOnDevice *bool `json:"is_scheduled_on_device,omitempty" url:"is_scheduled_on_device,omitempty"` + // Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. + Type AccessCodeType `json:"type,omitempty" url:"type,omitempty"` + // Indicates whether the access code is waiting for a code assignment. + IsWaitingForCodeAssignment *bool `json:"is_waiting_for_code_assignment,omitempty" url:"is_waiting_for_code_assignment,omitempty"` + // Unique identifier for the access code. + AccessCodeId string `json:"access_code_id" url:"access_code_id"` + // Unique identifier for the device associated with the access code. + DeviceId string `json:"device_id" url:"device_id"` + // Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + Name *string `json:"name,omitempty" url:"name,omitempty"` + // Code used for access. Typically, a numeric or alphanumeric string. + Code *string `json:"code,omitempty" url:"code,omitempty"` + // Date and time at which the access code was created. + CreatedAt time.Time `json:"created_at" url:"created_at"` + Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` + Warnings interface{} `json:"warnings,omitempty" url:"warnings,omitempty"` + // Indicates whether Seam manages the access code. + IsManaged bool `json:"is_managed" url:"is_managed"` + // Date and time at which the time-bound access code becomes active. + StartsAt *time.Time `json:"starts_at,omitempty" url:"starts_at,omitempty"` + // Date and time after which the time-bound access code becomes inactive. + EndsAt *time.Time `json:"ends_at,omitempty" url:"ends_at,omitempty"` + // Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. + Status AccessCodeStatus `json:"status,omitempty" url:"status,omitempty"` + // Indicates whether a backup access code is available for use if the primary access code is lost or compromised. + IsBackupAccessCodeAvailable bool `json:"is_backup_access_code_available" url:"is_backup_access_code_available"` + // Indicates whether the access code is a backup code. + IsBackup *bool `json:"is_backup,omitempty" url:"is_backup,omitempty"` + // Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. + PulledBackupAccessCodeId *string `json:"pulled_backup_access_code_id,omitempty" url:"pulled_backup_access_code_id,omitempty"` + // Indicates whether changes to the access code from external sources are permitted. + IsExternalModificationAllowed bool `json:"is_external_modification_allowed" url:"is_external_modification_allowed"` + // Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use. + IsOneTimeUse bool `json:"is_one_time_use" url:"is_one_time_use"` + // Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection. + IsOfflineAccessCode bool `json:"is_offline_access_code" url:"is_offline_access_code"` + + _rawJSON json.RawMessage +} + +func (a *AccessCode) UnmarshalJSON(data []byte) error { + type embed AccessCode + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + StartsAt *core.DateTime `json:"starts_at,omitempty"` + EndsAt *core.DateTime `json:"ends_at,omitempty"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AccessCode(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a.StartsAt = unmarshaler.StartsAt.TimePtr() + a.EndsAt = unmarshaler.EndsAt.TimePtr() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AccessCode) MarshalJSON() ([]byte, error) { + type embed AccessCode + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + StartsAt *core.DateTime `json:"starts_at,omitempty"` + EndsAt *core.DateTime `json:"ends_at,omitempty"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + StartsAt: core.NewOptionalDateTime(a.StartsAt), + EndsAt: core.NewOptionalDateTime(a.EndsAt), + } + return json.Marshal(marshaler) +} + +func (a *AccessCode) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. +type AccessCodeStatus string + +const ( + AccessCodeStatusSetting AccessCodeStatus = "setting" + AccessCodeStatusSet AccessCodeStatus = "set" + AccessCodeStatusUnset AccessCodeStatus = "unset" + AccessCodeStatusRemoving AccessCodeStatus = "removing" + AccessCodeStatusUnknown AccessCodeStatus = "unknown" +) + +func NewAccessCodeStatusFromString(s string) (AccessCodeStatus, error) { + switch s { + case "setting": + return AccessCodeStatusSetting, nil + case "set": + return AccessCodeStatusSet, nil + case "unset": + return AccessCodeStatusUnset, nil + case "removing": + return AccessCodeStatusRemoving, nil + case "unknown": + return AccessCodeStatusUnknown, nil + } + var t AccessCodeStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccessCodeStatus) Ptr() *AccessCodeStatus { + return &a +} + +// Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. +type AccessCodeType string + +const ( + AccessCodeTypeTimeBound AccessCodeType = "time_bound" + AccessCodeTypeOngoing AccessCodeType = "ongoing" +) + +func NewAccessCodeTypeFromString(s string) (AccessCodeType, error) { + switch s { + case "time_bound": + return AccessCodeTypeTimeBound, nil + case "ongoing": + return AccessCodeTypeOngoing, nil + } + var t AccessCodeType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccessCodeType) Ptr() *AccessCodeType { + return &a +} + +type MaxTimeRounding string + +const ( + MaxTimeRoundingOneHour MaxTimeRounding = "1hour" + MaxTimeRoundingOneDay MaxTimeRounding = "1day" + MaxTimeRoundingOneH MaxTimeRounding = "1h" + MaxTimeRoundingOneD MaxTimeRounding = "1d" +) + +func NewMaxTimeRoundingFromString(s string) (MaxTimeRounding, error) { + switch s { + case "1hour": + return MaxTimeRoundingOneHour, nil + case "1day": + return MaxTimeRoundingOneDay, nil + case "1h": + return MaxTimeRoundingOneH, nil + case "1d": + return MaxTimeRoundingOneD, nil + } + var t MaxTimeRounding + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (m MaxTimeRounding) Ptr() *MaxTimeRounding { + return &m +} + type AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared string const ( diff --git a/acs/credentials.go b/acs/credentials.go index d19c6aa..8a2e461 100644 --- a/acs/credentials.go +++ b/acs/credentials.go @@ -60,10 +60,14 @@ type CredentialsGetRequest struct { } type CredentialsListRequest struct { - AcsUserId *string `json:"acs_user_id,omitempty" url:"acs_user_id,omitempty"` - AcsSystemId *string `json:"acs_system_id,omitempty" url:"acs_system_id,omitempty"` - UserIdentityId *string `json:"user_identity_id,omitempty" url:"user_identity_id,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` + AcsUserId *string `json:"acs_user_id,omitempty" url:"acs_user_id,omitempty"` + AcsSystemId *string `json:"acs_system_id,omitempty" url:"acs_system_id,omitempty"` + UserIdentityId *string `json:"user_identity_id,omitempty" url:"user_identity_id,omitempty"` + CredentialsListRequestIsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` +} + +type CredentialsListAccessibleEntrancesRequest struct { + AcsCredentialId string `json:"acs_credential_id" url:"acs_credential_id"` } type CredentialsAssignResponse struct { @@ -125,12 +129,9 @@ type CredentialsCreateRequestVisionlineMetadata struct { AssaAbloyCredentialServiceMobileEndpointId *string `json:"assa_abloy_credential_service_mobile_endpoint_id,omitempty" url:"assa_abloy_credential_service_mobile_endpoint_id,omitempty"` CardFormat *CredentialsCreateRequestVisionlineMetadataCardFormat `json:"card_format,omitempty" url:"card_format,omitempty"` CardFunctionType *CredentialsCreateRequestVisionlineMetadataCardFunctionType `json:"card_function_type,omitempty" url:"card_function_type,omitempty"` - // --- - // deprecated: use override. - // --- - IsOverrideKey *bool `json:"is_override_key,omitempty" url:"is_override_key,omitempty"` - Override *bool `json:"override,omitempty" url:"override,omitempty"` - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` + IsOverrideKey *bool `json:"is_override_key,omitempty" url:"is_override_key,omitempty"` + Override *bool `json:"override,omitempty" url:"override,omitempty"` + JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` _rawJSON json.RawMessage } @@ -158,6 +159,50 @@ func (c *CredentialsCreateRequestVisionlineMetadata) String() string { return fmt.Sprintf("%#v", c) } +type CredentialsCreateRequestVisionlineMetadataCardFormat string + +const ( + CredentialsCreateRequestVisionlineMetadataCardFormatTlCode CredentialsCreateRequestVisionlineMetadataCardFormat = "TLCode" + CredentialsCreateRequestVisionlineMetadataCardFormatRfid48 CredentialsCreateRequestVisionlineMetadataCardFormat = "rfid48" +) + +func NewCredentialsCreateRequestVisionlineMetadataCardFormatFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFormat, error) { + switch s { + case "TLCode": + return CredentialsCreateRequestVisionlineMetadataCardFormatTlCode, nil + case "rfid48": + return CredentialsCreateRequestVisionlineMetadataCardFormatRfid48, nil + } + var t CredentialsCreateRequestVisionlineMetadataCardFormat + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CredentialsCreateRequestVisionlineMetadataCardFormat) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFormat { + return &c +} + +type CredentialsCreateRequestVisionlineMetadataCardFunctionType string + +const ( + CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest CredentialsCreateRequestVisionlineMetadataCardFunctionType = "guest" + CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff CredentialsCreateRequestVisionlineMetadataCardFunctionType = "staff" +) + +func NewCredentialsCreateRequestVisionlineMetadataCardFunctionTypeFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFunctionType, error) { + switch s { + case "guest": + return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest, nil + case "staff": + return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff, nil + } + var t CredentialsCreateRequestVisionlineMetadataCardFunctionType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CredentialsCreateRequestVisionlineMetadataCardFunctionType) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFunctionType { + return &c +} + type CredentialsCreateResponse struct { AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -247,6 +292,36 @@ func (c *CredentialsGetResponse) String() string { return fmt.Sprintf("%#v", c) } +type CredentialsListAccessibleEntrancesResponse struct { + AcsEntrances []*seamapigo.AcsEntrance `json:"acs_entrances,omitempty" url:"acs_entrances,omitempty"` + Ok bool `json:"ok" url:"ok"` + + _rawJSON json.RawMessage +} + +func (c *CredentialsListAccessibleEntrancesResponse) UnmarshalJSON(data []byte) error { + type unmarshaler CredentialsListAccessibleEntrancesResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CredentialsListAccessibleEntrancesResponse(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CredentialsListAccessibleEntrancesResponse) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + type CredentialsListResponse struct { AcsCredentials []*seamapigo.AcsCredential `json:"acs_credentials,omitempty" url:"acs_credentials,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -343,6 +418,29 @@ type CredentialsUnassignRequest struct { } type CredentialsUpdateRequest struct { - AcsCredentialId string `json:"acs_credential_id" url:"acs_credential_id"` - Code string `json:"code" url:"code"` + AcsCredentialId string `json:"acs_credential_id" url:"acs_credential_id"` + Code *string `json:"code,omitempty" url:"code,omitempty"` + EndsAt *time.Time `json:"ends_at,omitempty" url:"ends_at,omitempty"` +} + +func (c *CredentialsUpdateRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CredentialsUpdateRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CredentialsUpdateRequest(body) + return nil +} + +func (c *CredentialsUpdateRequest) MarshalJSON() ([]byte, error) { + type embed CredentialsUpdateRequest + var marshaler = struct { + embed + EndsAt *core.DateTime `json:"ends_at,omitempty"` + }{ + embed: embed(*c), + EndsAt: core.NewOptionalDateTime(c.EndsAt), + } + return json.Marshal(marshaler) } diff --git a/acs/credentials/client.go b/acs/credentials/client.go index ebf05f8..1555735 100644 --- a/acs/credentials/client.go +++ b/acs/credentials/client.go @@ -350,6 +350,69 @@ func (c *Client) List( return response.AcsCredentials, nil } +func (c *Client) ListAccessibleEntrances( + ctx context.Context, + request *acs.CredentialsListAccessibleEntrancesRequest, + opts ...option.RequestOption, +) ([]*seamapigo.AcsEntrance, error) { + options := core.NewRequestOptions(opts...) + + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + if options.BaseURL != "" { + baseURL = options.BaseURL + } + endpointURL := baseURL + "/" + "acs/credentials/list_accessible_entrances" + + 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 *acs.CredentialsListAccessibleEntrancesResponse + 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.AcsEntrances, nil +} + func (c *Client) Unassign( ctx context.Context, request *acs.CredentialsUnassignRequest, diff --git a/acs/systems.go b/acs/systems.go index 6cda956..130e8b4 100644 --- a/acs/systems.go +++ b/acs/systems.go @@ -17,6 +17,10 @@ type SystemsListRequest struct { ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` } +type SystemsListCompatibleCredentialManagerAcsSystemsRequest struct { + AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` +} + type SystemsGetResponse struct { AcsSystem *seamapigo.AcsSystem `json:"acs_system,omitempty" url:"acs_system,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -47,6 +51,36 @@ func (s *SystemsGetResponse) String() string { return fmt.Sprintf("%#v", s) } +type SystemsListCompatibleCredentialManagerAcsSystemsResponse struct { + AcsSystems []*seamapigo.AcsSystem `json:"acs_systems,omitempty" url:"acs_systems,omitempty"` + Ok bool `json:"ok" url:"ok"` + + _rawJSON json.RawMessage +} + +func (s *SystemsListCompatibleCredentialManagerAcsSystemsResponse) UnmarshalJSON(data []byte) error { + type unmarshaler SystemsListCompatibleCredentialManagerAcsSystemsResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SystemsListCompatibleCredentialManagerAcsSystemsResponse(value) + s._rawJSON = json.RawMessage(data) + return nil +} + +func (s *SystemsListCompatibleCredentialManagerAcsSystemsResponse) 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) +} + type SystemsListResponse struct { AcsSystems []*seamapigo.AcsSystem `json:"acs_systems,omitempty" url:"acs_systems,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/acs/systems/client.go b/acs/systems/client.go index 27aa397..dc5f4bd 100644 --- a/acs/systems/client.go +++ b/acs/systems/client.go @@ -160,3 +160,66 @@ func (c *Client) List( } return response.AcsSystems, nil } + +func (c *Client) ListCompatibleCredentialManagerAcsSystems( + ctx context.Context, + request *acs.SystemsListCompatibleCredentialManagerAcsSystemsRequest, + opts ...option.RequestOption, +) ([]*seamapigo.AcsSystem, error) { + options := core.NewRequestOptions(opts...) + + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + if options.BaseURL != "" { + baseURL = options.BaseURL + } + endpointURL := baseURL + "/" + "acs/systems/list_compatible_credential_manager_acs_systems" + + 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 *acs.SystemsListCompatibleCredentialManagerAcsSystemsResponse + 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.AcsSystems, nil +} diff --git a/acs/types.go b/acs/types.go deleted file mode 100644 index 3be346e..0000000 --- a/acs/types.go +++ /dev/null @@ -1,51 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package acs - -import ( - fmt "fmt" -) - -type CredentialsCreateRequestVisionlineMetadataCardFormat string - -const ( - CredentialsCreateRequestVisionlineMetadataCardFormatTlCode CredentialsCreateRequestVisionlineMetadataCardFormat = "TLCode" - CredentialsCreateRequestVisionlineMetadataCardFormatRfid48 CredentialsCreateRequestVisionlineMetadataCardFormat = "rfid48" -) - -func NewCredentialsCreateRequestVisionlineMetadataCardFormatFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFormat, error) { - switch s { - case "TLCode": - return CredentialsCreateRequestVisionlineMetadataCardFormatTlCode, nil - case "rfid48": - return CredentialsCreateRequestVisionlineMetadataCardFormatRfid48, nil - } - var t CredentialsCreateRequestVisionlineMetadataCardFormat - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsCreateRequestVisionlineMetadataCardFormat) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFormat { - return &c -} - -type CredentialsCreateRequestVisionlineMetadataCardFunctionType string - -const ( - CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest CredentialsCreateRequestVisionlineMetadataCardFunctionType = "guest" - CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff CredentialsCreateRequestVisionlineMetadataCardFunctionType = "staff" -) - -func NewCredentialsCreateRequestVisionlineMetadataCardFunctionTypeFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFunctionType, error) { - switch s { - case "guest": - return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest, nil - case "staff": - return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff, nil - } - var t CredentialsCreateRequestVisionlineMetadataCardFunctionType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsCreateRequestVisionlineMetadataCardFunctionType) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFunctionType { - return &c -} diff --git a/acs/users.go b/acs/users.go index fef6779..87f8a36 100644 --- a/acs/users.go +++ b/acs/users.go @@ -21,12 +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. - // --- - 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"` + 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"` } type UsersDeleteRequest struct { @@ -496,11 +493,8 @@ 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. - // --- - 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"` - HidAcsSystemId *string `json:"hid_acs_system_id,omitempty" url:"hid_acs_system_id,omitempty"` + 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"` + HidAcsSystemId *string `json:"hid_acs_system_id,omitempty" url:"hid_acs_system_id,omitempty"` } diff --git a/client_sessions.go b/client_sessions.go index 5c7142c..3040b0d 100644 --- a/client_sessions.go +++ b/client_sessions.go @@ -98,6 +98,61 @@ type ClientSessionsRevokeRequest struct { ClientSessionId string `json:"client_session_id" url:"client_session_id"` } +type ClientSession struct { + ClientSessionId string `json:"client_session_id" url:"client_session_id"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + Token string `json:"token" url:"token"` + UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` + DeviceCount float64 `json:"device_count" url:"device_count"` + ConnectedAccountIds []string `json:"connected_account_ids,omitempty" url:"connected_account_ids,omitempty"` + ConnectWebviewIds []string `json:"connect_webview_ids,omitempty" url:"connect_webview_ids,omitempty"` + UserIdentityIds []string `json:"user_identity_ids,omitempty" url:"user_identity_ids,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *ClientSession) UnmarshalJSON(data []byte) error { + type embed ClientSession + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientSession(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientSession) MarshalJSON() ([]byte, error) { + type embed ClientSession + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*c), + CreatedAt: core.NewDateTime(c.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (c *ClientSession) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + type ClientSessionsCreateResponse struct { ClientSession *ClientSession `json:"client_session,omitempty" url:"client_session,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/connect_webviews.go b/connect_webviews.go index 8fae3bc..0bc4314 100644 --- a/connect_webviews.go +++ b/connect_webviews.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" core "github.com/seamapi/go/core" + time "time" ) type ConnectWebviewsCreateRequest struct { @@ -31,6 +32,183 @@ type ConnectWebviewsListRequest struct { UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` // Returns devices where the webview's custom_metadata contains all of the provided key/value pairs. CustomMetadataHas map[string]*ConnectWebviewsListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` + Limit *float64 `json:"limit,omitempty" url:"limit,omitempty"` +} + +type ConnectWebview struct { + ConnectWebviewId string `json:"connect_webview_id" url:"connect_webview_id"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` + Url string `json:"url" url:"url"` + DeviceSelectionMode SelectionMode `json:"device_selection_mode,omitempty" url:"device_selection_mode,omitempty"` + AcceptedProviders []string `json:"accepted_providers,omitempty" url:"accepted_providers,omitempty"` + AcceptedDevices []string `json:"accepted_devices,omitempty" url:"accepted_devices,omitempty"` + AnyDeviceAllowed bool `json:"any_device_allowed" url:"any_device_allowed"` + AnyProviderAllowed bool `json:"any_provider_allowed" url:"any_provider_allowed"` + LoginSuccessful bool `json:"login_successful" url:"login_successful"` + Status ConnectWebviewStatus `json:"status,omitempty" url:"status,omitempty"` + CustomRedirectUrl *string `json:"custom_redirect_url,omitempty" url:"custom_redirect_url,omitempty"` + CustomRedirectFailureUrl *string `json:"custom_redirect_failure_url,omitempty" url:"custom_redirect_failure_url,omitempty"` + CustomMetadata map[string]*ConnectWebviewCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` + AutomaticallyManageNewDevices bool `json:"automatically_manage_new_devices" url:"automatically_manage_new_devices"` + WaitForDeviceCreation bool `json:"wait_for_device_creation" url:"wait_for_device_creation"` + AuthorizedAt *time.Time `json:"authorized_at,omitempty" url:"authorized_at,omitempty"` + SelectedProvider *string `json:"selected_provider,omitempty" url:"selected_provider,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *ConnectWebview) UnmarshalJSON(data []byte) error { + type embed ConnectWebview + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + AuthorizedAt *core.DateTime `json:"authorized_at,omitempty"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ConnectWebview(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.AuthorizedAt = unmarshaler.AuthorizedAt.TimePtr() + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConnectWebview) MarshalJSON() ([]byte, error) { + type embed ConnectWebview + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + AuthorizedAt *core.DateTime `json:"authorized_at,omitempty"` + }{ + embed: embed(*c), + CreatedAt: core.NewDateTime(c.CreatedAt), + AuthorizedAt: core.NewOptionalDateTime(c.AuthorizedAt), + } + return json.Marshal(marshaler) +} + +func (c *ConnectWebview) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type ConnectWebviewCustomMetadataValue struct { + typeName string + String string + Boolean bool +} + +func NewConnectWebviewCustomMetadataValueFromString(value string) *ConnectWebviewCustomMetadataValue { + return &ConnectWebviewCustomMetadataValue{typeName: "string", String: value} +} + +func NewConnectWebviewCustomMetadataValueFromBoolean(value bool) *ConnectWebviewCustomMetadataValue { + return &ConnectWebviewCustomMetadataValue{typeName: "boolean", Boolean: value} +} + +func (c *ConnectWebviewCustomMetadataValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typeName = "string" + c.String = valueString + return nil + } + var valueBoolean bool + if err := json.Unmarshal(data, &valueBoolean); err == nil { + c.typeName = "boolean" + c.Boolean = valueBoolean + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c ConnectWebviewCustomMetadataValue) MarshalJSON() ([]byte, error) { + switch c.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) + case "string": + return json.Marshal(c.String) + case "boolean": + return json.Marshal(c.Boolean) + } +} + +type ConnectWebviewCustomMetadataValueVisitor interface { + VisitString(string) error + VisitBoolean(bool) error +} + +func (c *ConnectWebviewCustomMetadataValue) Accept(visitor ConnectWebviewCustomMetadataValueVisitor) error { + switch c.typeName { + default: + return fmt.Errorf("invalid type %s in %T", c.typeName, c) + case "string": + return visitor.VisitString(c.String) + case "boolean": + return visitor.VisitBoolean(c.Boolean) + } +} + +type ConnectWebviewStatus string + +const ( + ConnectWebviewStatusPending ConnectWebviewStatus = "pending" + ConnectWebviewStatusFailed ConnectWebviewStatus = "failed" + ConnectWebviewStatusAuthorized ConnectWebviewStatus = "authorized" +) + +func NewConnectWebviewStatusFromString(s string) (ConnectWebviewStatus, error) { + switch s { + case "pending": + return ConnectWebviewStatusPending, nil + case "failed": + return ConnectWebviewStatusFailed, nil + case "authorized": + return ConnectWebviewStatusAuthorized, nil + } + var t ConnectWebviewStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ConnectWebviewStatus) Ptr() *ConnectWebviewStatus { + return &c +} + +type SelectionMode string + +const ( + SelectionModeNone SelectionMode = "none" + SelectionModeSingle SelectionMode = "single" + SelectionModeMultiple SelectionMode = "multiple" +) + +func NewSelectionModeFromString(s string) (SelectionMode, error) { + switch s { + case "none": + return SelectionModeNone, nil + case "single": + return SelectionModeSingle, nil + case "multiple": + return SelectionModeMultiple, nil + } + var t SelectionMode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SelectionMode) Ptr() *SelectionMode { + return &s } type AcceptedProvider string @@ -170,10 +348,9 @@ func (a AcceptedProvider) Ptr() *AcceptedProvider { } type ConnectWebviewsCreateRequestCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectWebviewsCreateRequestCustomMetadataValueFromString(value string) *ConnectWebviewsCreateRequestCustomMetadataValue { @@ -184,10 +361,6 @@ func NewConnectWebviewsCreateRequestCustomMetadataValueFromBoolean(value bool) * return &ConnectWebviewsCreateRequestCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewConnectWebviewsCreateRequestCustomMetadataValueFromStringOptional(value *string) *ConnectWebviewsCreateRequestCustomMetadataValue { - return &ConnectWebviewsCreateRequestCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectWebviewsCreateRequestCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -201,12 +374,6 @@ func (c *ConnectWebviewsCreateRequestCustomMetadataValue) UnmarshalJSON(data []b c.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - c.typeName = "stringOptional" - c.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, c) } @@ -218,15 +385,12 @@ func (c ConnectWebviewsCreateRequestCustomMetadataValue) MarshalJSON() ([]byte, return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectWebviewsCreateRequestCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectWebviewsCreateRequestCustomMetadataValue) Accept(visitor ConnectWebviewsCreateRequestCustomMetadataValueVisitor) error { @@ -237,8 +401,6 @@ func (c *ConnectWebviewsCreateRequestCustomMetadataValue) Accept(visitor Connect return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } diff --git a/connected_accounts.go b/connected_accounts.go index c80456a..4fed9b4 100644 --- a/connected_accounts.go +++ b/connected_accounts.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" core "github.com/seamapi/go/core" + time "time" ) type ConnectedAccountsDeleteRequest struct { @@ -18,6 +19,151 @@ type ConnectedAccountsListRequest struct { CustomMetadataHas map[string]*ConnectedAccountsListRequestCustomMetadataHasValue `json:"custom_metadata_has,omitempty" url:"custom_metadata_has,omitempty"` } +type ConnectedAccount struct { + ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + UserIdentifier *ConnectedAccountUserIdentifier `json:"user_identifier,omitempty" url:"user_identifier,omitempty"` + AccountType *string `json:"account_type,omitempty" url:"account_type,omitempty"` + AccountTypeDisplayName string `json:"account_type_display_name" url:"account_type_display_name"` + Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` + Warnings interface{} `json:"warnings,omitempty" url:"warnings,omitempty"` + CustomMetadata map[string]*ConnectedAccountCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` + AutomaticallyManageNewDevices bool `json:"automatically_manage_new_devices" url:"automatically_manage_new_devices"` + + _rawJSON json.RawMessage +} + +func (c *ConnectedAccount) UnmarshalJSON(data []byte) error { + type embed ConnectedAccount + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at,omitempty"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ConnectedAccount(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.TimePtr() + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConnectedAccount) MarshalJSON() ([]byte, error) { + type embed ConnectedAccount + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at,omitempty"` + }{ + embed: embed(*c), + CreatedAt: core.NewOptionalDateTime(c.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (c *ConnectedAccount) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type ConnectedAccountCustomMetadataValue struct { + typeName string + String string + Boolean bool +} + +func NewConnectedAccountCustomMetadataValueFromString(value string) *ConnectedAccountCustomMetadataValue { + return &ConnectedAccountCustomMetadataValue{typeName: "string", String: value} +} + +func NewConnectedAccountCustomMetadataValueFromBoolean(value bool) *ConnectedAccountCustomMetadataValue { + return &ConnectedAccountCustomMetadataValue{typeName: "boolean", Boolean: value} +} + +func (c *ConnectedAccountCustomMetadataValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typeName = "string" + c.String = valueString + return nil + } + var valueBoolean bool + if err := json.Unmarshal(data, &valueBoolean); err == nil { + c.typeName = "boolean" + c.Boolean = valueBoolean + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c ConnectedAccountCustomMetadataValue) MarshalJSON() ([]byte, error) { + switch c.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) + case "string": + return json.Marshal(c.String) + case "boolean": + return json.Marshal(c.Boolean) + } +} + +type ConnectedAccountCustomMetadataValueVisitor interface { + VisitString(string) error + VisitBoolean(bool) error +} + +func (c *ConnectedAccountCustomMetadataValue) Accept(visitor ConnectedAccountCustomMetadataValueVisitor) error { + switch c.typeName { + default: + return fmt.Errorf("invalid type %s in %T", c.typeName, c) + case "string": + return visitor.VisitString(c.String) + case "boolean": + return visitor.VisitBoolean(c.Boolean) + } +} + +type ConnectedAccountUserIdentifier struct { + Username *string `json:"username,omitempty" url:"username,omitempty"` + ApiUrl *string `json:"api_url,omitempty" url:"api_url,omitempty"` + Email *string `json:"email,omitempty" url:"email,omitempty"` + Phone *string `json:"phone,omitempty" url:"phone,omitempty"` + Exclusive *bool `json:"exclusive,omitempty" url:"exclusive,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *ConnectedAccountUserIdentifier) UnmarshalJSON(data []byte) error { + type unmarshaler ConnectedAccountUserIdentifier + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ConnectedAccountUserIdentifier(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConnectedAccountUserIdentifier) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + type ConnectedAccountsDeleteResponse struct { Ok bool `json:"ok" url:"ok"` @@ -104,6 +250,64 @@ func (c *ConnectedAccountsGetRequest) Accept(visitor ConnectedAccountsGetRequest } } +type ConnectedAccountsGetRequestConnectedAccountId struct { + ConnectedAccountId string `json:"connected_account_id" url:"connected_account_id"` + + _rawJSON json.RawMessage +} + +func (c *ConnectedAccountsGetRequestConnectedAccountId) UnmarshalJSON(data []byte) error { + type unmarshaler ConnectedAccountsGetRequestConnectedAccountId + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ConnectedAccountsGetRequestConnectedAccountId(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConnectedAccountsGetRequestConnectedAccountId) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type ConnectedAccountsGetRequestEmail struct { + Email string `json:"email" url:"email"` + + _rawJSON json.RawMessage +} + +func (c *ConnectedAccountsGetRequestEmail) UnmarshalJSON(data []byte) error { + type unmarshaler ConnectedAccountsGetRequestEmail + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ConnectedAccountsGetRequestEmail(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConnectedAccountsGetRequestEmail) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + type ConnectedAccountsGetResponse struct { ConnectedAccount *ConnectedAccount `json:"connected_account,omitempty" url:"connected_account,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -222,10 +426,9 @@ func (c *ConnectedAccountsListResponse) String() string { } type ConnectedAccountsUpdateRequestCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectedAccountsUpdateRequestCustomMetadataValueFromString(value string) *ConnectedAccountsUpdateRequestCustomMetadataValue { @@ -236,10 +439,6 @@ func NewConnectedAccountsUpdateRequestCustomMetadataValueFromBoolean(value bool) return &ConnectedAccountsUpdateRequestCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewConnectedAccountsUpdateRequestCustomMetadataValueFromStringOptional(value *string) *ConnectedAccountsUpdateRequestCustomMetadataValue { - return &ConnectedAccountsUpdateRequestCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectedAccountsUpdateRequestCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -253,12 +452,6 @@ func (c *ConnectedAccountsUpdateRequestCustomMetadataValue) UnmarshalJSON(data [ c.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - c.typeName = "stringOptional" - c.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, c) } @@ -270,15 +463,12 @@ func (c ConnectedAccountsUpdateRequestCustomMetadataValue) MarshalJSON() ([]byte return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectedAccountsUpdateRequestCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectedAccountsUpdateRequestCustomMetadataValue) Accept(visitor ConnectedAccountsUpdateRequestCustomMetadataValueVisitor) error { @@ -289,8 +479,6 @@ func (c *ConnectedAccountsUpdateRequestCustomMetadataValue) Accept(visitor Conne return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } diff --git a/core/request_option.go b/core/request_option.go index 0bffde7..3d07f75 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.3.4") + headers.Set("X-Fern-SDK-Version", "v0.0.17") return headers } diff --git a/devices.go b/devices.go index be5016d..2763644 100644 --- a/devices.go +++ b/devices.go @@ -61,6 +61,196 @@ type DevicesListDeviceProvidersRequest struct { ProviderCategory *ProviderCategory `json:"provider_category,omitempty" url:"provider_category,omitempty"` } +type DeviceProvider struct { + 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"` + + _rawJSON json.RawMessage +} + +func (d *DeviceProvider) UnmarshalJSON(data []byte) error { + type unmarshaler DeviceProvider + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DeviceProvider(value) + d._rawJSON = json.RawMessage(data) + return nil +} + +func (d *DeviceProvider) 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 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" + DeviceProviderProviderCategoriesItemAccessControlSystems DeviceProviderProviderCategoriesItem = "access_control_systems" +) + +func NewDeviceProviderProviderCategoriesItemFromString(s string) (DeviceProviderProviderCategoriesItem, error) { + switch s { + case "stable": + return DeviceProviderProviderCategoriesItemStable, nil + case "consumer_smartlocks": + return DeviceProviderProviderCategoriesItemConsumerSmartlocks, nil + case "thermostats": + 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) +} + +func (d DeviceProviderProviderCategoriesItem) Ptr() *DeviceProviderProviderCategoriesItem { + return &d +} + type DevicesDeleteResponse struct { Ok bool `json:"ok" url:"ok"` @@ -215,6 +405,8 @@ const ( DevicesListRequestExcludeIfItemCanProgramOfflineAccessCodes DevicesListRequestExcludeIfItem = "can_program_offline_access_codes" DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes DevicesListRequestExcludeIfItem = "can_program_online_access_codes" DevicesListRequestExcludeIfItemCanSimulateRemoval DevicesListRequestExcludeIfItem = "can_simulate_removal" + DevicesListRequestExcludeIfItemCanSimulateConnection DevicesListRequestExcludeIfItem = "can_simulate_connection" + DevicesListRequestExcludeIfItemCanSimulateDisconnection DevicesListRequestExcludeIfItem = "can_simulate_disconnection" ) func NewDevicesListRequestExcludeIfItemFromString(s string) (DevicesListRequestExcludeIfItem, error) { @@ -229,6 +421,10 @@ func NewDevicesListRequestExcludeIfItemFromString(s string) (DevicesListRequestE return DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return DevicesListRequestExcludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return DevicesListRequestExcludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return DevicesListRequestExcludeIfItemCanSimulateDisconnection, nil } var t DevicesListRequestExcludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -246,6 +442,8 @@ const ( DevicesListRequestIncludeIfItemCanProgramOfflineAccessCodes DevicesListRequestIncludeIfItem = "can_program_offline_access_codes" DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes DevicesListRequestIncludeIfItem = "can_program_online_access_codes" DevicesListRequestIncludeIfItemCanSimulateRemoval DevicesListRequestIncludeIfItem = "can_simulate_removal" + DevicesListRequestIncludeIfItemCanSimulateConnection DevicesListRequestIncludeIfItem = "can_simulate_connection" + DevicesListRequestIncludeIfItemCanSimulateDisconnection DevicesListRequestIncludeIfItem = "can_simulate_disconnection" ) func NewDevicesListRequestIncludeIfItemFromString(s string) (DevicesListRequestIncludeIfItem, error) { @@ -260,6 +458,10 @@ func NewDevicesListRequestIncludeIfItemFromString(s string) (DevicesListRequestI return DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return DevicesListRequestIncludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return DevicesListRequestIncludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return DevicesListRequestIncludeIfItemCanSimulateDisconnection, nil } var t DevicesListRequestIncludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -300,10 +502,9 @@ func (d *DevicesListResponse) String() string { } type DevicesUpdateRequestCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewDevicesUpdateRequestCustomMetadataValueFromString(value string) *DevicesUpdateRequestCustomMetadataValue { @@ -314,10 +515,6 @@ func NewDevicesUpdateRequestCustomMetadataValueFromBoolean(value bool) *DevicesU return &DevicesUpdateRequestCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewDevicesUpdateRequestCustomMetadataValueFromStringOptional(value *string) *DevicesUpdateRequestCustomMetadataValue { - return &DevicesUpdateRequestCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (d *DevicesUpdateRequestCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -331,12 +528,6 @@ func (d *DevicesUpdateRequestCustomMetadataValue) UnmarshalJSON(data []byte) err d.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - d.typeName = "stringOptional" - d.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, d) } @@ -348,15 +539,12 @@ func (d DevicesUpdateRequestCustomMetadataValue) MarshalJSON() ([]byte, error) { return json.Marshal(d.String) case "boolean": return json.Marshal(d.Boolean) - case "stringOptional": - return json.Marshal(d.StringOptional) } } type DevicesUpdateRequestCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (d *DevicesUpdateRequestCustomMetadataValue) Accept(visitor DevicesUpdateRequestCustomMetadataValueVisitor) error { @@ -367,8 +555,6 @@ func (d *DevicesUpdateRequestCustomMetadataValue) Accept(visitor DevicesUpdateRe return visitor.VisitString(d.String) case "boolean": return visitor.VisitBoolean(d.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(d.StringOptional) } } diff --git a/devices/simulate.go b/devices/simulate.go index 85461b6..6f554b6 100644 --- a/devices/simulate.go +++ b/devices/simulate.go @@ -8,10 +8,76 @@ import ( core "github.com/seamapi/go/core" ) +type SimulateConnectRequest struct { + DeviceId string `json:"device_id" url:"device_id"` +} + +type SimulateDisconnectRequest struct { + DeviceId string `json:"device_id" url:"device_id"` +} + type SimulateRemoveRequest struct { DeviceId string `json:"device_id" url:"device_id"` } +type SimulateConnectResponse struct { + Ok bool `json:"ok" url:"ok"` + + _rawJSON json.RawMessage +} + +func (s *SimulateConnectResponse) UnmarshalJSON(data []byte) error { + type unmarshaler SimulateConnectResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SimulateConnectResponse(value) + s._rawJSON = json.RawMessage(data) + return nil +} + +func (s *SimulateConnectResponse) 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) +} + +type SimulateDisconnectResponse struct { + Ok bool `json:"ok" url:"ok"` + + _rawJSON json.RawMessage +} + +func (s *SimulateDisconnectResponse) UnmarshalJSON(data []byte) error { + type unmarshaler SimulateDisconnectResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SimulateDisconnectResponse(value) + s._rawJSON = json.RawMessage(data) + return nil +} + +func (s *SimulateDisconnectResponse) 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) +} + type SimulateRemoveResponse struct { Ok bool `json:"ok" url:"ok"` diff --git a/devices/simulate/client.go b/devices/simulate/client.go index 59d0edd..a9068d1 100644 --- a/devices/simulate/client.go +++ b/devices/simulate/client.go @@ -35,6 +35,132 @@ func NewClient(opts ...option.RequestOption) *Client { } } +func (c *Client) Connect( + ctx context.Context, + request *devices.SimulateConnectRequest, + opts ...option.RequestOption, +) (*devices.SimulateConnectResponse, 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/connect" + + 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.SimulateConnectResponse + 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 +} + +func (c *Client) Disconnect( + ctx context.Context, + request *devices.SimulateDisconnectRequest, + opts ...option.RequestOption, +) (*devices.SimulateDisconnectResponse, 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/disconnect" + + 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.SimulateDisconnectResponse + 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 +} + func (c *Client) Remove( ctx context.Context, request *devices.SimulateRemoveRequest, diff --git a/devices/unmanaged.go b/devices/unmanaged.go index 67b8e46..95ebbaf 100644 --- a/devices/unmanaged.go +++ b/devices/unmanaged.go @@ -149,6 +149,8 @@ const ( UnmanagedListRequestExcludeIfItemCanProgramOfflineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_offline_access_codes" UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_online_access_codes" UnmanagedListRequestExcludeIfItemCanSimulateRemoval UnmanagedListRequestExcludeIfItem = "can_simulate_removal" + UnmanagedListRequestExcludeIfItemCanSimulateConnection UnmanagedListRequestExcludeIfItem = "can_simulate_connection" + UnmanagedListRequestExcludeIfItemCanSimulateDisconnection UnmanagedListRequestExcludeIfItem = "can_simulate_disconnection" ) func NewUnmanagedListRequestExcludeIfItemFromString(s string) (UnmanagedListRequestExcludeIfItem, error) { @@ -163,6 +165,10 @@ func NewUnmanagedListRequestExcludeIfItemFromString(s string) (UnmanagedListRequ return UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return UnmanagedListRequestExcludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return UnmanagedListRequestExcludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return UnmanagedListRequestExcludeIfItemCanSimulateDisconnection, nil } var t UnmanagedListRequestExcludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -180,6 +186,8 @@ const ( UnmanagedListRequestIncludeIfItemCanProgramOfflineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_offline_access_codes" UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_online_access_codes" UnmanagedListRequestIncludeIfItemCanSimulateRemoval UnmanagedListRequestIncludeIfItem = "can_simulate_removal" + UnmanagedListRequestIncludeIfItemCanSimulateConnection UnmanagedListRequestIncludeIfItem = "can_simulate_connection" + UnmanagedListRequestIncludeIfItemCanSimulateDisconnection UnmanagedListRequestIncludeIfItem = "can_simulate_disconnection" ) func NewUnmanagedListRequestIncludeIfItemFromString(s string) (UnmanagedListRequestIncludeIfItem, error) { @@ -194,6 +202,10 @@ func NewUnmanagedListRequestIncludeIfItemFromString(s string) (UnmanagedListRequ return UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return UnmanagedListRequestIncludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return UnmanagedListRequestIncludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return UnmanagedListRequestIncludeIfItemCanSimulateDisconnection, nil } var t UnmanagedListRequestIncludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/errors.go b/errors.go index 26ee4dd..f08834b 100644 --- a/errors.go +++ b/errors.go @@ -7,6 +7,7 @@ import ( core "github.com/seamapi/go/core" ) +// Bad Request type BadRequestError struct { *core.APIError Body interface{} @@ -30,6 +31,7 @@ func (b *BadRequestError) Unwrap() error { return b.APIError } +// Unauthorized type UnauthorizedError struct { *core.APIError Body interface{} diff --git a/events.go b/events.go index 3a3d378..41c7e0d 100644 --- a/events.go +++ b/events.go @@ -28,6 +28,231 @@ type EventsListRequest struct { Limit *float64 `json:"limit,omitempty" url:"limit,omitempty"` } +type Event struct { + EventId string `json:"event_id" url:"event_id"` + DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` + ActionAttemptId *string `json:"action_attempt_id,omitempty" url:"action_attempt_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"` + AcsSystemId *string `json:"acs_system_id,omitempty" url:"acs_system_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"` + + _rawJSON json.RawMessage +} + +func (e *Event) UnmarshalJSON(data []byte) error { + type embed Event + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + OccurredAt *core.DateTime `json:"occurred_at"` + }{ + embed: embed(*e), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *e = Event(unmarshaler.embed) + e.CreatedAt = unmarshaler.CreatedAt.Time() + e.OccurredAt = unmarshaler.OccurredAt.Time() + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *Event) MarshalJSON() ([]byte, error) { + type embed Event + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + OccurredAt *core.DateTime `json:"occurred_at"` + }{ + embed: embed(*e), + CreatedAt: core.NewDateTime(e.CreatedAt), + OccurredAt: core.NewDateTime(e.OccurredAt), + } + return json.Marshal(marshaler) +} + +func (e *Event) 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 EventType string + +const ( + EventTypeDeviceConnected EventType = "device.connected" + EventTypeDeviceUnmanagedConnected EventType = "device.unmanaged.connected" + EventTypeDeviceDisconnected EventType = "device.disconnected" + EventTypeDeviceUnmanagedDisconnected EventType = "device.unmanaged.disconnected" + EventTypeDeviceConvertedToUnmanaged EventType = "device.converted_to_unmanaged" + EventTypeDeviceUnmanagedConvertedToManaged EventType = "device.unmanaged.converted_to_managed" + EventTypeDeviceRemoved EventType = "device.removed" + EventTypeDeviceTampered EventType = "device.tampered" + EventTypeDeviceLowBattery EventType = "device.low_battery" + EventTypeDeviceBatteryStatusChanged EventType = "device.battery_status_changed" + EventTypeDeviceThirdPartyIntegrationDetected EventType = "device.third_party_integration_detected" + EventTypeDeviceThirdPartyIntegrationNoLongerDetected EventType = "device.third_party_integration_no_longer_detected" + EventTypeDeviceSaltoPrivacyModeActivated EventType = "device.salto.privacy_mode_activated" + EventTypeDeviceSaltoPrivacyModeDeactivated EventType = "device.salto.privacy_mode_deactivated" + EventTypeDeviceConnectionBecameFlaky EventType = "device.connection_became_flaky" + EventTypeDeviceConnectionStabilized EventType = "device.connection_stabilized" + EventTypeDeviceErrorSubscriptionRequired EventType = "device.error.subscription_required" + EventTypeDeviceErrorSubscriptionRequiredResolved EventType = "device.error.subscription_required.resolved" + EventTypeAccessCodeCreated EventType = "access_code.created" + EventTypeAccessCodeChanged EventType = "access_code.changed" + EventTypeAccessCodeScheduledOnDevice EventType = "access_code.scheduled_on_device" + EventTypeAccessCodeSetOnDevice EventType = "access_code.set_on_device" + EventTypeAccessCodeDeleted EventType = "access_code.deleted" + EventTypeAccessCodeRemovedFromDevice EventType = "access_code.removed_from_device" + EventTypeAccessCodeFailedToSetOnDevice EventType = "access_code.failed_to_set_on_device" + EventTypeAccessCodeDelayInSettingOnDevice EventType = "access_code.delay_in_setting_on_device" + EventTypeAccessCodeFailedToRemoveFromDevice EventType = "access_code.failed_to_remove_from_device" + EventTypeAccessCodeDelayInRemovingFromDevice EventType = "access_code.delay_in_removing_from_device" + EventTypeAccessCodeDeletedExternalToSeam EventType = "access_code.deleted_external_to_seam" + EventTypeAccessCodeModifiedExternalToSeam EventType = "access_code.modified_external_to_seam" + EventTypeAccessCodeUnmanagedConvertedToManaged EventType = "access_code.unmanaged.converted_to_managed" + EventTypeAccessCodeUnmanagedFailedToConvertToManaged EventType = "access_code.unmanaged.failed_to_convert_to_managed" + EventTypeAccessCodeUnmanagedCreated EventType = "access_code.unmanaged.created" + EventTypeAccessCodeUnmanagedRemoved EventType = "access_code.unmanaged.removed" + EventTypeLockLocked EventType = "lock.locked" + EventTypeLockUnlocked EventType = "lock.unlocked" + EventTypeConnectedAccountConnected EventType = "connected_account.connected" + EventTypeConnectedAccountSuccessfulLogin EventType = "connected_account.successful_login" + EventTypeConnectedAccountCreated EventType = "connected_account.created" + EventTypeConnectedAccountDeleted EventType = "connected_account.deleted" + EventTypeConnectedAccountDisconnected EventType = "connected_account.disconnected" + EventTypeConnectedAccountCompletedFirstSync EventType = "connected_account.completed_first_sync" + EventTypeNoiseSensorNoiseThresholdTriggered EventType = "noise_sensor.noise_threshold_triggered" + EventTypeAccessCodeBackupAccessCodePulled EventType = "access_code.backup_access_code_pulled" + EventTypeEnrollmentAutomationDeleted EventType = "enrollment_automation.deleted" + EventTypeAcsUserDeleted EventType = "acs_user.deleted" + EventTypeAcsCredentialDeleted EventType = "acs_credential.deleted" + EventTypePhoneDeactivated EventType = "phone.deactivated" + EventTypeClientSessionDeleted EventType = "client_session.deleted" +) + +func NewEventTypeFromString(s string) (EventType, error) { + switch s { + case "device.connected": + return EventTypeDeviceConnected, nil + case "device.unmanaged.connected": + return EventTypeDeviceUnmanagedConnected, nil + case "device.disconnected": + return EventTypeDeviceDisconnected, nil + case "device.unmanaged.disconnected": + return EventTypeDeviceUnmanagedDisconnected, nil + case "device.converted_to_unmanaged": + return EventTypeDeviceConvertedToUnmanaged, nil + case "device.unmanaged.converted_to_managed": + return EventTypeDeviceUnmanagedConvertedToManaged, nil + case "device.removed": + return EventTypeDeviceRemoved, nil + case "device.tampered": + return EventTypeDeviceTampered, nil + case "device.low_battery": + return EventTypeDeviceLowBattery, nil + case "device.battery_status_changed": + return EventTypeDeviceBatteryStatusChanged, nil + case "device.third_party_integration_detected": + return EventTypeDeviceThirdPartyIntegrationDetected, nil + case "device.third_party_integration_no_longer_detected": + return EventTypeDeviceThirdPartyIntegrationNoLongerDetected, nil + case "device.salto.privacy_mode_activated": + return EventTypeDeviceSaltoPrivacyModeActivated, nil + case "device.salto.privacy_mode_deactivated": + return EventTypeDeviceSaltoPrivacyModeDeactivated, nil + case "device.connection_became_flaky": + return EventTypeDeviceConnectionBecameFlaky, nil + case "device.connection_stabilized": + return EventTypeDeviceConnectionStabilized, nil + case "device.error.subscription_required": + return EventTypeDeviceErrorSubscriptionRequired, nil + case "device.error.subscription_required.resolved": + return EventTypeDeviceErrorSubscriptionRequiredResolved, nil + case "access_code.created": + return EventTypeAccessCodeCreated, nil + case "access_code.changed": + return EventTypeAccessCodeChanged, nil + case "access_code.scheduled_on_device": + return EventTypeAccessCodeScheduledOnDevice, nil + case "access_code.set_on_device": + return EventTypeAccessCodeSetOnDevice, nil + case "access_code.deleted": + return EventTypeAccessCodeDeleted, nil + case "access_code.removed_from_device": + return EventTypeAccessCodeRemovedFromDevice, nil + case "access_code.failed_to_set_on_device": + return EventTypeAccessCodeFailedToSetOnDevice, nil + case "access_code.delay_in_setting_on_device": + return EventTypeAccessCodeDelayInSettingOnDevice, nil + case "access_code.failed_to_remove_from_device": + return EventTypeAccessCodeFailedToRemoveFromDevice, nil + case "access_code.delay_in_removing_from_device": + return EventTypeAccessCodeDelayInRemovingFromDevice, nil + case "access_code.deleted_external_to_seam": + return EventTypeAccessCodeDeletedExternalToSeam, nil + case "access_code.modified_external_to_seam": + return EventTypeAccessCodeModifiedExternalToSeam, nil + case "access_code.unmanaged.converted_to_managed": + return EventTypeAccessCodeUnmanagedConvertedToManaged, nil + case "access_code.unmanaged.failed_to_convert_to_managed": + return EventTypeAccessCodeUnmanagedFailedToConvertToManaged, nil + case "access_code.unmanaged.created": + return EventTypeAccessCodeUnmanagedCreated, nil + case "access_code.unmanaged.removed": + return EventTypeAccessCodeUnmanagedRemoved, nil + case "lock.locked": + return EventTypeLockLocked, nil + case "lock.unlocked": + return EventTypeLockUnlocked, nil + case "connected_account.connected": + return EventTypeConnectedAccountConnected, nil + case "connected_account.successful_login": + return EventTypeConnectedAccountSuccessfulLogin, nil + case "connected_account.created": + return EventTypeConnectedAccountCreated, nil + case "connected_account.deleted": + return EventTypeConnectedAccountDeleted, nil + case "connected_account.disconnected": + return EventTypeConnectedAccountDisconnected, nil + case "connected_account.completed_first_sync": + return EventTypeConnectedAccountCompletedFirstSync, nil + case "noise_sensor.noise_threshold_triggered": + return EventTypeNoiseSensorNoiseThresholdTriggered, nil + case "access_code.backup_access_code_pulled": + return EventTypeAccessCodeBackupAccessCodePulled, nil + case "enrollment_automation.deleted": + return EventTypeEnrollmentAutomationDeleted, nil + case "acs_user.deleted": + return EventTypeAcsUserDeleted, nil + case "acs_credential.deleted": + return EventTypeAcsCredentialDeleted, nil + case "phone.deactivated": + return EventTypePhoneDeactivated, nil + case "client_session.deleted": + return EventTypeClientSessionDeleted, nil + } + var t EventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (e EventType) Ptr() *EventType { + return &e +} + type EventsGetResponse struct { Event *Event `json:"event,omitempty" url:"event,omitempty"` Message *string `json:"message,omitempty" url:"message,omitempty"` diff --git a/locks.go b/locks.go index e1574b7..496fb08 100644 --- a/locks.go +++ b/locks.go @@ -154,6 +154,8 @@ const ( LocksListRequestExcludeIfItemCanProgramOfflineAccessCodes LocksListRequestExcludeIfItem = "can_program_offline_access_codes" LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes LocksListRequestExcludeIfItem = "can_program_online_access_codes" LocksListRequestExcludeIfItemCanSimulateRemoval LocksListRequestExcludeIfItem = "can_simulate_removal" + LocksListRequestExcludeIfItemCanSimulateConnection LocksListRequestExcludeIfItem = "can_simulate_connection" + LocksListRequestExcludeIfItemCanSimulateDisconnection LocksListRequestExcludeIfItem = "can_simulate_disconnection" ) func NewLocksListRequestExcludeIfItemFromString(s string) (LocksListRequestExcludeIfItem, error) { @@ -168,6 +170,10 @@ func NewLocksListRequestExcludeIfItemFromString(s string) (LocksListRequestExclu return LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return LocksListRequestExcludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return LocksListRequestExcludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return LocksListRequestExcludeIfItemCanSimulateDisconnection, nil } var t LocksListRequestExcludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -185,6 +191,8 @@ const ( LocksListRequestIncludeIfItemCanProgramOfflineAccessCodes LocksListRequestIncludeIfItem = "can_program_offline_access_codes" LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes LocksListRequestIncludeIfItem = "can_program_online_access_codes" LocksListRequestIncludeIfItemCanSimulateRemoval LocksListRequestIncludeIfItem = "can_simulate_removal" + LocksListRequestIncludeIfItemCanSimulateConnection LocksListRequestIncludeIfItem = "can_simulate_connection" + LocksListRequestIncludeIfItemCanSimulateDisconnection LocksListRequestIncludeIfItem = "can_simulate_disconnection" ) func NewLocksListRequestIncludeIfItemFromString(s string) (LocksListRequestIncludeIfItem, error) { @@ -199,6 +207,10 @@ func NewLocksListRequestIncludeIfItemFromString(s string) (LocksListRequestInclu return LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return LocksListRequestIncludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return LocksListRequestIncludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return LocksListRequestIncludeIfItemCanSimulateDisconnection, nil } var t LocksListRequestIncludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/networks.go b/networks.go index a7f4215..a7514cd 100644 --- a/networks.go +++ b/networks.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" core "github.com/seamapi/go/core" + time "time" ) type NetworksGetRequest struct { @@ -15,6 +16,56 @@ type NetworksGetRequest struct { type NetworksListRequest struct { } +type Network struct { + NetworkId string `json:"network_id" url:"network_id"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + DisplayName string `json:"display_name" url:"display_name"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + + _rawJSON json.RawMessage +} + +func (n *Network) UnmarshalJSON(data []byte) error { + type embed Network + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*n), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *n = Network(unmarshaler.embed) + n.CreatedAt = unmarshaler.CreatedAt.Time() + n._rawJSON = json.RawMessage(data) + return nil +} + +func (n *Network) MarshalJSON() ([]byte, error) { + type embed Network + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*n), + CreatedAt: core.NewDateTime(n.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (n *Network) String() string { + if len(n._rawJSON) > 0 { + if value, err := core.StringifyJSON(n._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(n); err == nil { + return value + } + return fmt.Sprintf("%#v", n) +} + type NetworksGetResponse struct { Network *Network `json:"network,omitempty" url:"network,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/thermostats.go b/thermostats.go index 769961e..056afd4 100644 --- a/thermostats.go +++ b/thermostats.go @@ -88,6 +88,28 @@ type ThermostatsSetFanModeRequest struct { Sync *bool `json:"sync,omitempty" url:"sync,omitempty"` } +type FanMode string + +const ( + FanModeAuto FanMode = "auto" + FanModeOn FanMode = "on" +) + +func NewFanModeFromString(s string) (FanMode, error) { + switch s { + case "auto": + return FanModeAuto, nil + case "on": + return FanModeOn, nil + } + var t FanMode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (f FanMode) Ptr() *FanMode { + return &f +} + type ThermostatsCoolResponse struct { ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -273,6 +295,8 @@ const ( ThermostatsListRequestExcludeIfItemCanProgramOfflineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_offline_access_codes" ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_online_access_codes" ThermostatsListRequestExcludeIfItemCanSimulateRemoval ThermostatsListRequestExcludeIfItem = "can_simulate_removal" + ThermostatsListRequestExcludeIfItemCanSimulateConnection ThermostatsListRequestExcludeIfItem = "can_simulate_connection" + ThermostatsListRequestExcludeIfItemCanSimulateDisconnection ThermostatsListRequestExcludeIfItem = "can_simulate_disconnection" ) func NewThermostatsListRequestExcludeIfItemFromString(s string) (ThermostatsListRequestExcludeIfItem, error) { @@ -287,6 +311,10 @@ func NewThermostatsListRequestExcludeIfItemFromString(s string) (ThermostatsList return ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return ThermostatsListRequestExcludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return ThermostatsListRequestExcludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return ThermostatsListRequestExcludeIfItemCanSimulateDisconnection, nil } var t ThermostatsListRequestExcludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -304,6 +332,8 @@ const ( ThermostatsListRequestIncludeIfItemCanProgramOfflineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_offline_access_codes" ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_online_access_codes" ThermostatsListRequestIncludeIfItemCanSimulateRemoval ThermostatsListRequestIncludeIfItem = "can_simulate_removal" + ThermostatsListRequestIncludeIfItemCanSimulateConnection ThermostatsListRequestIncludeIfItem = "can_simulate_connection" + ThermostatsListRequestIncludeIfItemCanSimulateDisconnection ThermostatsListRequestIncludeIfItem = "can_simulate_disconnection" ) func NewThermostatsListRequestIncludeIfItemFromString(s string) (ThermostatsListRequestIncludeIfItem, error) { @@ -318,6 +348,10 @@ func NewThermostatsListRequestIncludeIfItemFromString(s string) (ThermostatsList return ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": return ThermostatsListRequestIncludeIfItemCanSimulateRemoval, nil + case "can_simulate_connection": + return ThermostatsListRequestIncludeIfItemCanSimulateConnection, nil + case "can_simulate_disconnection": + return ThermostatsListRequestIncludeIfItemCanSimulateDisconnection, nil } var t ThermostatsListRequestIncludeIfItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -475,6 +509,34 @@ func (t *ThermostatsUpdateRequestDefaultClimateSetting) String() string { return fmt.Sprintf("%#v", t) } +type ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting string + +const ( + ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingOff ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "off" + ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeat ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "heat" + ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingCool ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "cool" + ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeatCool ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "heat_cool" +) + +func NewThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingFromString(s string) (ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting, error) { + switch s { + case "off": + return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingOff, nil + case "heat": + return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeat, nil + case "cool": + return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingCool, nil + case "heat_cool": + return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeatCool, nil + } + var t ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting) Ptr() *ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting { + return &t +} + type ThermostatsUpdateResponse struct { Ok bool `json:"ok" url:"ok"` diff --git a/types.go b/types.go index 6066cbc..62d7862 100644 --- a/types.go +++ b/types.go @@ -9,171 +9,17 @@ import ( time "time" ) -type AccessCode struct { - // Unique identifier for a group of access codes that share the same code. - CommonCodeKey *string `json:"common_code_key,omitempty" url:"common_code_key,omitempty"` - // Indicates whether the code is set on the device according to a preconfigured schedule. - IsScheduledOnDevice *bool `json:"is_scheduled_on_device,omitempty" url:"is_scheduled_on_device,omitempty"` - // Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. - Type AccessCodeType `json:"type,omitempty" url:"type,omitempty"` - // Indicates whether the access code is waiting for a code assignment. - IsWaitingForCodeAssignment *bool `json:"is_waiting_for_code_assignment,omitempty" url:"is_waiting_for_code_assignment,omitempty"` - // Unique identifier for the access code. - AccessCodeId string `json:"access_code_id" url:"access_code_id"` - // Unique identifier for the device associated with the access code. - DeviceId string `json:"device_id" url:"device_id"` - // Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. - Name *string `json:"name,omitempty" url:"name,omitempty"` - // Code used for access. Typically, a numeric or alphanumeric string. - Code *string `json:"code,omitempty" url:"code,omitempty"` - // Date and time at which the access code was created. - CreatedAt time.Time `json:"created_at" url:"created_at"` - Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` - Warnings interface{} `json:"warnings,omitempty" url:"warnings,omitempty"` - // Indicates whether Seam manages the access code. - IsManaged bool `json:"is_managed" url:"is_managed"` - // Date and time at which the time-bound access code becomes active. - StartsAt *time.Time `json:"starts_at,omitempty" url:"starts_at,omitempty"` - // Date and time after which the time-bound access code becomes inactive. - EndsAt *time.Time `json:"ends_at,omitempty" url:"ends_at,omitempty"` - // Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. - Status AccessCodeStatus `json:"status,omitempty" url:"status,omitempty"` - // Indicates whether a backup access code is available for use if the primary access code is lost or compromised. - IsBackupAccessCodeAvailable bool `json:"is_backup_access_code_available" url:"is_backup_access_code_available"` - // Indicates whether the access code is a backup code. - IsBackup *bool `json:"is_backup,omitempty" url:"is_backup,omitempty"` - // Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. - PulledBackupAccessCodeId *string `json:"pulled_backup_access_code_id,omitempty" url:"pulled_backup_access_code_id,omitempty"` - // Indicates whether changes to the access code from external sources are permitted. - IsExternalModificationAllowed bool `json:"is_external_modification_allowed" url:"is_external_modification_allowed"` - // Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use. - IsOneTimeUse bool `json:"is_one_time_use" url:"is_one_time_use"` - // Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection. - IsOfflineAccessCode bool `json:"is_offline_access_code" url:"is_offline_access_code"` - - _rawJSON json.RawMessage -} - -func (a *AccessCode) UnmarshalJSON(data []byte) error { - type embed AccessCode - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - StartsAt *core.DateTime `json:"starts_at,omitempty"` - EndsAt *core.DateTime `json:"ends_at,omitempty"` - }{ - embed: embed(*a), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *a = AccessCode(unmarshaler.embed) - a.CreatedAt = unmarshaler.CreatedAt.Time() - a.StartsAt = unmarshaler.StartsAt.TimePtr() - a.EndsAt = unmarshaler.EndsAt.TimePtr() - a._rawJSON = json.RawMessage(data) - return nil -} - -func (a *AccessCode) MarshalJSON() ([]byte, error) { - type embed AccessCode - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - StartsAt *core.DateTime `json:"starts_at,omitempty"` - EndsAt *core.DateTime `json:"ends_at,omitempty"` - }{ - embed: embed(*a), - CreatedAt: core.NewDateTime(a.CreatedAt), - StartsAt: core.NewOptionalDateTime(a.StartsAt), - EndsAt: core.NewOptionalDateTime(a.EndsAt), - } - return json.Marshal(marshaler) -} - -func (a *AccessCode) String() string { - if len(a._rawJSON) > 0 { - if value, err := core.StringifyJSON(a._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(a); err == nil { - return value - } - return fmt.Sprintf("%#v", a) -} - -// Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. -type AccessCodeStatus string - -const ( - AccessCodeStatusSetting AccessCodeStatus = "setting" - AccessCodeStatusSet AccessCodeStatus = "set" - AccessCodeStatusUnset AccessCodeStatus = "unset" - AccessCodeStatusRemoving AccessCodeStatus = "removing" - AccessCodeStatusUnknown AccessCodeStatus = "unknown" -) - -func NewAccessCodeStatusFromString(s string) (AccessCodeStatus, error) { - switch s { - case "setting": - return AccessCodeStatusSetting, nil - case "set": - return AccessCodeStatusSet, nil - case "unset": - return AccessCodeStatusUnset, nil - case "removing": - return AccessCodeStatusRemoving, nil - case "unknown": - return AccessCodeStatusUnknown, nil - } - var t AccessCodeStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (a AccessCodeStatus) Ptr() *AccessCodeStatus { - return &a -} - -// Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. -type AccessCodeType string - -const ( - AccessCodeTypeTimeBound AccessCodeType = "time_bound" - AccessCodeTypeOngoing AccessCodeType = "ongoing" -) - -func NewAccessCodeTypeFromString(s string) (AccessCodeType, error) { - switch s { - case "time_bound": - return AccessCodeTypeTimeBound, nil - case "ongoing": - return AccessCodeTypeOngoing, nil - } - var t AccessCodeType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (a AccessCodeType) Ptr() *AccessCodeType { - return &a -} - type AcsAccessGroup struct { - AcsAccessGroupId string `json:"acs_access_group_id" url:"acs_access_group_id"` - 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"` - CreatedAt time.Time `json:"created_at" url:"created_at"` + AcsAccessGroupId string `json:"acs_access_group_id" url:"acs_access_group_id"` + AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + Name string `json:"name" url:"name"` + AccessGroupType AcsAccessGroupAccessGroupType `json:"access_group_type,omitempty" url:"access_group_type,omitempty"` + AccessGroupTypeDisplayName string `json:"access_group_type_display_name" url:"access_group_type_display_name"` + DisplayName string `json:"display_name" url:"display_name"` + ExternalType AcsAccessGroupExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` + ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` + CreatedAt time.Time `json:"created_at" url:"created_at"` _rawJSON json.RawMessage } @@ -219,9 +65,6 @@ func (a *AcsAccessGroup) String() string { return fmt.Sprintf("%#v", a) } -// --- -// deprecated: use external_type -// --- type AcsAccessGroupAccessGroupType string const ( @@ -279,24 +122,26 @@ func (a AcsAccessGroupExternalType) Ptr() *AcsAccessGroupExternalType { } type AcsCredential struct { - AcsCredentialId string `json:"acs_credential_id" url:"acs_credential_id"` - AcsUserId *string `json:"acs_user_id,omitempty" url:"acs_user_id,omitempty"` - AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty" url:"acs_credential_pool_id,omitempty"` - AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` - ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty" url:"parent_acs_credential_id,omitempty"` - DisplayName string `json:"display_name" url:"display_name"` - Code *string `json:"code,omitempty" url:"code,omitempty"` - AccessMethod AcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *AcsCredentialExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` - ExternalTypeDisplayName *string `json:"external_type_display_name,omitempty" url:"external_type_display_name,omitempty"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - StartsAt *string `json:"starts_at,omitempty" url:"starts_at,omitempty"` - EndsAt *string `json:"ends_at,omitempty" url:"ends_at,omitempty"` - Errors []*AcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*AcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *AcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` + AcsCredentialId string `json:"acs_credential_id" url:"acs_credential_id"` + AcsUserId *string `json:"acs_user_id,omitempty" url:"acs_user_id,omitempty"` + AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty" url:"acs_credential_pool_id,omitempty"` + AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` + ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty" url:"parent_acs_credential_id,omitempty"` + DisplayName string `json:"display_name" url:"display_name"` + Code *string `json:"code,omitempty" url:"code,omitempty"` + AccessMethod AcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` + ExternalType *AcsCredentialExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` + ExternalTypeDisplayName *string `json:"external_type_display_name,omitempty" url:"external_type_display_name,omitempty"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + StartsAt *string `json:"starts_at,omitempty" url:"starts_at,omitempty"` + EndsAt *string `json:"ends_at,omitempty" url:"ends_at,omitempty"` + Errors []*AcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` + Warnings []*AcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` + IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` + IsLatestDesiredStateSyncedWithProvider *bool `json:"is_latest_desired_state_synced_with_provider,omitempty" url:"is_latest_desired_state_synced_with_provider,omitempty"` + LatestDesiredStateSyncedWithProviderAt *time.Time `json:"latest_desired_state_synced_with_provider_at,omitempty" url:"latest_desired_state_synced_with_provider_at,omitempty"` + VisionlineMetadata *AcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage } @@ -305,7 +150,8 @@ func (a *AcsCredential) UnmarshalJSON(data []byte) error { type embed AcsCredential var unmarshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` + CreatedAt *core.DateTime `json:"created_at"` + LatestDesiredStateSyncedWithProviderAt *core.DateTime `json:"latest_desired_state_synced_with_provider_at,omitempty"` }{ embed: embed(*a), } @@ -314,6 +160,7 @@ func (a *AcsCredential) UnmarshalJSON(data []byte) error { } *a = AcsCredential(unmarshaler.embed) a.CreatedAt = unmarshaler.CreatedAt.Time() + a.LatestDesiredStateSyncedWithProviderAt = unmarshaler.LatestDesiredStateSyncedWithProviderAt.TimePtr() a._rawJSON = json.RawMessage(data) return nil } @@ -322,10 +169,12 @@ func (a *AcsCredential) MarshalJSON() ([]byte, error) { type embed AcsCredential var marshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` + CreatedAt *core.DateTime `json:"created_at"` + LatestDesiredStateSyncedWithProviderAt *core.DateTime `json:"latest_desired_state_synced_with_provider_at,omitempty"` }{ - embed: embed(*a), - CreatedAt: core.NewDateTime(a.CreatedAt), + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + LatestDesiredStateSyncedWithProviderAt: core.NewOptionalDateTime(a.LatestDesiredStateSyncedWithProviderAt), } return json.Marshal(marshaler) } @@ -621,12 +470,12 @@ func (a *AcsCredentialWarningsItem) String() string { } type AcsEntrance struct { - AcsEntranceId string `json:"acs_entrance_id" url:"acs_entrance_id"` - DisplayName string `json:"display_name" url:"display_name"` AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` + AcsEntranceId string `json:"acs_entrance_id" url:"acs_entrance_id"` CreatedAt time.Time `json:"created_at" url:"created_at"` - LatchMetadata *AcsEntranceLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` + DisplayName string `json:"display_name" url:"display_name"` Errors []*AcsEntranceErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` + LatchMetadata *AcsEntranceLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` VisionlineMetadata *AcsEntranceVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage @@ -853,27 +702,23 @@ func (a AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType) Ptr( } 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,omitempty" url:"external_type_display_name,omitempty"` - // --- - // 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,omitempty" url:"system_type_display_name,omitempty"` - Name string `json:"name" url:"name"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - 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"` - CanCreateAcsAccessGroups *bool `json:"can_create_acs_access_groups,omitempty" url:"can_create_acs_access_groups,omitempty"` - CanRemoveAcsUsersFromAcsAccessGroups *bool `json:"can_remove_acs_users_from_acs_access_groups,omitempty" url:"can_remove_acs_users_from_acs_access_groups,omitempty"` - CanAddAcsUsersToAcsAccessGroups *bool `json:"can_add_acs_users_to_acs_access_groups,omitempty" url:"can_add_acs_users_to_acs_access_groups,omitempty"` + 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,omitempty" url:"external_type_display_name,omitempty"` + SystemType *AcsSystemSystemType `json:"system_type,omitempty" url:"system_type,omitempty"` + SystemTypeDisplayName *string `json:"system_type_display_name,omitempty" url:"system_type_display_name,omitempty"` + Name string `json:"name" url:"name"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + 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"` + Errors []*AcsSystemErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` + Warnings []*AcsSystemWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` + CanAutomateEnrollment *bool `json:"can_automate_enrollment,omitempty" url:"can_automate_enrollment,omitempty"` + CanCreateAcsAccessGroups *bool `json:"can_create_acs_access_groups,omitempty" url:"can_create_acs_access_groups,omitempty"` + CanRemoveAcsUsersFromAcsAccessGroups *bool `json:"can_remove_acs_users_from_acs_access_groups,omitempty" url:"can_remove_acs_users_from_acs_access_groups,omitempty"` + CanAddAcsUsersToAcsAccessGroups *bool `json:"can_add_acs_users_to_acs_access_groups,omitempty" url:"can_add_acs_users_to_acs_access_groups,omitempty"` _rawJSON json.RawMessage } @@ -919,6 +764,182 @@ func (a *AcsSystem) String() string { return fmt.Sprintf("%#v", a) } +type AcsSystemErrorsItem struct { + ErrorCode string + SeamBridgeDisconnected *AcsSystemErrorsItemSeamBridgeDisconnected + VisionlineInstanceUnreachable *AcsSystemErrorsItemVisionlineInstanceUnreachable +} + +func NewAcsSystemErrorsItemFromSeamBridgeDisconnected(value *AcsSystemErrorsItemSeamBridgeDisconnected) *AcsSystemErrorsItem { + return &AcsSystemErrorsItem{ErrorCode: "seam_bridge_disconnected", SeamBridgeDisconnected: value} +} + +func NewAcsSystemErrorsItemFromVisionlineInstanceUnreachable(value *AcsSystemErrorsItemVisionlineInstanceUnreachable) *AcsSystemErrorsItem { + return &AcsSystemErrorsItem{ErrorCode: "visionline_instance_unreachable", VisionlineInstanceUnreachable: value} +} + +func (a *AcsSystemErrorsItem) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + ErrorCode string `json:"error_code"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + a.ErrorCode = unmarshaler.ErrorCode + switch unmarshaler.ErrorCode { + case "seam_bridge_disconnected": + value := new(AcsSystemErrorsItemSeamBridgeDisconnected) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + a.SeamBridgeDisconnected = value + case "visionline_instance_unreachable": + value := new(AcsSystemErrorsItemVisionlineInstanceUnreachable) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + a.VisionlineInstanceUnreachable = value + } + return nil +} + +func (a AcsSystemErrorsItem) MarshalJSON() ([]byte, error) { + switch a.ErrorCode { + default: + return nil, fmt.Errorf("invalid type %s in %T", a.ErrorCode, a) + case "seam_bridge_disconnected": + var marshaler = struct { + ErrorCode string `json:"error_code"` + *AcsSystemErrorsItemSeamBridgeDisconnected + }{ + ErrorCode: a.ErrorCode, + AcsSystemErrorsItemSeamBridgeDisconnected: a.SeamBridgeDisconnected, + } + return json.Marshal(marshaler) + case "visionline_instance_unreachable": + var marshaler = struct { + ErrorCode string `json:"error_code"` + *AcsSystemErrorsItemVisionlineInstanceUnreachable + }{ + ErrorCode: a.ErrorCode, + AcsSystemErrorsItemVisionlineInstanceUnreachable: a.VisionlineInstanceUnreachable, + } + return json.Marshal(marshaler) + } +} + +type AcsSystemErrorsItemVisitor interface { + VisitSeamBridgeDisconnected(*AcsSystemErrorsItemSeamBridgeDisconnected) error + VisitVisionlineInstanceUnreachable(*AcsSystemErrorsItemVisionlineInstanceUnreachable) error +} + +func (a *AcsSystemErrorsItem) Accept(visitor AcsSystemErrorsItemVisitor) error { + switch a.ErrorCode { + default: + return fmt.Errorf("invalid type %s in %T", a.ErrorCode, a) + case "seam_bridge_disconnected": + return visitor.VisitSeamBridgeDisconnected(a.SeamBridgeDisconnected) + case "visionline_instance_unreachable": + return visitor.VisitVisionlineInstanceUnreachable(a.VisionlineInstanceUnreachable) + } +} + +type AcsSystemErrorsItemSeamBridgeDisconnected struct { + CreatedAt time.Time `json:"created_at" url:"created_at"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *AcsSystemErrorsItemSeamBridgeDisconnected) UnmarshalJSON(data []byte) error { + type embed AcsSystemErrorsItemSeamBridgeDisconnected + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsSystemErrorsItemSeamBridgeDisconnected(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsSystemErrorsItemSeamBridgeDisconnected) MarshalJSON() ([]byte, error) { + type embed AcsSystemErrorsItemSeamBridgeDisconnected + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (a *AcsSystemErrorsItemSeamBridgeDisconnected) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type AcsSystemErrorsItemVisionlineInstanceUnreachable struct { + CreatedAt time.Time `json:"created_at" url:"created_at"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *AcsSystemErrorsItemVisionlineInstanceUnreachable) UnmarshalJSON(data []byte) error { + type embed AcsSystemErrorsItemVisionlineInstanceUnreachable + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsSystemErrorsItemVisionlineInstanceUnreachable(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsSystemErrorsItemVisionlineInstanceUnreachable) MarshalJSON() ([]byte, error) { + type embed AcsSystemErrorsItemVisionlineInstanceUnreachable + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (a *AcsSystemErrorsItemVisionlineInstanceUnreachable) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AcsSystemExternalType string const ( @@ -959,9 +980,6 @@ func (a AcsSystemExternalType) Ptr() *AcsSystemExternalType { return &a } -// --- -// deprecated: use external_type -// --- type AcsSystemSystemType string const ( @@ -1002,6 +1020,33 @@ func (a AcsSystemSystemType) Ptr() *AcsSystemSystemType { return &a } +type AcsSystemWarningsItem struct { + _rawJSON json.RawMessage +} + +func (a *AcsSystemWarningsItem) UnmarshalJSON(data []byte) error { + type unmarshaler AcsSystemWarningsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsSystemWarningsItem(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsSystemWarningsItem) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AcsUser struct { AcsUserId string `json:"acs_user_id" url:"acs_user_id"` AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` @@ -1018,12 +1063,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. - // --- - 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"` + 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"` _rawJSON json.RawMessage } @@ -1153,129 +1195,3874 @@ func (a AcsUserExternalType) Ptr() *AcsUserExternalType { } type ActionAttempt struct { - Status string - Success *ActionAttemptSuccess - Pending *ActionAttemptPending - Error *ActionAttemptError + typeName string + // Locking door. + ActionAttemptZero *ActionAttemptZero + // Locking door succeeded. + ActionAttemptOne *ActionAttemptOne + // Locking door failed. + ActionAttemptTwo *ActionAttemptTwo + // Unlocking door. + ActionAttemptThree *ActionAttemptThree + // Unlocking door succeeded. + ActionAttemptFour *ActionAttemptFour + // Unlocking door failed. + ActionAttemptFive *ActionAttemptFive + // Resetting sandbox workspace. + ActionAttemptSix *ActionAttemptSix + // Resetting sandbox workspace succeeded. + ActionAttemptSeven *ActionAttemptSeven + // Resetting sandbox workspace failed. + ActionAttemptEight *ActionAttemptEight + // Setting HVAC to cool. + ActionAttemptNine *ActionAttemptNine + // Setting HVAC to cool succeeded. + ActionAttemptTen *ActionAttemptTen + // Setting HVAC to cool failed. + ActionAttemptEleven *ActionAttemptEleven + // Setting HVAC to heat mode. + ActionAttemptTwelve *ActionAttemptTwelve + // Setting HVAC to heat mode succeeded. + ActionAttemptThirteen *ActionAttemptThirteen + // Setting HVAC to heat mode failed. + ActionAttemptFourteen *ActionAttemptFourteen + // Setting HVAC to heat-cool mode. + ActionAttemptFifteen *ActionAttemptFifteen + // Setting HVAC to heat-cool mode succeeded. + ActionAttemptSixteen *ActionAttemptSixteen + // Setting heat-cool mode failed. + ActionAttemptSeventeen *ActionAttemptSeventeen + // Setting fan mode. + ActionAttemptEighteen *ActionAttemptEighteen + // Setting fan mode succeeded. + ActionAttemptNineteen *ActionAttemptNineteen + // Setting fan mode failed. + ActionAttemptTwenty *ActionAttemptTwenty + // Turning HVAC off. + ActionAttemptTwentyOne *ActionAttemptTwentyOne + // Turning HVAC off succeeded. + ActionAttemptTwentyTwo *ActionAttemptTwentyTwo + // Turning HVAC off failed. + ActionAttemptTwentyThree *ActionAttemptTwentyThree + ActionAttemptTwentyFour *ActionAttemptTwentyFour + ActionAttemptTwentyFive *ActionAttemptTwentyFive + ActionAttemptTwentySix *ActionAttemptTwentySix + ActionAttemptTwentySeven *ActionAttemptTwentySeven + ActionAttemptTwentyEight *ActionAttemptTwentyEight + ActionAttemptTwentyNine *ActionAttemptTwentyNine + ActionAttemptThirty *ActionAttemptThirty + ActionAttemptThirtyOne *ActionAttemptThirtyOne + ActionAttemptThirtyTwo *ActionAttemptThirtyTwo + ActionAttemptThirtyThree *ActionAttemptThirtyThree + ActionAttemptThirtyFour *ActionAttemptThirtyFour + ActionAttemptThirtyFive *ActionAttemptThirtyFive + ActionAttemptThirtySix *ActionAttemptThirtySix + ActionAttemptThirtySeven *ActionAttemptThirtySeven + ActionAttemptThirtyEight *ActionAttemptThirtyEight + ActionAttemptThirtyNine *ActionAttemptThirtyNine + ActionAttemptForty *ActionAttemptForty + ActionAttemptFortyOne *ActionAttemptFortyOne + ActionAttemptFortyTwo *ActionAttemptFortyTwo + ActionAttemptFortyThree *ActionAttemptFortyThree + ActionAttemptActionAttemptId *ActionAttemptActionAttemptId } -func NewActionAttemptFromSuccess(value *ActionAttemptSuccess) *ActionAttempt { - return &ActionAttempt{Status: "success", Success: value} +func NewActionAttemptFromActionAttemptZero(value *ActionAttemptZero) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptZero", ActionAttemptZero: value} } -func NewActionAttemptFromPending(value *ActionAttemptPending) *ActionAttempt { - return &ActionAttempt{Status: "pending", Pending: value} +func NewActionAttemptFromActionAttemptOne(value *ActionAttemptOne) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptOne", ActionAttemptOne: value} } -func NewActionAttemptFromError(value *ActionAttemptError) *ActionAttempt { - return &ActionAttempt{Status: "error", Error: value} +func NewActionAttemptFromActionAttemptTwo(value *ActionAttemptTwo) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwo", ActionAttemptTwo: value} } -func (a *ActionAttempt) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Status string `json:"status"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - a.Status = unmarshaler.Status - switch unmarshaler.Status { - case "success": - value := new(ActionAttemptSuccess) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - a.Success = value - case "pending": - value := new(ActionAttemptPending) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - a.Pending = value - case "error": - value := new(ActionAttemptError) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - a.Error = value - } - return nil +func NewActionAttemptFromActionAttemptThree(value *ActionAttemptThree) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThree", ActionAttemptThree: value} } -func (a ActionAttempt) MarshalJSON() ([]byte, error) { - switch a.Status { - default: - return nil, fmt.Errorf("invalid type %s in %T", a.Status, a) - case "success": - var marshaler = struct { - Status string `json:"status"` - *ActionAttemptSuccess - }{ - Status: a.Status, - ActionAttemptSuccess: a.Success, +func NewActionAttemptFromActionAttemptFour(value *ActionAttemptFour) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFour", ActionAttemptFour: value} +} + +func NewActionAttemptFromActionAttemptFive(value *ActionAttemptFive) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFive", ActionAttemptFive: value} +} + +func NewActionAttemptFromActionAttemptSix(value *ActionAttemptSix) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptSix", ActionAttemptSix: value} +} + +func NewActionAttemptFromActionAttemptSeven(value *ActionAttemptSeven) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptSeven", ActionAttemptSeven: value} +} + +func NewActionAttemptFromActionAttemptEight(value *ActionAttemptEight) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptEight", ActionAttemptEight: value} +} + +func NewActionAttemptFromActionAttemptNine(value *ActionAttemptNine) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptNine", ActionAttemptNine: value} +} + +func NewActionAttemptFromActionAttemptTen(value *ActionAttemptTen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTen", ActionAttemptTen: value} +} + +func NewActionAttemptFromActionAttemptEleven(value *ActionAttemptEleven) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptEleven", ActionAttemptEleven: value} +} + +func NewActionAttemptFromActionAttemptTwelve(value *ActionAttemptTwelve) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwelve", ActionAttemptTwelve: value} +} + +func NewActionAttemptFromActionAttemptThirteen(value *ActionAttemptThirteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirteen", ActionAttemptThirteen: value} +} + +func NewActionAttemptFromActionAttemptFourteen(value *ActionAttemptFourteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFourteen", ActionAttemptFourteen: value} +} + +func NewActionAttemptFromActionAttemptFifteen(value *ActionAttemptFifteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFifteen", ActionAttemptFifteen: value} +} + +func NewActionAttemptFromActionAttemptSixteen(value *ActionAttemptSixteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptSixteen", ActionAttemptSixteen: value} +} + +func NewActionAttemptFromActionAttemptSeventeen(value *ActionAttemptSeventeen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptSeventeen", ActionAttemptSeventeen: value} +} + +func NewActionAttemptFromActionAttemptEighteen(value *ActionAttemptEighteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptEighteen", ActionAttemptEighteen: value} +} + +func NewActionAttemptFromActionAttemptNineteen(value *ActionAttemptNineteen) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptNineteen", ActionAttemptNineteen: value} +} + +func NewActionAttemptFromActionAttemptTwenty(value *ActionAttemptTwenty) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwenty", ActionAttemptTwenty: value} +} + +func NewActionAttemptFromActionAttemptTwentyOne(value *ActionAttemptTwentyOne) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyOne", ActionAttemptTwentyOne: value} +} + +func NewActionAttemptFromActionAttemptTwentyTwo(value *ActionAttemptTwentyTwo) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyTwo", ActionAttemptTwentyTwo: value} +} + +func NewActionAttemptFromActionAttemptTwentyThree(value *ActionAttemptTwentyThree) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyThree", ActionAttemptTwentyThree: value} +} + +func NewActionAttemptFromActionAttemptTwentyFour(value *ActionAttemptTwentyFour) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyFour", ActionAttemptTwentyFour: value} +} + +func NewActionAttemptFromActionAttemptTwentyFive(value *ActionAttemptTwentyFive) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyFive", ActionAttemptTwentyFive: value} +} + +func NewActionAttemptFromActionAttemptTwentySix(value *ActionAttemptTwentySix) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentySix", ActionAttemptTwentySix: value} +} + +func NewActionAttemptFromActionAttemptTwentySeven(value *ActionAttemptTwentySeven) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentySeven", ActionAttemptTwentySeven: value} +} + +func NewActionAttemptFromActionAttemptTwentyEight(value *ActionAttemptTwentyEight) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyEight", ActionAttemptTwentyEight: value} +} + +func NewActionAttemptFromActionAttemptTwentyNine(value *ActionAttemptTwentyNine) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptTwentyNine", ActionAttemptTwentyNine: value} +} + +func NewActionAttemptFromActionAttemptThirty(value *ActionAttemptThirty) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirty", ActionAttemptThirty: value} +} + +func NewActionAttemptFromActionAttemptThirtyOne(value *ActionAttemptThirtyOne) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyOne", ActionAttemptThirtyOne: value} +} + +func NewActionAttemptFromActionAttemptThirtyTwo(value *ActionAttemptThirtyTwo) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyTwo", ActionAttemptThirtyTwo: value} +} + +func NewActionAttemptFromActionAttemptThirtyThree(value *ActionAttemptThirtyThree) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyThree", ActionAttemptThirtyThree: value} +} + +func NewActionAttemptFromActionAttemptThirtyFour(value *ActionAttemptThirtyFour) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyFour", ActionAttemptThirtyFour: value} +} + +func NewActionAttemptFromActionAttemptThirtyFive(value *ActionAttemptThirtyFive) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyFive", ActionAttemptThirtyFive: value} +} + +func NewActionAttemptFromActionAttemptThirtySix(value *ActionAttemptThirtySix) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtySix", ActionAttemptThirtySix: value} +} + +func NewActionAttemptFromActionAttemptThirtySeven(value *ActionAttemptThirtySeven) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtySeven", ActionAttemptThirtySeven: value} +} + +func NewActionAttemptFromActionAttemptThirtyEight(value *ActionAttemptThirtyEight) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyEight", ActionAttemptThirtyEight: value} +} + +func NewActionAttemptFromActionAttemptThirtyNine(value *ActionAttemptThirtyNine) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptThirtyNine", ActionAttemptThirtyNine: value} +} + +func NewActionAttemptFromActionAttemptForty(value *ActionAttemptForty) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptForty", ActionAttemptForty: value} +} + +func NewActionAttemptFromActionAttemptFortyOne(value *ActionAttemptFortyOne) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFortyOne", ActionAttemptFortyOne: value} +} + +func NewActionAttemptFromActionAttemptFortyTwo(value *ActionAttemptFortyTwo) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFortyTwo", ActionAttemptFortyTwo: value} +} + +func NewActionAttemptFromActionAttemptFortyThree(value *ActionAttemptFortyThree) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptFortyThree", ActionAttemptFortyThree: value} +} + +func NewActionAttemptFromActionAttemptActionAttemptId(value *ActionAttemptActionAttemptId) *ActionAttempt { + return &ActionAttempt{typeName: "actionAttemptActionAttemptId", ActionAttemptActionAttemptId: value} +} + +func (a *ActionAttempt) UnmarshalJSON(data []byte) error { + valueActionAttemptZero := new(ActionAttemptZero) + if err := json.Unmarshal(data, &valueActionAttemptZero); err == nil { + a.typeName = "actionAttemptZero" + a.ActionAttemptZero = valueActionAttemptZero + return nil + } + valueActionAttemptOne := new(ActionAttemptOne) + if err := json.Unmarshal(data, &valueActionAttemptOne); err == nil { + a.typeName = "actionAttemptOne" + a.ActionAttemptOne = valueActionAttemptOne + return nil + } + valueActionAttemptTwo := new(ActionAttemptTwo) + if err := json.Unmarshal(data, &valueActionAttemptTwo); err == nil { + a.typeName = "actionAttemptTwo" + a.ActionAttemptTwo = valueActionAttemptTwo + return nil + } + valueActionAttemptThree := new(ActionAttemptThree) + if err := json.Unmarshal(data, &valueActionAttemptThree); err == nil { + a.typeName = "actionAttemptThree" + a.ActionAttemptThree = valueActionAttemptThree + return nil + } + valueActionAttemptFour := new(ActionAttemptFour) + if err := json.Unmarshal(data, &valueActionAttemptFour); err == nil { + a.typeName = "actionAttemptFour" + a.ActionAttemptFour = valueActionAttemptFour + return nil + } + valueActionAttemptFive := new(ActionAttemptFive) + if err := json.Unmarshal(data, &valueActionAttemptFive); err == nil { + a.typeName = "actionAttemptFive" + a.ActionAttemptFive = valueActionAttemptFive + return nil + } + valueActionAttemptSix := new(ActionAttemptSix) + if err := json.Unmarshal(data, &valueActionAttemptSix); err == nil { + a.typeName = "actionAttemptSix" + a.ActionAttemptSix = valueActionAttemptSix + return nil + } + valueActionAttemptSeven := new(ActionAttemptSeven) + if err := json.Unmarshal(data, &valueActionAttemptSeven); err == nil { + a.typeName = "actionAttemptSeven" + a.ActionAttemptSeven = valueActionAttemptSeven + return nil + } + valueActionAttemptEight := new(ActionAttemptEight) + if err := json.Unmarshal(data, &valueActionAttemptEight); err == nil { + a.typeName = "actionAttemptEight" + a.ActionAttemptEight = valueActionAttemptEight + return nil + } + valueActionAttemptNine := new(ActionAttemptNine) + if err := json.Unmarshal(data, &valueActionAttemptNine); err == nil { + a.typeName = "actionAttemptNine" + a.ActionAttemptNine = valueActionAttemptNine + return nil + } + valueActionAttemptTen := new(ActionAttemptTen) + if err := json.Unmarshal(data, &valueActionAttemptTen); err == nil { + a.typeName = "actionAttemptTen" + a.ActionAttemptTen = valueActionAttemptTen + return nil + } + valueActionAttemptEleven := new(ActionAttemptEleven) + if err := json.Unmarshal(data, &valueActionAttemptEleven); err == nil { + a.typeName = "actionAttemptEleven" + a.ActionAttemptEleven = valueActionAttemptEleven + return nil + } + valueActionAttemptTwelve := new(ActionAttemptTwelve) + if err := json.Unmarshal(data, &valueActionAttemptTwelve); err == nil { + a.typeName = "actionAttemptTwelve" + a.ActionAttemptTwelve = valueActionAttemptTwelve + return nil + } + valueActionAttemptThirteen := new(ActionAttemptThirteen) + if err := json.Unmarshal(data, &valueActionAttemptThirteen); err == nil { + a.typeName = "actionAttemptThirteen" + a.ActionAttemptThirteen = valueActionAttemptThirteen + return nil + } + valueActionAttemptFourteen := new(ActionAttemptFourteen) + if err := json.Unmarshal(data, &valueActionAttemptFourteen); err == nil { + a.typeName = "actionAttemptFourteen" + a.ActionAttemptFourteen = valueActionAttemptFourteen + return nil + } + valueActionAttemptFifteen := new(ActionAttemptFifteen) + if err := json.Unmarshal(data, &valueActionAttemptFifteen); err == nil { + a.typeName = "actionAttemptFifteen" + a.ActionAttemptFifteen = valueActionAttemptFifteen + return nil + } + valueActionAttemptSixteen := new(ActionAttemptSixteen) + if err := json.Unmarshal(data, &valueActionAttemptSixteen); err == nil { + a.typeName = "actionAttemptSixteen" + a.ActionAttemptSixteen = valueActionAttemptSixteen + return nil + } + valueActionAttemptSeventeen := new(ActionAttemptSeventeen) + if err := json.Unmarshal(data, &valueActionAttemptSeventeen); err == nil { + a.typeName = "actionAttemptSeventeen" + a.ActionAttemptSeventeen = valueActionAttemptSeventeen + return nil + } + valueActionAttemptEighteen := new(ActionAttemptEighteen) + if err := json.Unmarshal(data, &valueActionAttemptEighteen); err == nil { + a.typeName = "actionAttemptEighteen" + a.ActionAttemptEighteen = valueActionAttemptEighteen + return nil + } + valueActionAttemptNineteen := new(ActionAttemptNineteen) + if err := json.Unmarshal(data, &valueActionAttemptNineteen); err == nil { + a.typeName = "actionAttemptNineteen" + a.ActionAttemptNineteen = valueActionAttemptNineteen + return nil + } + valueActionAttemptTwenty := new(ActionAttemptTwenty) + if err := json.Unmarshal(data, &valueActionAttemptTwenty); err == nil { + a.typeName = "actionAttemptTwenty" + a.ActionAttemptTwenty = valueActionAttemptTwenty + return nil + } + valueActionAttemptTwentyOne := new(ActionAttemptTwentyOne) + if err := json.Unmarshal(data, &valueActionAttemptTwentyOne); err == nil { + a.typeName = "actionAttemptTwentyOne" + a.ActionAttemptTwentyOne = valueActionAttemptTwentyOne + return nil + } + valueActionAttemptTwentyTwo := new(ActionAttemptTwentyTwo) + if err := json.Unmarshal(data, &valueActionAttemptTwentyTwo); err == nil { + a.typeName = "actionAttemptTwentyTwo" + a.ActionAttemptTwentyTwo = valueActionAttemptTwentyTwo + return nil + } + valueActionAttemptTwentyThree := new(ActionAttemptTwentyThree) + if err := json.Unmarshal(data, &valueActionAttemptTwentyThree); err == nil { + a.typeName = "actionAttemptTwentyThree" + a.ActionAttemptTwentyThree = valueActionAttemptTwentyThree + return nil + } + valueActionAttemptTwentyFour := new(ActionAttemptTwentyFour) + if err := json.Unmarshal(data, &valueActionAttemptTwentyFour); err == nil { + a.typeName = "actionAttemptTwentyFour" + a.ActionAttemptTwentyFour = valueActionAttemptTwentyFour + return nil + } + valueActionAttemptTwentyFive := new(ActionAttemptTwentyFive) + if err := json.Unmarshal(data, &valueActionAttemptTwentyFive); err == nil { + a.typeName = "actionAttemptTwentyFive" + a.ActionAttemptTwentyFive = valueActionAttemptTwentyFive + return nil + } + valueActionAttemptTwentySix := new(ActionAttemptTwentySix) + if err := json.Unmarshal(data, &valueActionAttemptTwentySix); err == nil { + a.typeName = "actionAttemptTwentySix" + a.ActionAttemptTwentySix = valueActionAttemptTwentySix + return nil + } + valueActionAttemptTwentySeven := new(ActionAttemptTwentySeven) + if err := json.Unmarshal(data, &valueActionAttemptTwentySeven); err == nil { + a.typeName = "actionAttemptTwentySeven" + a.ActionAttemptTwentySeven = valueActionAttemptTwentySeven + return nil + } + valueActionAttemptTwentyEight := new(ActionAttemptTwentyEight) + if err := json.Unmarshal(data, &valueActionAttemptTwentyEight); err == nil { + a.typeName = "actionAttemptTwentyEight" + a.ActionAttemptTwentyEight = valueActionAttemptTwentyEight + return nil + } + valueActionAttemptTwentyNine := new(ActionAttemptTwentyNine) + if err := json.Unmarshal(data, &valueActionAttemptTwentyNine); err == nil { + a.typeName = "actionAttemptTwentyNine" + a.ActionAttemptTwentyNine = valueActionAttemptTwentyNine + return nil + } + valueActionAttemptThirty := new(ActionAttemptThirty) + if err := json.Unmarshal(data, &valueActionAttemptThirty); err == nil { + a.typeName = "actionAttemptThirty" + a.ActionAttemptThirty = valueActionAttemptThirty + return nil + } + valueActionAttemptThirtyOne := new(ActionAttemptThirtyOne) + if err := json.Unmarshal(data, &valueActionAttemptThirtyOne); err == nil { + a.typeName = "actionAttemptThirtyOne" + a.ActionAttemptThirtyOne = valueActionAttemptThirtyOne + return nil + } + valueActionAttemptThirtyTwo := new(ActionAttemptThirtyTwo) + if err := json.Unmarshal(data, &valueActionAttemptThirtyTwo); err == nil { + a.typeName = "actionAttemptThirtyTwo" + a.ActionAttemptThirtyTwo = valueActionAttemptThirtyTwo + return nil + } + valueActionAttemptThirtyThree := new(ActionAttemptThirtyThree) + if err := json.Unmarshal(data, &valueActionAttemptThirtyThree); err == nil { + a.typeName = "actionAttemptThirtyThree" + a.ActionAttemptThirtyThree = valueActionAttemptThirtyThree + return nil + } + valueActionAttemptThirtyFour := new(ActionAttemptThirtyFour) + if err := json.Unmarshal(data, &valueActionAttemptThirtyFour); err == nil { + a.typeName = "actionAttemptThirtyFour" + a.ActionAttemptThirtyFour = valueActionAttemptThirtyFour + return nil + } + valueActionAttemptThirtyFive := new(ActionAttemptThirtyFive) + if err := json.Unmarshal(data, &valueActionAttemptThirtyFive); err == nil { + a.typeName = "actionAttemptThirtyFive" + a.ActionAttemptThirtyFive = valueActionAttemptThirtyFive + return nil + } + valueActionAttemptThirtySix := new(ActionAttemptThirtySix) + if err := json.Unmarshal(data, &valueActionAttemptThirtySix); err == nil { + a.typeName = "actionAttemptThirtySix" + a.ActionAttemptThirtySix = valueActionAttemptThirtySix + return nil + } + valueActionAttemptThirtySeven := new(ActionAttemptThirtySeven) + if err := json.Unmarshal(data, &valueActionAttemptThirtySeven); err == nil { + a.typeName = "actionAttemptThirtySeven" + a.ActionAttemptThirtySeven = valueActionAttemptThirtySeven + return nil + } + valueActionAttemptThirtyEight := new(ActionAttemptThirtyEight) + if err := json.Unmarshal(data, &valueActionAttemptThirtyEight); err == nil { + a.typeName = "actionAttemptThirtyEight" + a.ActionAttemptThirtyEight = valueActionAttemptThirtyEight + return nil + } + valueActionAttemptThirtyNine := new(ActionAttemptThirtyNine) + if err := json.Unmarshal(data, &valueActionAttemptThirtyNine); err == nil { + a.typeName = "actionAttemptThirtyNine" + a.ActionAttemptThirtyNine = valueActionAttemptThirtyNine + return nil + } + valueActionAttemptForty := new(ActionAttemptForty) + if err := json.Unmarshal(data, &valueActionAttemptForty); err == nil { + a.typeName = "actionAttemptForty" + a.ActionAttemptForty = valueActionAttemptForty + return nil + } + valueActionAttemptFortyOne := new(ActionAttemptFortyOne) + if err := json.Unmarshal(data, &valueActionAttemptFortyOne); err == nil { + a.typeName = "actionAttemptFortyOne" + a.ActionAttemptFortyOne = valueActionAttemptFortyOne + return nil + } + valueActionAttemptFortyTwo := new(ActionAttemptFortyTwo) + if err := json.Unmarshal(data, &valueActionAttemptFortyTwo); err == nil { + a.typeName = "actionAttemptFortyTwo" + a.ActionAttemptFortyTwo = valueActionAttemptFortyTwo + return nil + } + valueActionAttemptFortyThree := new(ActionAttemptFortyThree) + if err := json.Unmarshal(data, &valueActionAttemptFortyThree); err == nil { + a.typeName = "actionAttemptFortyThree" + a.ActionAttemptFortyThree = valueActionAttemptFortyThree + return nil + } + valueActionAttemptActionAttemptId := new(ActionAttemptActionAttemptId) + if err := json.Unmarshal(data, &valueActionAttemptActionAttemptId); err == nil { + a.typeName = "actionAttemptActionAttemptId" + a.ActionAttemptActionAttemptId = valueActionAttemptActionAttemptId + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, a) +} + +func (a ActionAttempt) MarshalJSON() ([]byte, error) { + switch a.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", a.typeName, a) + case "actionAttemptZero": + return json.Marshal(a.ActionAttemptZero) + case "actionAttemptOne": + return json.Marshal(a.ActionAttemptOne) + case "actionAttemptTwo": + return json.Marshal(a.ActionAttemptTwo) + case "actionAttemptThree": + return json.Marshal(a.ActionAttemptThree) + case "actionAttemptFour": + return json.Marshal(a.ActionAttemptFour) + case "actionAttemptFive": + return json.Marshal(a.ActionAttemptFive) + case "actionAttemptSix": + return json.Marshal(a.ActionAttemptSix) + case "actionAttemptSeven": + return json.Marshal(a.ActionAttemptSeven) + case "actionAttemptEight": + return json.Marshal(a.ActionAttemptEight) + case "actionAttemptNine": + return json.Marshal(a.ActionAttemptNine) + case "actionAttemptTen": + return json.Marshal(a.ActionAttemptTen) + case "actionAttemptEleven": + return json.Marshal(a.ActionAttemptEleven) + case "actionAttemptTwelve": + return json.Marshal(a.ActionAttemptTwelve) + case "actionAttemptThirteen": + return json.Marshal(a.ActionAttemptThirteen) + case "actionAttemptFourteen": + return json.Marshal(a.ActionAttemptFourteen) + case "actionAttemptFifteen": + return json.Marshal(a.ActionAttemptFifteen) + case "actionAttemptSixteen": + return json.Marshal(a.ActionAttemptSixteen) + case "actionAttemptSeventeen": + return json.Marshal(a.ActionAttemptSeventeen) + case "actionAttemptEighteen": + return json.Marshal(a.ActionAttemptEighteen) + case "actionAttemptNineteen": + return json.Marshal(a.ActionAttemptNineteen) + case "actionAttemptTwenty": + return json.Marshal(a.ActionAttemptTwenty) + case "actionAttemptTwentyOne": + return json.Marshal(a.ActionAttemptTwentyOne) + case "actionAttemptTwentyTwo": + return json.Marshal(a.ActionAttemptTwentyTwo) + case "actionAttemptTwentyThree": + return json.Marshal(a.ActionAttemptTwentyThree) + case "actionAttemptTwentyFour": + return json.Marshal(a.ActionAttemptTwentyFour) + case "actionAttemptTwentyFive": + return json.Marshal(a.ActionAttemptTwentyFive) + case "actionAttemptTwentySix": + return json.Marshal(a.ActionAttemptTwentySix) + case "actionAttemptTwentySeven": + return json.Marshal(a.ActionAttemptTwentySeven) + case "actionAttemptTwentyEight": + return json.Marshal(a.ActionAttemptTwentyEight) + case "actionAttemptTwentyNine": + return json.Marshal(a.ActionAttemptTwentyNine) + case "actionAttemptThirty": + return json.Marshal(a.ActionAttemptThirty) + case "actionAttemptThirtyOne": + return json.Marshal(a.ActionAttemptThirtyOne) + case "actionAttemptThirtyTwo": + return json.Marshal(a.ActionAttemptThirtyTwo) + case "actionAttemptThirtyThree": + return json.Marshal(a.ActionAttemptThirtyThree) + case "actionAttemptThirtyFour": + return json.Marshal(a.ActionAttemptThirtyFour) + case "actionAttemptThirtyFive": + return json.Marshal(a.ActionAttemptThirtyFive) + case "actionAttemptThirtySix": + return json.Marshal(a.ActionAttemptThirtySix) + case "actionAttemptThirtySeven": + return json.Marshal(a.ActionAttemptThirtySeven) + case "actionAttemptThirtyEight": + return json.Marshal(a.ActionAttemptThirtyEight) + case "actionAttemptThirtyNine": + return json.Marshal(a.ActionAttemptThirtyNine) + case "actionAttemptForty": + return json.Marshal(a.ActionAttemptForty) + case "actionAttemptFortyOne": + return json.Marshal(a.ActionAttemptFortyOne) + case "actionAttemptFortyTwo": + return json.Marshal(a.ActionAttemptFortyTwo) + case "actionAttemptFortyThree": + return json.Marshal(a.ActionAttemptFortyThree) + case "actionAttemptActionAttemptId": + return json.Marshal(a.ActionAttemptActionAttemptId) + } +} + +type ActionAttemptVisitor interface { + VisitActionAttemptZero(*ActionAttemptZero) error + VisitActionAttemptOne(*ActionAttemptOne) error + VisitActionAttemptTwo(*ActionAttemptTwo) error + VisitActionAttemptThree(*ActionAttemptThree) error + VisitActionAttemptFour(*ActionAttemptFour) error + VisitActionAttemptFive(*ActionAttemptFive) error + VisitActionAttemptSix(*ActionAttemptSix) error + VisitActionAttemptSeven(*ActionAttemptSeven) error + VisitActionAttemptEight(*ActionAttemptEight) error + VisitActionAttemptNine(*ActionAttemptNine) error + VisitActionAttemptTen(*ActionAttemptTen) error + VisitActionAttemptEleven(*ActionAttemptEleven) error + VisitActionAttemptTwelve(*ActionAttemptTwelve) error + VisitActionAttemptThirteen(*ActionAttemptThirteen) error + VisitActionAttemptFourteen(*ActionAttemptFourteen) error + VisitActionAttemptFifteen(*ActionAttemptFifteen) error + VisitActionAttemptSixteen(*ActionAttemptSixteen) error + VisitActionAttemptSeventeen(*ActionAttemptSeventeen) error + VisitActionAttemptEighteen(*ActionAttemptEighteen) error + VisitActionAttemptNineteen(*ActionAttemptNineteen) error + VisitActionAttemptTwenty(*ActionAttemptTwenty) error + VisitActionAttemptTwentyOne(*ActionAttemptTwentyOne) error + VisitActionAttemptTwentyTwo(*ActionAttemptTwentyTwo) error + VisitActionAttemptTwentyThree(*ActionAttemptTwentyThree) error + VisitActionAttemptTwentyFour(*ActionAttemptTwentyFour) error + VisitActionAttemptTwentyFive(*ActionAttemptTwentyFive) error + VisitActionAttemptTwentySix(*ActionAttemptTwentySix) error + VisitActionAttemptTwentySeven(*ActionAttemptTwentySeven) error + VisitActionAttemptTwentyEight(*ActionAttemptTwentyEight) error + VisitActionAttemptTwentyNine(*ActionAttemptTwentyNine) error + VisitActionAttemptThirty(*ActionAttemptThirty) error + VisitActionAttemptThirtyOne(*ActionAttemptThirtyOne) error + VisitActionAttemptThirtyTwo(*ActionAttemptThirtyTwo) error + VisitActionAttemptThirtyThree(*ActionAttemptThirtyThree) error + VisitActionAttemptThirtyFour(*ActionAttemptThirtyFour) error + VisitActionAttemptThirtyFive(*ActionAttemptThirtyFive) error + VisitActionAttemptThirtySix(*ActionAttemptThirtySix) error + VisitActionAttemptThirtySeven(*ActionAttemptThirtySeven) error + VisitActionAttemptThirtyEight(*ActionAttemptThirtyEight) error + VisitActionAttemptThirtyNine(*ActionAttemptThirtyNine) error + VisitActionAttemptForty(*ActionAttemptForty) error + VisitActionAttemptFortyOne(*ActionAttemptFortyOne) error + VisitActionAttemptFortyTwo(*ActionAttemptFortyTwo) error + VisitActionAttemptFortyThree(*ActionAttemptFortyThree) error + VisitActionAttemptActionAttemptId(*ActionAttemptActionAttemptId) error +} + +func (a *ActionAttempt) Accept(visitor ActionAttemptVisitor) error { + switch a.typeName { + default: + return fmt.Errorf("invalid type %s in %T", a.typeName, a) + case "actionAttemptZero": + return visitor.VisitActionAttemptZero(a.ActionAttemptZero) + case "actionAttemptOne": + return visitor.VisitActionAttemptOne(a.ActionAttemptOne) + case "actionAttemptTwo": + return visitor.VisitActionAttemptTwo(a.ActionAttemptTwo) + case "actionAttemptThree": + return visitor.VisitActionAttemptThree(a.ActionAttemptThree) + case "actionAttemptFour": + return visitor.VisitActionAttemptFour(a.ActionAttemptFour) + case "actionAttemptFive": + return visitor.VisitActionAttemptFive(a.ActionAttemptFive) + case "actionAttemptSix": + return visitor.VisitActionAttemptSix(a.ActionAttemptSix) + case "actionAttemptSeven": + return visitor.VisitActionAttemptSeven(a.ActionAttemptSeven) + case "actionAttemptEight": + return visitor.VisitActionAttemptEight(a.ActionAttemptEight) + case "actionAttemptNine": + return visitor.VisitActionAttemptNine(a.ActionAttemptNine) + case "actionAttemptTen": + return visitor.VisitActionAttemptTen(a.ActionAttemptTen) + case "actionAttemptEleven": + return visitor.VisitActionAttemptEleven(a.ActionAttemptEleven) + case "actionAttemptTwelve": + return visitor.VisitActionAttemptTwelve(a.ActionAttemptTwelve) + case "actionAttemptThirteen": + return visitor.VisitActionAttemptThirteen(a.ActionAttemptThirteen) + case "actionAttemptFourteen": + return visitor.VisitActionAttemptFourteen(a.ActionAttemptFourteen) + case "actionAttemptFifteen": + return visitor.VisitActionAttemptFifteen(a.ActionAttemptFifteen) + case "actionAttemptSixteen": + return visitor.VisitActionAttemptSixteen(a.ActionAttemptSixteen) + case "actionAttemptSeventeen": + return visitor.VisitActionAttemptSeventeen(a.ActionAttemptSeventeen) + case "actionAttemptEighteen": + return visitor.VisitActionAttemptEighteen(a.ActionAttemptEighteen) + case "actionAttemptNineteen": + return visitor.VisitActionAttemptNineteen(a.ActionAttemptNineteen) + case "actionAttemptTwenty": + return visitor.VisitActionAttemptTwenty(a.ActionAttemptTwenty) + case "actionAttemptTwentyOne": + return visitor.VisitActionAttemptTwentyOne(a.ActionAttemptTwentyOne) + case "actionAttemptTwentyTwo": + return visitor.VisitActionAttemptTwentyTwo(a.ActionAttemptTwentyTwo) + case "actionAttemptTwentyThree": + return visitor.VisitActionAttemptTwentyThree(a.ActionAttemptTwentyThree) + case "actionAttemptTwentyFour": + return visitor.VisitActionAttemptTwentyFour(a.ActionAttemptTwentyFour) + case "actionAttemptTwentyFive": + return visitor.VisitActionAttemptTwentyFive(a.ActionAttemptTwentyFive) + case "actionAttemptTwentySix": + return visitor.VisitActionAttemptTwentySix(a.ActionAttemptTwentySix) + case "actionAttemptTwentySeven": + return visitor.VisitActionAttemptTwentySeven(a.ActionAttemptTwentySeven) + case "actionAttemptTwentyEight": + return visitor.VisitActionAttemptTwentyEight(a.ActionAttemptTwentyEight) + case "actionAttemptTwentyNine": + return visitor.VisitActionAttemptTwentyNine(a.ActionAttemptTwentyNine) + case "actionAttemptThirty": + return visitor.VisitActionAttemptThirty(a.ActionAttemptThirty) + case "actionAttemptThirtyOne": + return visitor.VisitActionAttemptThirtyOne(a.ActionAttemptThirtyOne) + case "actionAttemptThirtyTwo": + return visitor.VisitActionAttemptThirtyTwo(a.ActionAttemptThirtyTwo) + case "actionAttemptThirtyThree": + return visitor.VisitActionAttemptThirtyThree(a.ActionAttemptThirtyThree) + case "actionAttemptThirtyFour": + return visitor.VisitActionAttemptThirtyFour(a.ActionAttemptThirtyFour) + case "actionAttemptThirtyFive": + return visitor.VisitActionAttemptThirtyFive(a.ActionAttemptThirtyFive) + case "actionAttemptThirtySix": + return visitor.VisitActionAttemptThirtySix(a.ActionAttemptThirtySix) + case "actionAttemptThirtySeven": + return visitor.VisitActionAttemptThirtySeven(a.ActionAttemptThirtySeven) + case "actionAttemptThirtyEight": + return visitor.VisitActionAttemptThirtyEight(a.ActionAttemptThirtyEight) + case "actionAttemptThirtyNine": + return visitor.VisitActionAttemptThirtyNine(a.ActionAttemptThirtyNine) + case "actionAttemptForty": + return visitor.VisitActionAttemptForty(a.ActionAttemptForty) + case "actionAttemptFortyOne": + return visitor.VisitActionAttemptFortyOne(a.ActionAttemptFortyOne) + case "actionAttemptFortyTwo": + return visitor.VisitActionAttemptFortyTwo(a.ActionAttemptFortyTwo) + case "actionAttemptFortyThree": + return visitor.VisitActionAttemptFortyThree(a.ActionAttemptFortyThree) + case "actionAttemptActionAttemptId": + return visitor.VisitActionAttemptActionAttemptId(a.ActionAttemptActionAttemptId) + } +} + +type ActionAttemptActionAttemptId struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptActionAttemptIdError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptActionAttemptId) Status() string { + return a.status +} + +func (a *ActionAttemptActionAttemptId) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptActionAttemptId) UnmarshalJSON(data []byte) error { + type embed ActionAttemptActionAttemptId + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptActionAttemptId(unmarshaler.embed) + a.status = "error" + a.actionType = "UPDATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptActionAttemptId) MarshalJSON() ([]byte, error) { + type embed ActionAttemptActionAttemptId + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "UPDATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptActionAttemptId) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptActionAttemptIdError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptActionAttemptIdError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptActionAttemptIdError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptActionAttemptIdError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptActionAttemptIdError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Resetting sandbox workspace failed. +type ActionAttemptEight struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptEightError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptEight) Status() string { + return a.status +} + +func (a *ActionAttemptEight) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptEight) UnmarshalJSON(data []byte) error { + type embed ActionAttemptEight + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptEight(unmarshaler.embed) + a.status = "error" + a.actionType = "RESET_SANDBOX_WORKSPACE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptEight) MarshalJSON() ([]byte, error) { + type embed ActionAttemptEight + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "RESET_SANDBOX_WORKSPACE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptEight) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptEightError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptEightError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptEightError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptEightError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptEightError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting fan mode. +type ActionAttemptEighteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptEighteen) Status() string { + return a.status +} + +func (a *ActionAttemptEighteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptEighteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptEighteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptEighteen(unmarshaler.embed) + a.status = "pending" + a.actionType = "SET_FAN_MODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptEighteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptEighteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SET_FAN_MODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptEighteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to cool failed. +type ActionAttemptEleven struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptElevenError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptEleven) Status() string { + return a.status +} + +func (a *ActionAttemptEleven) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptEleven) UnmarshalJSON(data []byte) error { + type embed ActionAttemptEleven + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptEleven(unmarshaler.embed) + a.status = "error" + a.actionType = "SET_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptEleven) MarshalJSON() ([]byte, error) { + type embed ActionAttemptEleven + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SET_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptEleven) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptElevenError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptElevenError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptElevenError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptElevenError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptElevenError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to heat-cool mode. +type ActionAttemptFifteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFifteen) Status() string { + return a.status +} + +func (a *ActionAttemptFifteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFifteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFifteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFifteen(unmarshaler.embed) + a.status = "pending" + a.actionType = "SET_HEAT_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFifteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFifteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SET_HEAT_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFifteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Unlocking door failed. +type ActionAttemptFive struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptFiveError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFive) Status() string { + return a.status +} + +func (a *ActionAttemptFive) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFive) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFive + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFive(unmarshaler.embed) + a.status = "error" + a.actionType = "UNLOCK_DOOR" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFive) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFive + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "UNLOCK_DOOR", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFive) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFiveError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFiveError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptFiveError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptFiveError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFiveError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptForty struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptForty) Status() string { + return a.status +} + +func (a *ActionAttemptForty) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptForty) UnmarshalJSON(data []byte) error { + type embed ActionAttemptForty + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptForty(unmarshaler.embed) + a.status = "success" + a.actionType = "DELETE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptForty) MarshalJSON() ([]byte, error) { + type embed ActionAttemptForty + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "DELETE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptForty) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFortyOne struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptFortyOneError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFortyOne) Status() string { + return a.status +} + +func (a *ActionAttemptFortyOne) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFortyOne) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFortyOne + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFortyOne(unmarshaler.embed) + a.status = "error" + a.actionType = "DELETE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFortyOne) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFortyOne + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "DELETE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFortyOne) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFortyOneError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFortyOneError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptFortyOneError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptFortyOneError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFortyOneError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFortyThree struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFortyThree) Status() string { + return a.status +} + +func (a *ActionAttemptFortyThree) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFortyThree) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFortyThree + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFortyThree(unmarshaler.embed) + a.status = "success" + a.actionType = "UPDATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFortyThree) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFortyThree + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "UPDATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFortyThree) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFortyTwo struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFortyTwo) Status() string { + return a.status +} + +func (a *ActionAttemptFortyTwo) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFortyTwo) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFortyTwo + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFortyTwo(unmarshaler.embed) + a.status = "pending" + a.actionType = "UPDATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFortyTwo) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFortyTwo + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "UPDATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFortyTwo) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Unlocking door succeeded. +type ActionAttemptFour struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptFourResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFour) Status() string { + return a.status +} + +func (a *ActionAttemptFour) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFour) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFour + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFour(unmarshaler.embed) + a.status = "success" + a.actionType = "UNLOCK_DOOR" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFour) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFour + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "UNLOCK_DOOR", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFour) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFourResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFourResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptFourResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptFourResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFourResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to heat mode failed. +type ActionAttemptFourteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptFourteenError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFourteen) Status() string { + return a.status +} + +func (a *ActionAttemptFourteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptFourteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptFourteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptFourteen(unmarshaler.embed) + a.status = "error" + a.actionType = "SET_HEAT" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFourteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptFourteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SET_HEAT", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptFourteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptFourteenError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptFourteenError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptFourteenError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptFourteenError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptFourteenError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to cool. +type ActionAttemptNine struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptNine) Status() string { + return a.status +} + +func (a *ActionAttemptNine) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptNine) UnmarshalJSON(data []byte) error { + type embed ActionAttemptNine + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptNine(unmarshaler.embed) + a.status = "pending" + a.actionType = "SET_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptNine) MarshalJSON() ([]byte, error) { + type embed ActionAttemptNine + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SET_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptNine) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting fan mode succeeded. +type ActionAttemptNineteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptNineteenResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptNineteen) Status() string { + return a.status +} + +func (a *ActionAttemptNineteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptNineteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptNineteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptNineteen(unmarshaler.embed) + a.status = "success" + a.actionType = "SET_FAN_MODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptNineteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptNineteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "SET_FAN_MODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptNineteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptNineteenResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptNineteenResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptNineteenResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptNineteenResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptNineteenResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Locking door succeeded. +type ActionAttemptOne struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptOneResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptOne) Status() string { + return a.status +} + +func (a *ActionAttemptOne) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptOne) UnmarshalJSON(data []byte) error { + type embed ActionAttemptOne + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptOne(unmarshaler.embed) + a.status = "success" + a.actionType = "LOCK_DOOR" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptOne) MarshalJSON() ([]byte, error) { + type embed ActionAttemptOne + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "LOCK_DOOR", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptOne) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptOneResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptOneResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptOneResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptOneResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptOneResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Resetting sandbox workspace succeeded. +type ActionAttemptSeven struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptSevenResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSeven) Status() string { + return a.status +} + +func (a *ActionAttemptSeven) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptSeven) UnmarshalJSON(data []byte) error { + type embed ActionAttemptSeven + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptSeven(unmarshaler.embed) + a.status = "success" + a.actionType = "RESET_SANDBOX_WORKSPACE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSeven) MarshalJSON() ([]byte, error) { + type embed ActionAttemptSeven + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "RESET_SANDBOX_WORKSPACE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptSeven) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptSevenResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSevenResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptSevenResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptSevenResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSevenResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting heat-cool mode failed. +type ActionAttemptSeventeen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptSeventeenError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSeventeen) Status() string { + return a.status +} + +func (a *ActionAttemptSeventeen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptSeventeen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptSeventeen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptSeventeen(unmarshaler.embed) + a.status = "error" + a.actionType = "SET_HEAT_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSeventeen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptSeventeen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SET_HEAT_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptSeventeen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptSeventeenError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSeventeenError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptSeventeenError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptSeventeenError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSeventeenError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Resetting sandbox workspace. +type ActionAttemptSix struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSix) Status() string { + return a.status +} + +func (a *ActionAttemptSix) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptSix) UnmarshalJSON(data []byte) error { + type embed ActionAttemptSix + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptSix(unmarshaler.embed) + a.status = "pending" + a.actionType = "RESET_SANDBOX_WORKSPACE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSix) MarshalJSON() ([]byte, error) { + type embed ActionAttemptSix + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "RESET_SANDBOX_WORKSPACE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptSix) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to heat-cool mode succeeded. +type ActionAttemptSixteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptSixteenResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSixteen) Status() string { + return a.status +} + +func (a *ActionAttemptSixteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptSixteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptSixteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptSixteen(unmarshaler.embed) + a.status = "success" + a.actionType = "SET_HEAT_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSixteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptSixteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "SET_HEAT_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptSixteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptSixteenResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptSixteenResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptSixteenResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptSixteenResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptSixteenResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to cool succeeded. +type ActionAttemptTen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptTenResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTen) Status() string { + return a.status +} + +func (a *ActionAttemptTen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTen(unmarshaler.embed) + a.status = "success" + a.actionType = "SET_COOL" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "SET_COOL", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTenResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTenResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTenResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptTenResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTenResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to heat mode succeeded. +type ActionAttemptThirteen struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptThirteenResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirteen) Status() string { + return a.status +} + +func (a *ActionAttemptThirteen) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirteen) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirteen + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirteen(unmarshaler.embed) + a.status = "success" + a.actionType = "SET_HEAT" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirteen) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirteen + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "SET_HEAT", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirteen) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirteenResult struct { + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirteenResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptThirteenResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptThirteenResult(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirteenResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirty struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirty) Status() string { + return a.status +} + +func (a *ActionAttemptThirty) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirty) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirty + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirty(unmarshaler.embed) + a.status = "pending" + a.actionType = "DELETE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirty) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirty + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "DELETE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirty) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyEight struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptThirtyEightError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyEight) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyEight) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyEight) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyEight + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyEight(unmarshaler.embed) + a.status = "error" + a.actionType = "CREATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyEight) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyEight + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "CREATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyEight) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyEightError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyEightError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptThirtyEightError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptThirtyEightError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyEightError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyFive struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptThirtyFiveError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyFive) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyFive) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyFive) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyFive + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyFive(unmarshaler.embed) + a.status = "error" + a.actionType = "UPDATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyFive) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyFive + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "UPDATE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyFive) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyFiveError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyFiveError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptThirtyFiveError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptThirtyFiveError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyFiveError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyFour struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyFour) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyFour) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyFour) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyFour + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyFour(unmarshaler.embed) + a.status = "success" + a.actionType = "UPDATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyFour) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyFour + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "UPDATE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyFour) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyNine struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyNine) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyNine) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyNine) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyNine + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyNine(unmarshaler.embed) + a.status = "pending" + a.actionType = "DELETE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyNine) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyNine + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "DELETE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyNine) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyOne struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyOne) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyOne) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyOne) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyOne + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyOne(unmarshaler.embed) + a.status = "success" + a.actionType = "DELETE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyOne) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyOne + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "DELETE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyOne) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtySeven struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtySeven) Status() string { + return a.status +} + +func (a *ActionAttemptThirtySeven) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtySeven) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtySeven + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtySeven(unmarshaler.embed) + a.status = "success" + a.actionType = "CREATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtySeven) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtySeven + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "CREATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtySeven) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtySix struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtySix) Status() string { + return a.status +} + +func (a *ActionAttemptThirtySix) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtySix) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtySix + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtySix(unmarshaler.embed) + a.status = "pending" + a.actionType = "CREATE_NOISE_THRESHOLD" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtySix) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtySix + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "CREATE_NOISE_THRESHOLD", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtySix) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyThree struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyThree) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyThree) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyThree) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyThree + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyThree(unmarshaler.embed) + a.status = "pending" + a.actionType = "UPDATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyThree) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyThree + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "UPDATE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyThree) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyTwo struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptThirtyTwoError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyTwo) Status() string { + return a.status +} + +func (a *ActionAttemptThirtyTwo) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThirtyTwo) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThirtyTwo + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThirtyTwo(unmarshaler.embed) + a.status = "error" + a.actionType = "DELETE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyTwo) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThirtyTwo + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "DELETE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThirtyTwo) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptThirtyTwoError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThirtyTwoError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptThirtyTwoError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptThirtyTwoError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThirtyTwoError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Unlocking door. +type ActionAttemptThree struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptThree) Status() string { + return a.status +} + +func (a *ActionAttemptThree) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptThree) UnmarshalJSON(data []byte) error { + type embed ActionAttemptThree + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptThree(unmarshaler.embed) + a.status = "pending" + a.actionType = "UNLOCK_DOOR" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptThree) MarshalJSON() ([]byte, error) { + type embed ActionAttemptThree + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "UNLOCK_DOOR", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptThree) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting HVAC to heat mode. +type ActionAttemptTwelve struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwelve) Status() string { + return a.status +} + +func (a *ActionAttemptTwelve) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwelve) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwelve + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwelve(unmarshaler.embed) + a.status = "pending" + a.actionType = "SET_HEAT" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwelve) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwelve + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SET_HEAT", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwelve) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Setting fan mode failed. +type ActionAttemptTwenty struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptTwentyError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwenty) Status() string { + return a.status +} + +func (a *ActionAttemptTwenty) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwenty) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwenty + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwenty(unmarshaler.embed) + a.status = "error" + a.actionType = "SET_FAN_MODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwenty) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwenty + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SET_FAN_MODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwenty) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyEight struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyEight) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyEight) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyEight) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyEight + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentyEight(unmarshaler.embed) + a.status = "success" + a.actionType = "CREATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyEight) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyEight + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "CREATE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyEight) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value } - return json.Marshal(marshaler) - case "pending": - var marshaler = struct { - Status string `json:"status"` - *ActionAttemptPending - }{ - Status: a.Status, - ActionAttemptPending: a.Pending, + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwentyError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptTwentyError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value } - return json.Marshal(marshaler) - case "error": - var marshaler = struct { - Status string `json:"status"` - *ActionAttemptError - }{ - Status: a.Status, - ActionAttemptError: a.Error, + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyFive struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyFive) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyFive) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyFive) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyFive + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentyFive(unmarshaler.embed) + a.status = "success" + a.actionType = "SYNC_ACCESS_CODES" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyFive) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyFive + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "success", + ActionType: "SYNC_ACCESS_CODES", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyFive) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value } - return json.Marshal(marshaler) } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyFour struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyFour) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyFour) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyFour) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyFour + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentyFour(unmarshaler.embed) + a.status = "pending" + a.actionType = "SYNC_ACCESS_CODES" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyFour) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyFour + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SYNC_ACCESS_CODES", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyFour) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyNine struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptTwentyNineError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyNine) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyNine) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyNine) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyNine + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentyNine(unmarshaler.embed) + a.status = "error" + a.actionType = "CREATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyNine) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyNine + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "CREATE_ACCESS_CODE", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyNine) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentyNineError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyNineError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwentyNineError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptTwentyNineError(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyNineError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// Turning HVAC off. +type ActionAttemptTwentyOne struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentyOne) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyOne) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyOne) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyOne + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentyOne(unmarshaler.embed) + a.status = "pending" + a.actionType = "SET_THERMOSTAT_OFF" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *ActionAttemptTwentyOne) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyOne + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "SET_THERMOSTAT_OFF", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyOne) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +type ActionAttemptTwentySeven struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string + + _rawJSON json.RawMessage +} + +func (a *ActionAttemptTwentySeven) Status() string { + return a.status +} + +func (a *ActionAttemptTwentySeven) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentySeven) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentySeven + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptTwentySeven(unmarshaler.embed) + a.status = "pending" + a.actionType = "CREATE_ACCESS_CODE" + a._rawJSON = json.RawMessage(data) + return nil } -type ActionAttemptVisitor interface { - VisitSuccess(*ActionAttemptSuccess) error - VisitPending(*ActionAttemptPending) error - VisitError(*ActionAttemptError) error +func (a *ActionAttemptTwentySeven) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentySeven + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "CREATE_ACCESS_CODE", + } + return json.Marshal(marshaler) } -func (a *ActionAttempt) Accept(visitor ActionAttemptVisitor) error { - switch a.Status { - default: - return fmt.Errorf("invalid type %s in %T", a.Status, a) - case "success": - return visitor.VisitSuccess(a.Success) - case "pending": - return visitor.VisitPending(a.Pending) - case "error": - return visitor.VisitError(a.Error) +func (a *ActionAttemptTwentySeven) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value } + return fmt.Sprintf("%#v", a) } -type ActionAttemptError struct { - ActionType string `json:"action_type" url:"action_type"` - ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` - Result *string `json:"result,omitempty" url:"result,omitempty"` - Error *ActionAttemptErrorError `json:"error,omitempty" url:"error,omitempty"` +type ActionAttemptTwentySix struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptTwentySixError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string _rawJSON json.RawMessage } -func (a *ActionAttemptError) UnmarshalJSON(data []byte) error { - type unmarshaler ActionAttemptError - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (a *ActionAttemptTwentySix) Status() string { + return a.status +} + +func (a *ActionAttemptTwentySix) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentySix) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentySix + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *a = ActionAttemptError(value) + *a = ActionAttemptTwentySix(unmarshaler.embed) + a.status = "error" + a.actionType = "SYNC_ACCESS_CODES" a._rawJSON = json.RawMessage(data) return nil } -func (a *ActionAttemptError) String() string { +func (a *ActionAttemptTwentySix) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentySix + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SYNC_ACCESS_CODES", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentySix) String() string { if len(a._rawJSON) > 0 { if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value @@ -1287,25 +5074,25 @@ func (a *ActionAttemptError) String() string { return fmt.Sprintf("%#v", a) } -type ActionAttemptErrorError struct { +type ActionAttemptTwentySixError struct { Type string `json:"type" url:"type"` Message string `json:"message" url:"message"` _rawJSON json.RawMessage } -func (a *ActionAttemptErrorError) UnmarshalJSON(data []byte) error { - type unmarshaler ActionAttemptErrorError +func (a *ActionAttemptTwentySixError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwentySixError var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *a = ActionAttemptErrorError(value) + *a = ActionAttemptTwentySixError(value) a._rawJSON = json.RawMessage(data) return nil } -func (a *ActionAttemptErrorError) String() string { +func (a *ActionAttemptTwentySixError) String() string { if len(a._rawJSON) > 0 { if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value @@ -1317,27 +5104,58 @@ func (a *ActionAttemptErrorError) String() string { return fmt.Sprintf("%#v", a) } -type ActionAttemptPending struct { - ActionType string `json:"action_type" url:"action_type"` - ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` - Result *string `json:"result,omitempty" url:"result,omitempty"` - Error *string `json:"error,omitempty" url:"error,omitempty"` +// Turning HVAC off failed. +type ActionAttemptTwentyThree struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptTwentyThreeError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string _rawJSON json.RawMessage } -func (a *ActionAttemptPending) UnmarshalJSON(data []byte) error { - type unmarshaler ActionAttemptPending - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (a *ActionAttemptTwentyThree) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyThree) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyThree) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyThree + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *a = ActionAttemptPending(value) + *a = ActionAttemptTwentyThree(unmarshaler.embed) + a.status = "error" + a.actionType = "SET_THERMOSTAT_OFF" a._rawJSON = json.RawMessage(data) return nil } -func (a *ActionAttemptPending) String() string { +func (a *ActionAttemptTwentyThree) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyThree + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "error", + ActionType: "SET_THERMOSTAT_OFF", + } + return json.Marshal(marshaler) +} + +func (a *ActionAttemptTwentyThree) String() string { if len(a._rawJSON) > 0 { if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value @@ -1349,27 +5167,25 @@ func (a *ActionAttemptPending) String() string { return fmt.Sprintf("%#v", a) } -type ActionAttemptSuccess struct { - ActionType string `json:"action_type" url:"action_type"` - ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` - Result interface{} `json:"result,omitempty" url:"result,omitempty"` - Error *string `json:"error,omitempty" url:"error,omitempty"` +type ActionAttemptTwentyThreeError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` _rawJSON json.RawMessage } -func (a *ActionAttemptSuccess) UnmarshalJSON(data []byte) error { - type unmarshaler ActionAttemptSuccess +func (a *ActionAttemptTwentyThreeError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwentyThreeError var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *a = ActionAttemptSuccess(value) + *a = ActionAttemptTwentyThreeError(value) a._rawJSON = json.RawMessage(data) return nil } -func (a *ActionAttemptSuccess) String() string { +func (a *ActionAttemptTwentyThreeError) String() string { if len(a._rawJSON) > 0 { if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value @@ -1381,359 +5197,310 @@ func (a *ActionAttemptSuccess) String() string { return fmt.Sprintf("%#v", a) } -type ClientSession struct { - ClientSessionId string `json:"client_session_id" url:"client_session_id"` - UserIdentifierKey *string `json:"user_identifier_key,omitempty" url:"user_identifier_key,omitempty"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - Token string `json:"token" url:"token"` - DeviceCount float64 `json:"device_count" url:"device_count"` - ConnectedAccountIds []string `json:"connected_account_ids,omitempty" url:"connected_account_ids,omitempty"` - ConnectWebviewIds []string `json:"connect_webview_ids,omitempty" url:"connect_webview_ids,omitempty"` - UserIdentityIds []string `json:"user_identity_ids,omitempty" url:"user_identity_ids,omitempty"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` +// Turning HVAC off succeeded. +type ActionAttemptTwentyTwo struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + Result *ActionAttemptTwentyTwoResult `json:"result,omitempty" url:"result,omitempty"` + status string + actionType string _rawJSON json.RawMessage } -func (c *ClientSession) UnmarshalJSON(data []byte) error { - type embed ClientSession +func (a *ActionAttemptTwentyTwo) Status() string { + return a.status +} + +func (a *ActionAttemptTwentyTwo) ActionType() string { + return a.actionType +} + +func (a *ActionAttemptTwentyTwo) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwentyTwo var unmarshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` }{ - embed: embed(*c), + embed: embed(*a), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientSession(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) + *a = ActionAttemptTwentyTwo(unmarshaler.embed) + a.status = "success" + a.actionType = "SET_THERMOSTAT_OFF" + a._rawJSON = json.RawMessage(data) return nil } -func (c *ClientSession) MarshalJSON() ([]byte, error) { - type embed ClientSession +func (a *ActionAttemptTwentyTwo) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwentyTwo var marshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` + Status string `json:"status"` + ActionType string `json:"action_type"` }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), + embed: embed(*a), + Status: "success", + ActionType: "SET_THERMOSTAT_OFF", } return json.Marshal(marshaler) } -func (c *ClientSession) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { +func (a *ActionAttemptTwentyTwo) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(c); err == nil { + if value, err := core.StringifyJSON(a); err == nil { return value } - return fmt.Sprintf("%#v", c) + return fmt.Sprintf("%#v", a) } -type ClimateSettingSchedule struct { - ClimateSettingScheduleId string `json:"climate_setting_schedule_id" url:"climate_setting_schedule_id"` - DeviceId string `json:"device_id" url:"device_id"` - Name *string `json:"name,omitempty" url:"name,omitempty"` - ScheduleStartsAt string `json:"schedule_starts_at" url:"schedule_starts_at"` - ScheduleEndsAt string `json:"schedule_ends_at" url:"schedule_ends_at"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` - AutomaticHeatingEnabled *bool `json:"automatic_heating_enabled,omitempty" url:"automatic_heating_enabled,omitempty"` - AutomaticCoolingEnabled *bool `json:"automatic_cooling_enabled,omitempty" url:"automatic_cooling_enabled,omitempty"` - HvacModeSetting *ClimateSettingScheduleHvacModeSetting `json:"hvac_mode_setting,omitempty" url:"hvac_mode_setting,omitempty"` - CoolingSetPointCelsius *float64 `json:"cooling_set_point_celsius,omitempty" url:"cooling_set_point_celsius,omitempty"` - HeatingSetPointCelsius *float64 `json:"heating_set_point_celsius,omitempty" url:"heating_set_point_celsius,omitempty"` - CoolingSetPointFahrenheit *float64 `json:"cooling_set_point_fahrenheit,omitempty" url:"cooling_set_point_fahrenheit,omitempty"` - HeatingSetPointFahrenheit *float64 `json:"heating_set_point_fahrenheit,omitempty" url:"heating_set_point_fahrenheit,omitempty"` - ManualOverrideAllowed *bool `json:"manual_override_allowed,omitempty" url:"manual_override_allowed,omitempty"` - scheduleType string - +type ActionAttemptTwentyTwoResult struct { _rawJSON json.RawMessage } -func (c *ClimateSettingSchedule) ScheduleType() string { - return c.scheduleType -} - -func (c *ClimateSettingSchedule) UnmarshalJSON(data []byte) error { - type embed ClimateSettingSchedule - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (a *ActionAttemptTwentyTwoResult) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwentyTwoResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClimateSettingSchedule(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.scheduleType = "time_bound" - c._rawJSON = json.RawMessage(data) + *a = ActionAttemptTwentyTwoResult(value) + a._rawJSON = json.RawMessage(data) return nil } -func (c *ClimateSettingSchedule) MarshalJSON() ([]byte, error) { - type embed ClimateSettingSchedule - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - ScheduleType string `json:"schedule_type"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - ScheduleType: "time_bound", - } - return json.Marshal(marshaler) -} - -func (c *ClimateSettingSchedule) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { +func (a *ActionAttemptTwentyTwoResult) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(c); err == nil { + if value, err := core.StringifyJSON(a); err == nil { return value } - return fmt.Sprintf("%#v", c) + return fmt.Sprintf("%#v", a) } -type ClimateSettingScheduleHvacModeSetting string +// Locking door failed. +type ActionAttemptTwo struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error *ActionAttemptTwoError `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string -const ( - ClimateSettingScheduleHvacModeSettingOff ClimateSettingScheduleHvacModeSetting = "off" - ClimateSettingScheduleHvacModeSettingHeat ClimateSettingScheduleHvacModeSetting = "heat" - ClimateSettingScheduleHvacModeSettingCool ClimateSettingScheduleHvacModeSetting = "cool" - ClimateSettingScheduleHvacModeSettingHeatCool ClimateSettingScheduleHvacModeSetting = "heat_cool" -) + _rawJSON json.RawMessage +} -func NewClimateSettingScheduleHvacModeSettingFromString(s string) (ClimateSettingScheduleHvacModeSetting, error) { - switch s { - case "off": - return ClimateSettingScheduleHvacModeSettingOff, nil - case "heat": - return ClimateSettingScheduleHvacModeSettingHeat, nil - case "cool": - return ClimateSettingScheduleHvacModeSettingCool, nil - case "heat_cool": - return ClimateSettingScheduleHvacModeSettingHeatCool, nil - } - var t ClimateSettingScheduleHvacModeSetting - return "", fmt.Errorf("%s is not a valid %T", s, t) +func (a *ActionAttemptTwo) Status() string { + return a.status } -func (c ClimateSettingScheduleHvacModeSetting) Ptr() *ClimateSettingScheduleHvacModeSetting { - return &c +func (a *ActionAttemptTwo) ActionType() string { + return a.actionType } -type ConnectWebview struct { - ConnectWebviewId string `json:"connect_webview_id" url:"connect_webview_id"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` - Url string `json:"url" url:"url"` - DeviceSelectionMode SelectionMode `json:"device_selection_mode,omitempty" url:"device_selection_mode,omitempty"` - AcceptedProviders []string `json:"accepted_providers,omitempty" url:"accepted_providers,omitempty"` - // --- - // deprecated: Unused. Will be removed. - // --- - AcceptedDevices []string `json:"accepted_devices,omitempty" url:"accepted_devices,omitempty"` - // --- - // deprecated: Unused. Will be removed. - // --- - AnyDeviceAllowed bool `json:"any_device_allowed" url:"any_device_allowed"` - AnyProviderAllowed bool `json:"any_provider_allowed" url:"any_provider_allowed"` - LoginSuccessful bool `json:"login_successful" url:"login_successful"` - Status ConnectWebviewStatus `json:"status,omitempty" url:"status,omitempty"` - CustomRedirectUrl *string `json:"custom_redirect_url,omitempty" url:"custom_redirect_url,omitempty"` - CustomRedirectFailureUrl *string `json:"custom_redirect_failure_url,omitempty" url:"custom_redirect_failure_url,omitempty"` - CustomMetadata map[string]*ConnectWebviewCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` - AutomaticallyManageNewDevices bool `json:"automatically_manage_new_devices" url:"automatically_manage_new_devices"` - WaitForDeviceCreation bool `json:"wait_for_device_creation" url:"wait_for_device_creation"` - AuthorizedAt *time.Time `json:"authorized_at,omitempty" url:"authorized_at,omitempty"` - SelectedProvider *string `json:"selected_provider,omitempty" url:"selected_provider,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConnectWebview) UnmarshalJSON(data []byte) error { - type embed ConnectWebview +func (a *ActionAttemptTwo) UnmarshalJSON(data []byte) error { + type embed ActionAttemptTwo var unmarshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` - AuthorizedAt *core.DateTime `json:"authorized_at,omitempty"` }{ - embed: embed(*c), + embed: embed(*a), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ConnectWebview(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.AuthorizedAt = unmarshaler.AuthorizedAt.TimePtr() - c._rawJSON = json.RawMessage(data) + *a = ActionAttemptTwo(unmarshaler.embed) + a.status = "error" + a.actionType = "LOCK_DOOR" + a._rawJSON = json.RawMessage(data) return nil } -func (c *ConnectWebview) MarshalJSON() ([]byte, error) { - type embed ConnectWebview +func (a *ActionAttemptTwo) MarshalJSON() ([]byte, error) { + type embed ActionAttemptTwo var marshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at"` - AuthorizedAt *core.DateTime `json:"authorized_at,omitempty"` + Status string `json:"status"` + ActionType string `json:"action_type"` }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - AuthorizedAt: core.NewOptionalDateTime(c.AuthorizedAt), + embed: embed(*a), + Status: "error", + ActionType: "LOCK_DOOR", } return json.Marshal(marshaler) } -func (c *ConnectWebview) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { +func (a *ActionAttemptTwo) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(c); err == nil { + if value, err := core.StringifyJSON(a); err == nil { return value } - return fmt.Sprintf("%#v", c) + return fmt.Sprintf("%#v", a) } -type ConnectWebviewCustomMetadataValue struct { - typeName string - String string - Boolean bool -} +type ActionAttemptTwoError struct { + Type string `json:"type" url:"type"` + Message string `json:"message" url:"message"` -func NewConnectWebviewCustomMetadataValueFromString(value string) *ConnectWebviewCustomMetadataValue { - return &ConnectWebviewCustomMetadataValue{typeName: "string", String: value} + _rawJSON json.RawMessage } -func NewConnectWebviewCustomMetadataValueFromBoolean(value bool) *ConnectWebviewCustomMetadataValue { - return &ConnectWebviewCustomMetadataValue{typeName: "boolean", Boolean: value} +func (a *ActionAttemptTwoError) UnmarshalJSON(data []byte) error { + type unmarshaler ActionAttemptTwoError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = ActionAttemptTwoError(value) + a._rawJSON = json.RawMessage(data) + return nil } -func (c *ConnectWebviewCustomMetadataValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil +func (a *ActionAttemptTwoError) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } } - var valueBoolean bool - if err := json.Unmarshal(data, &valueBoolean); err == nil { - c.typeName = "boolean" - c.Boolean = valueBoolean - return nil + if value, err := core.StringifyJSON(a); err == nil { + return value } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) + return fmt.Sprintf("%#v", a) } -func (c ConnectWebviewCustomMetadataValue) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "string": - return json.Marshal(c.String) - case "boolean": - return json.Marshal(c.Boolean) - } -} +// Locking door. +type ActionAttemptZero struct { + // The ID of the action attempt. + ActionAttemptId string `json:"action_attempt_id" url:"action_attempt_id"` + Result interface{} `json:"result,omitempty" url:"result,omitempty"` + Error interface{} `json:"error,omitempty" url:"error,omitempty"` + status string + actionType string -type ConnectWebviewCustomMetadataValueVisitor interface { - VisitString(string) error - VisitBoolean(bool) error + _rawJSON json.RawMessage } -func (c *ConnectWebviewCustomMetadataValue) Accept(visitor ConnectWebviewCustomMetadataValueVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "string": - return visitor.VisitString(c.String) - case "boolean": - return visitor.VisitBoolean(c.Boolean) - } +func (a *ActionAttemptZero) Status() string { + return a.status } -type ConnectWebviewStatus string +func (a *ActionAttemptZero) ActionType() string { + return a.actionType +} -const ( - ConnectWebviewStatusPending ConnectWebviewStatus = "pending" - ConnectWebviewStatusFailed ConnectWebviewStatus = "failed" - ConnectWebviewStatusAuthorized ConnectWebviewStatus = "authorized" -) +func (a *ActionAttemptZero) UnmarshalJSON(data []byte) error { + type embed ActionAttemptZero + var unmarshaler = struct { + embed + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = ActionAttemptZero(unmarshaler.embed) + a.status = "pending" + a.actionType = "LOCK_DOOR" + a._rawJSON = json.RawMessage(data) + return nil +} -func NewConnectWebviewStatusFromString(s string) (ConnectWebviewStatus, error) { - switch s { - case "pending": - return ConnectWebviewStatusPending, nil - case "failed": - return ConnectWebviewStatusFailed, nil - case "authorized": - return ConnectWebviewStatusAuthorized, nil - } - var t ConnectWebviewStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) +func (a *ActionAttemptZero) MarshalJSON() ([]byte, error) { + type embed ActionAttemptZero + var marshaler = struct { + embed + Status string `json:"status"` + ActionType string `json:"action_type"` + }{ + embed: embed(*a), + Status: "pending", + ActionType: "LOCK_DOOR", + } + return json.Marshal(marshaler) } -func (c ConnectWebviewStatus) Ptr() *ConnectWebviewStatus { - return &c +func (a *ActionAttemptZero) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) } -type ConnectedAccount struct { - ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` - UserIdentifier *ConnectedAccountUserIdentifier `json:"user_identifier,omitempty" url:"user_identifier,omitempty"` - AccountType *string `json:"account_type,omitempty" url:"account_type,omitempty"` - AccountTypeDisplayName string `json:"account_type_display_name" url:"account_type_display_name"` - Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` - Warnings interface{} `json:"warnings,omitempty" url:"warnings,omitempty"` - CustomMetadata map[string]*ConnectedAccountCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` - AutomaticallyManageNewDevices bool `json:"automatically_manage_new_devices" url:"automatically_manage_new_devices"` +type ClimateSettingSchedule struct { + ClimateSettingScheduleId string `json:"climate_setting_schedule_id" url:"climate_setting_schedule_id"` + DeviceId string `json:"device_id" url:"device_id"` + Name *string `json:"name,omitempty" url:"name,omitempty"` + ScheduleStartsAt string `json:"schedule_starts_at" url:"schedule_starts_at"` + ScheduleEndsAt string `json:"schedule_ends_at" url:"schedule_ends_at"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` + AutomaticHeatingEnabled *bool `json:"automatic_heating_enabled,omitempty" url:"automatic_heating_enabled,omitempty"` + AutomaticCoolingEnabled *bool `json:"automatic_cooling_enabled,omitempty" url:"automatic_cooling_enabled,omitempty"` + HvacModeSetting *ClimateSettingScheduleHvacModeSetting `json:"hvac_mode_setting,omitempty" url:"hvac_mode_setting,omitempty"` + CoolingSetPointCelsius *float64 `json:"cooling_set_point_celsius,omitempty" url:"cooling_set_point_celsius,omitempty"` + HeatingSetPointCelsius *float64 `json:"heating_set_point_celsius,omitempty" url:"heating_set_point_celsius,omitempty"` + CoolingSetPointFahrenheit *float64 `json:"cooling_set_point_fahrenheit,omitempty" url:"cooling_set_point_fahrenheit,omitempty"` + HeatingSetPointFahrenheit *float64 `json:"heating_set_point_fahrenheit,omitempty" url:"heating_set_point_fahrenheit,omitempty"` + ManualOverrideAllowed *bool `json:"manual_override_allowed,omitempty" url:"manual_override_allowed,omitempty"` + scheduleType string _rawJSON json.RawMessage } -func (c *ConnectedAccount) UnmarshalJSON(data []byte) error { - type embed ConnectedAccount +func (c *ClimateSettingSchedule) ScheduleType() string { + return c.scheduleType +} + +func (c *ClimateSettingSchedule) UnmarshalJSON(data []byte) error { + type embed ClimateSettingSchedule var unmarshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at,omitempty"` + CreatedAt *core.DateTime `json:"created_at"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ConnectedAccount(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.TimePtr() + *c = ClimateSettingSchedule(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.scheduleType = "time_bound" c._rawJSON = json.RawMessage(data) return nil } -func (c *ConnectedAccount) MarshalJSON() ([]byte, error) { - type embed ConnectedAccount +func (c *ClimateSettingSchedule) MarshalJSON() ([]byte, error) { + type embed ClimateSettingSchedule var marshaler = struct { embed - CreatedAt *core.DateTime `json:"created_at,omitempty"` + CreatedAt *core.DateTime `json:"created_at"` + ScheduleType string `json:"schedule_type"` }{ - embed: embed(*c), - CreatedAt: core.NewOptionalDateTime(c.CreatedAt), + embed: embed(*c), + CreatedAt: core.NewDateTime(c.CreatedAt), + ScheduleType: "time_bound", } return json.Marshal(marshaler) } -func (c *ConnectedAccount) String() string { +func (c *ClimateSettingSchedule) String() string { if len(c._rawJSON) > 0 { if value, err := core.StringifyJSON(c._rawJSON); err == nil { return value @@ -1745,94 +5512,32 @@ func (c *ConnectedAccount) String() string { return fmt.Sprintf("%#v", c) } -type ConnectedAccountCustomMetadataValue struct { - typeName string - String string - Boolean bool -} - -func NewConnectedAccountCustomMetadataValueFromString(value string) *ConnectedAccountCustomMetadataValue { - return &ConnectedAccountCustomMetadataValue{typeName: "string", String: value} -} - -func NewConnectedAccountCustomMetadataValueFromBoolean(value bool) *ConnectedAccountCustomMetadataValue { - return &ConnectedAccountCustomMetadataValue{typeName: "boolean", Boolean: value} -} - -func (c *ConnectedAccountCustomMetadataValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - var valueBoolean bool - if err := json.Unmarshal(data, &valueBoolean); err == nil { - c.typeName = "boolean" - c.Boolean = valueBoolean - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConnectedAccountCustomMetadataValue) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "string": - return json.Marshal(c.String) - case "boolean": - return json.Marshal(c.Boolean) - } -} - -type ConnectedAccountCustomMetadataValueVisitor interface { - VisitString(string) error - VisitBoolean(bool) error -} - -func (c *ConnectedAccountCustomMetadataValue) Accept(visitor ConnectedAccountCustomMetadataValueVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "string": - return visitor.VisitString(c.String) - case "boolean": - return visitor.VisitBoolean(c.Boolean) - } -} - -type ConnectedAccountUserIdentifier struct { - Username *string `json:"username,omitempty" url:"username,omitempty"` - ApiUrl *string `json:"api_url,omitempty" url:"api_url,omitempty"` - Email *string `json:"email,omitempty" url:"email,omitempty"` - Phone *string `json:"phone,omitempty" url:"phone,omitempty"` - Exclusive *bool `json:"exclusive,omitempty" url:"exclusive,omitempty"` +type ClimateSettingScheduleHvacModeSetting string - _rawJSON json.RawMessage -} +const ( + ClimateSettingScheduleHvacModeSettingOff ClimateSettingScheduleHvacModeSetting = "off" + ClimateSettingScheduleHvacModeSettingHeat ClimateSettingScheduleHvacModeSetting = "heat" + ClimateSettingScheduleHvacModeSettingCool ClimateSettingScheduleHvacModeSetting = "cool" + ClimateSettingScheduleHvacModeSettingHeatCool ClimateSettingScheduleHvacModeSetting = "heat_cool" +) -func (c *ConnectedAccountUserIdentifier) UnmarshalJSON(data []byte) error { - type unmarshaler ConnectedAccountUserIdentifier - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err +func NewClimateSettingScheduleHvacModeSettingFromString(s string) (ClimateSettingScheduleHvacModeSetting, error) { + switch s { + case "off": + return ClimateSettingScheduleHvacModeSettingOff, nil + case "heat": + return ClimateSettingScheduleHvacModeSettingHeat, nil + case "cool": + return ClimateSettingScheduleHvacModeSettingCool, nil + case "heat_cool": + return ClimateSettingScheduleHvacModeSettingHeatCool, nil } - *c = ConnectedAccountUserIdentifier(value) - c._rawJSON = json.RawMessage(data) - return nil + var t ClimateSettingScheduleHvacModeSetting + return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c *ConnectedAccountUserIdentifier) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) +func (c ClimateSettingScheduleHvacModeSetting) Ptr() *ClimateSettingScheduleHvacModeSetting { + return &c } type Device struct { @@ -1868,6 +5573,8 @@ type Device struct { CanProgramOfflineAccessCodes *bool `json:"can_program_offline_access_codes,omitempty" url:"can_program_offline_access_codes,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"` + CanSimulateConnection *bool `json:"can_simulate_connection,omitempty" url:"can_simulate_connection,omitempty"` + CanSimulateDisconnection *bool `json:"can_simulate_disconnection,omitempty" url:"can_simulate_disconnection,omitempty"` _rawJSON json.RawMessage } @@ -2071,9 +5778,6 @@ func (d *DeviceLocation) String() string { type DeviceProperties struct { // Indicates whether the device is online. Online bool `json:"online" url:"online"` - // --- - // deprecated: use device.display_name instead - // --- // Name of the device. Name string `json:"name" url:"name"` // Represents the accessory keypad state. @@ -2097,15 +5801,13 @@ type DeviceProperties struct { // Indicates whether it is currently possible to use online access codes for the device. 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 - // --- - SupportsAccessoryKeypad *bool `json:"supports_accessory_keypad,omitempty" url:"supports_accessory_keypad,omitempty"` - // --- - // deprecated: use offline_access_codes_enabled - // --- - SupportsOfflineAccessCodes *bool `json:"supports_offline_access_codes,omitempty" url:"supports_offline_access_codes,omitempty"` + OfflineAccessCodesEnabled *bool `json:"offline_access_codes_enabled,omitempty" url:"offline_access_codes_enabled,omitempty"` + SupportsAccessoryKeypad *bool `json:"supports_accessory_keypad,omitempty" url:"supports_accessory_keypad,omitempty"` + SupportsOfflineAccessCodes *bool `json:"supports_offline_access_codes,omitempty" url:"supports_offline_access_codes,omitempty"` + // Indicates current noise level in decibels, if the device supports noise detection. + NoiseLevelDecibels *float64 `json:"noise_level_decibels,omitempty" url:"noise_level_decibels,omitempty"` + // Array of noise threshold IDs that are currently triggering. + CurrentlyTriggeringNoiseThresholdIds []string `json:"currently_triggering_noise_threshold_ids,omitempty" url:"currently_triggering_noise_threshold_ids,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"` AvigilonAltaMetadata *DevicePropertiesAvigilonAltaMetadata `json:"avigilon_alta_metadata,omitempty" url:"avigilon_alta_metadata,omitempty"` @@ -3301,8 +7003,7 @@ type DevicePropertiesModel struct { OfflineAccessCodesSupported *bool `json:"offline_access_codes_supported,omitempty" url:"offline_access_codes_supported,omitempty"` // Indicates whether the device supports online access codes. OnlineAccessCodesSupported *bool `json:"online_access_codes_supported,omitempty" url:"online_access_codes_supported,omitempty"` - // Indicates whether the device supports an accessory keypad. - AccessoryKeypadSupported *bool `json:"accessory_keypad_supported,omitempty" url:"accessory_keypad_supported,omitempty"` + AccessoryKeypadSupported *bool `json:"accessory_keypad_supported,omitempty" url:"accessory_keypad_supported,omitempty"` _rawJSON json.RawMessage } @@ -3636,8 +7337,9 @@ func (d *DevicePropertiesTedeeMetadata) String() string { } type DevicePropertiesTtlockMetadata struct { - LockId float64 `json:"lock_id" url:"lock_id"` - LockAlias string `json:"lock_alias" url:"lock_alias"` + LockId float64 `json:"lock_id" url:"lock_id"` + LockAlias string `json:"lock_alias" url:"lock_alias"` + FeatureValue string `json:"feature_value" url:"feature_value"` _rawJSON json.RawMessage } @@ -3731,196 +7433,6 @@ func (d *DevicePropertiesWyzeMetadata) String() string { return fmt.Sprintf("%#v", d) } -type DeviceProvider struct { - 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"` - - _rawJSON json.RawMessage -} - -func (d *DeviceProvider) UnmarshalJSON(data []byte) error { - type unmarshaler DeviceProvider - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *d = DeviceProvider(value) - d._rawJSON = json.RawMessage(data) - return nil -} - -func (d *DeviceProvider) 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 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" - DeviceProviderProviderCategoriesItemAccessControlSystems DeviceProviderProviderCategoriesItem = "access_control_systems" -) - -func NewDeviceProviderProviderCategoriesItemFromString(s string) (DeviceProviderProviderCategoriesItem, error) { - switch s { - case "stable": - return DeviceProviderProviderCategoriesItemStable, nil - case "consumer_smartlocks": - return DeviceProviderProviderCategoriesItemConsumerSmartlocks, nil - case "thermostats": - 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) -} - -func (d DeviceProviderProviderCategoriesItem) Ptr() *DeviceProviderProviderCategoriesItem { - return &d -} - type DeviceType string const ( @@ -4092,270 +7604,23 @@ func (e *EnrollmentAutomation) MarshalJSON() ([]byte, error) { var marshaler = struct { embed CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (e *EnrollmentAutomation) 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 Event struct { - EventId string `json:"event_id" url:"event_id"` - DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` - ActionAttemptId *string `json:"action_attempt_id,omitempty" url:"action_attempt_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"` - AcsSystemId *string `json:"acs_system_id,omitempty" url:"acs_system_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"` - - _rawJSON json.RawMessage -} - -func (e *Event) UnmarshalJSON(data []byte) error { - type embed Event - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - OccurredAt *core.DateTime `json:"occurred_at"` - }{ - embed: embed(*e), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *e = Event(unmarshaler.embed) - e.CreatedAt = unmarshaler.CreatedAt.Time() - e.OccurredAt = unmarshaler.OccurredAt.Time() - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *Event) MarshalJSON() ([]byte, error) { - type embed Event - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - OccurredAt *core.DateTime `json:"occurred_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - OccurredAt: core.NewDateTime(e.OccurredAt), - } - return json.Marshal(marshaler) -} - -func (e *Event) 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 EventType string - -const ( - EventTypeDeviceConnected EventType = "device.connected" - EventTypeDeviceUnmanagedConnected EventType = "device.unmanaged.connected" - EventTypeDeviceDisconnected EventType = "device.disconnected" - EventTypeDeviceUnmanagedDisconnected EventType = "device.unmanaged.disconnected" - EventTypeDeviceConvertedToUnmanaged EventType = "device.converted_to_unmanaged" - EventTypeDeviceUnmanagedConvertedToManaged EventType = "device.unmanaged.converted_to_managed" - EventTypeDeviceRemoved EventType = "device.removed" - EventTypeDeviceTampered EventType = "device.tampered" - EventTypeDeviceLowBattery EventType = "device.low_battery" - EventTypeDeviceBatteryStatusChanged EventType = "device.battery_status_changed" - EventTypeDeviceThirdPartyIntegrationDetected EventType = "device.third_party_integration_detected" - EventTypeDeviceThirdPartyIntegrationNoLongerDetected EventType = "device.third_party_integration_no_longer_detected" - EventTypeDeviceSaltoPrivacyModeActivated EventType = "device.salto.privacy_mode_activated" - EventTypeDeviceSaltoPrivacyModeDeactivated EventType = "device.salto.privacy_mode_deactivated" - EventTypeDeviceConnectionBecameFlaky EventType = "device.connection_became_flaky" - EventTypeDeviceConnectionStabilized EventType = "device.connection_stabilized" - EventTypeDeviceErrorSubscriptionRequired EventType = "device.error.subscription_required" - EventTypeDeviceErrorSubscriptionRequiredResolved EventType = "device.error.subscription_required.resolved" - EventTypeAccessCodeCreated EventType = "access_code.created" - EventTypeAccessCodeChanged EventType = "access_code.changed" - EventTypeAccessCodeScheduledOnDevice EventType = "access_code.scheduled_on_device" - EventTypeAccessCodeSetOnDevice EventType = "access_code.set_on_device" - EventTypeAccessCodeDeleted EventType = "access_code.deleted" - EventTypeAccessCodeRemovedFromDevice EventType = "access_code.removed_from_device" - EventTypeAccessCodeFailedToSetOnDevice EventType = "access_code.failed_to_set_on_device" - EventTypeAccessCodeDelayInSettingOnDevice EventType = "access_code.delay_in_setting_on_device" - EventTypeAccessCodeFailedToRemoveFromDevice EventType = "access_code.failed_to_remove_from_device" - EventTypeAccessCodeDelayInRemovingFromDevice EventType = "access_code.delay_in_removing_from_device" - EventTypeAccessCodeDeletedExternalToSeam EventType = "access_code.deleted_external_to_seam" - EventTypeAccessCodeModifiedExternalToSeam EventType = "access_code.modified_external_to_seam" - EventTypeAccessCodeUnmanagedConvertedToManaged EventType = "access_code.unmanaged.converted_to_managed" - EventTypeAccessCodeUnmanagedFailedToConvertToManaged EventType = "access_code.unmanaged.failed_to_convert_to_managed" - EventTypeAccessCodeUnmanagedCreated EventType = "access_code.unmanaged.created" - EventTypeAccessCodeUnmanagedRemoved EventType = "access_code.unmanaged.removed" - EventTypeLockLocked EventType = "lock.locked" - EventTypeLockUnlocked EventType = "lock.unlocked" - EventTypeConnectedAccountConnected EventType = "connected_account.connected" - EventTypeConnectedAccountSuccessfulLogin EventType = "connected_account.successful_login" - EventTypeConnectedAccountCreated EventType = "connected_account.created" - EventTypeConnectedAccountDeleted EventType = "connected_account.deleted" - EventTypeConnectedAccountDisconnected EventType = "connected_account.disconnected" - EventTypeConnectedAccountCompletedFirstSync EventType = "connected_account.completed_first_sync" - EventTypeNoiseSensorNoiseThresholdTriggered EventType = "noise_sensor.noise_threshold_triggered" - EventTypeAccessCodeBackupAccessCodePulled EventType = "access_code.backup_access_code_pulled" - EventTypeEnrollmentAutomationDeleted EventType = "enrollment_automation.deleted" - EventTypeAcsUserDeleted EventType = "acs_user.deleted" - EventTypeAcsCredentialDeleted EventType = "acs_credential.deleted" - EventTypePhoneDeactivated EventType = "phone.deactivated" - EventTypeClientSessionDeleted EventType = "client_session.deleted" -) - -func NewEventTypeFromString(s string) (EventType, error) { - switch s { - case "device.connected": - return EventTypeDeviceConnected, nil - case "device.unmanaged.connected": - return EventTypeDeviceUnmanagedConnected, nil - case "device.disconnected": - return EventTypeDeviceDisconnected, nil - case "device.unmanaged.disconnected": - return EventTypeDeviceUnmanagedDisconnected, nil - case "device.converted_to_unmanaged": - return EventTypeDeviceConvertedToUnmanaged, nil - case "device.unmanaged.converted_to_managed": - return EventTypeDeviceUnmanagedConvertedToManaged, nil - case "device.removed": - return EventTypeDeviceRemoved, nil - case "device.tampered": - return EventTypeDeviceTampered, nil - case "device.low_battery": - return EventTypeDeviceLowBattery, nil - case "device.battery_status_changed": - return EventTypeDeviceBatteryStatusChanged, nil - case "device.third_party_integration_detected": - return EventTypeDeviceThirdPartyIntegrationDetected, nil - case "device.third_party_integration_no_longer_detected": - return EventTypeDeviceThirdPartyIntegrationNoLongerDetected, nil - case "device.salto.privacy_mode_activated": - return EventTypeDeviceSaltoPrivacyModeActivated, nil - case "device.salto.privacy_mode_deactivated": - return EventTypeDeviceSaltoPrivacyModeDeactivated, nil - case "device.connection_became_flaky": - return EventTypeDeviceConnectionBecameFlaky, nil - case "device.connection_stabilized": - return EventTypeDeviceConnectionStabilized, nil - case "device.error.subscription_required": - return EventTypeDeviceErrorSubscriptionRequired, nil - case "device.error.subscription_required.resolved": - return EventTypeDeviceErrorSubscriptionRequiredResolved, nil - case "access_code.created": - return EventTypeAccessCodeCreated, nil - case "access_code.changed": - return EventTypeAccessCodeChanged, nil - case "access_code.scheduled_on_device": - return EventTypeAccessCodeScheduledOnDevice, nil - case "access_code.set_on_device": - return EventTypeAccessCodeSetOnDevice, nil - case "access_code.deleted": - return EventTypeAccessCodeDeleted, nil - case "access_code.removed_from_device": - return EventTypeAccessCodeRemovedFromDevice, nil - case "access_code.failed_to_set_on_device": - return EventTypeAccessCodeFailedToSetOnDevice, nil - case "access_code.delay_in_setting_on_device": - return EventTypeAccessCodeDelayInSettingOnDevice, nil - case "access_code.failed_to_remove_from_device": - return EventTypeAccessCodeFailedToRemoveFromDevice, nil - case "access_code.delay_in_removing_from_device": - return EventTypeAccessCodeDelayInRemovingFromDevice, nil - case "access_code.deleted_external_to_seam": - return EventTypeAccessCodeDeletedExternalToSeam, nil - case "access_code.modified_external_to_seam": - return EventTypeAccessCodeModifiedExternalToSeam, nil - case "access_code.unmanaged.converted_to_managed": - return EventTypeAccessCodeUnmanagedConvertedToManaged, nil - case "access_code.unmanaged.failed_to_convert_to_managed": - return EventTypeAccessCodeUnmanagedFailedToConvertToManaged, nil - case "access_code.unmanaged.created": - return EventTypeAccessCodeUnmanagedCreated, nil - case "access_code.unmanaged.removed": - return EventTypeAccessCodeUnmanagedRemoved, nil - case "lock.locked": - return EventTypeLockLocked, nil - case "lock.unlocked": - return EventTypeLockUnlocked, nil - case "connected_account.connected": - return EventTypeConnectedAccountConnected, nil - case "connected_account.successful_login": - return EventTypeConnectedAccountSuccessfulLogin, nil - case "connected_account.created": - return EventTypeConnectedAccountCreated, nil - case "connected_account.deleted": - return EventTypeConnectedAccountDeleted, nil - case "connected_account.disconnected": - return EventTypeConnectedAccountDisconnected, nil - case "connected_account.completed_first_sync": - return EventTypeConnectedAccountCompletedFirstSync, nil - case "noise_sensor.noise_threshold_triggered": - return EventTypeNoiseSensorNoiseThresholdTriggered, nil - case "access_code.backup_access_code_pulled": - return EventTypeAccessCodeBackupAccessCodePulled, nil - case "enrollment_automation.deleted": - return EventTypeEnrollmentAutomationDeleted, nil - case "acs_user.deleted": - return EventTypeAcsUserDeleted, nil - case "acs_credential.deleted": - return EventTypeAcsCredentialDeleted, nil - case "phone.deactivated": - return EventTypePhoneDeactivated, nil - case "client_session.deleted": - return EventTypeClientSessionDeleted, nil - } - var t EventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EventType) Ptr() *EventType { - return &e -} - -type FanMode string - -const ( - FanModeAuto FanMode = "auto" - FanModeOn FanMode = "on" -) - -func NewFanModeFromString(s string) (FanMode, error) { - switch s { - case "auto": - return FanModeAuto, nil - case "on": - return FanModeOn, nil + }{ + embed: embed(*e), + CreatedAt: core.NewDateTime(e.CreatedAt), } - var t FanMode - return "", fmt.Errorf("%s is not a valid %T", s, t) + return json.Marshal(marshaler) } -func (f FanMode) Ptr() *FanMode { - return &f +func (e *EnrollmentAutomation) 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 FanModeSetting string @@ -4520,84 +7785,6 @@ func (m Manufacturer) Ptr() *Manufacturer { return &m } -type MaxTimeRounding string - -const ( - MaxTimeRoundingOneHour MaxTimeRounding = "1hour" - MaxTimeRoundingOneDay MaxTimeRounding = "1day" - MaxTimeRoundingOneH MaxTimeRounding = "1h" - MaxTimeRoundingOneD MaxTimeRounding = "1d" -) - -func NewMaxTimeRoundingFromString(s string) (MaxTimeRounding, error) { - switch s { - case "1hour": - return MaxTimeRoundingOneHour, nil - case "1day": - return MaxTimeRoundingOneDay, nil - case "1h": - return MaxTimeRoundingOneH, nil - case "1d": - return MaxTimeRoundingOneD, nil - } - var t MaxTimeRounding - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (m MaxTimeRounding) Ptr() *MaxTimeRounding { - return &m -} - -type Network struct { - NetworkId string `json:"network_id" url:"network_id"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - DisplayName string `json:"display_name" url:"display_name"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - - _rawJSON json.RawMessage -} - -func (n *Network) UnmarshalJSON(data []byte) error { - type embed Network - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *n = Network(unmarshaler.embed) - n.CreatedAt = unmarshaler.CreatedAt.Time() - n._rawJSON = json.RawMessage(data) - return nil -} - -func (n *Network) MarshalJSON() ([]byte, error) { - type embed Network - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - CreatedAt: core.NewDateTime(n.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (n *Network) String() string { - if len(n._rawJSON) > 0 { - if value, err := core.StringifyJSON(n._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) -} - type NoiseThreshold struct { NoiseThresholdId string `json:"noise_threshold_id" url:"noise_threshold_id"` DeviceId string `json:"device_id" url:"device_id"` @@ -4662,6 +7849,8 @@ type Phone struct { CanProgramOfflineAccessCodes *bool `json:"can_program_offline_access_codes,omitempty" url:"can_program_offline_access_codes,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"` + CanSimulateConnection *bool `json:"can_simulate_connection,omitempty" url:"can_simulate_connection,omitempty"` + CanSimulateDisconnection *bool `json:"can_simulate_disconnection,omitempty" url:"can_simulate_disconnection,omitempty"` _rawJSON json.RawMessage } @@ -5046,31 +8235,6 @@ func (p ProviderCategory) Ptr() *ProviderCategory { return &p } -type SelectionMode string - -const ( - SelectionModeNone SelectionMode = "none" - SelectionModeSingle SelectionMode = "single" - SelectionModeMultiple SelectionMode = "multiple" -) - -func NewSelectionModeFromString(s string) (SelectionMode, error) { - switch s { - case "none": - return SelectionModeNone, nil - case "single": - return SelectionModeSingle, nil - case "multiple": - return SelectionModeMultiple, nil - } - var t SelectionMode - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (s SelectionMode) Ptr() *SelectionMode { - return &s -} - type ServiceHealth struct { Service string `json:"service" url:"service"` Status ServiceHealthStatus `json:"status,omitempty" url:"status,omitempty"` @@ -5255,6 +8419,8 @@ type UnmanagedDevice struct { CanProgramOfflineAccessCodes *bool `json:"can_program_offline_access_codes,omitempty" url:"can_program_offline_access_codes,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"` + CanSimulateConnection *bool `json:"can_simulate_connection,omitempty" url:"can_simulate_connection,omitempty"` + CanSimulateDisconnection *bool `json:"can_simulate_disconnection,omitempty" url:"can_simulate_disconnection,omitempty"` DeviceProvider *UnmanagedDeviceDeviceProvider `json:"device_provider,omitempty" url:"device_provider,omitempty"` _rawJSON json.RawMessage @@ -5397,9 +8563,6 @@ func (u *UnmanagedDeviceErrorsItem) String() string { type UnmanagedDeviceProperties struct { // Represents the accessory keypad state. AccessoryKeypad *UnmanagedDevicePropertiesAccessoryKeypad `json:"accessory_keypad,omitempty" url:"accessory_keypad,omitempty"` - // --- - // deprecated: use device.display_name instead - // --- // Name of the device. Name string `json:"name" url:"name"` // Indicates whether the device is online. @@ -5581,8 +8744,7 @@ type UnmanagedDevicePropertiesModel struct { OfflineAccessCodesSupported *bool `json:"offline_access_codes_supported,omitempty" url:"offline_access_codes_supported,omitempty"` // Indicates whether the device supports online access codes. OnlineAccessCodesSupported *bool `json:"online_access_codes_supported,omitempty" url:"online_access_codes_supported,omitempty"` - // Indicates whether the device supports an accessory keypad. - AccessoryKeypadSupported *bool `json:"accessory_keypad_supported,omitempty" url:"accessory_keypad_supported,omitempty"` + AccessoryKeypadSupported *bool `json:"accessory_keypad_supported,omitempty" url:"accessory_keypad_supported,omitempty"` _rawJSON json.RawMessage } @@ -5639,265 +8801,3 @@ func (u *UnmanagedDeviceWarningsItem) String() string { } return fmt.Sprintf("%#v", u) } - -type UserIdentity struct { - UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` - UserIdentityKey *string `json:"user_identity_key,omitempty" url:"user_identity_key,omitempty"` - EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` - PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` - DisplayName string `json:"display_name" url:"display_name"` - FullName *string `json:"full_name,omitempty" url:"full_name,omitempty"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - - _rawJSON json.RawMessage -} - -func (u *UserIdentity) UnmarshalJSON(data []byte) error { - type embed UserIdentity - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UserIdentity(unmarshaler.embed) - u.CreatedAt = unmarshaler.CreatedAt.Time() - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentity) MarshalJSON() ([]byte, error) { - type embed UserIdentity - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - CreatedAt: core.NewDateTime(u.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (u *UserIdentity) 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 Webhook struct { - WebhookId string `json:"webhook_id" url:"webhook_id"` - Url string `json:"url" url:"url"` - EventTypes []string `json:"event_types,omitempty" url:"event_types,omitempty"` - Secret *string `json:"secret,omitempty" url:"secret,omitempty"` - - _rawJSON json.RawMessage -} - -func (w *Webhook) UnmarshalJSON(data []byte) error { - type unmarshaler Webhook - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *w = Webhook(value) - w._rawJSON = json.RawMessage(data) - return nil -} - -func (w *Webhook) String() string { - if len(w._rawJSON) > 0 { - if value, err := core.StringifyJSON(w._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(w); err == nil { - return value - } - return fmt.Sprintf("%#v", w) -} - -type Workspace struct { - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - Name string `json:"name" url:"name"` - IsSandbox bool `json:"is_sandbox" url:"is_sandbox"` - ConnectPartnerName *string `json:"connect_partner_name,omitempty" url:"connect_partner_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (w *Workspace) UnmarshalJSON(data []byte) error { - type unmarshaler Workspace - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *w = Workspace(value) - w._rawJSON = json.RawMessage(data) - return nil -} - -func (w *Workspace) String() string { - if len(w._rawJSON) > 0 { - if value, err := core.StringifyJSON(w._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(w); err == nil { - return value - } - return fmt.Sprintf("%#v", w) -} - -type ConnectedAccountsGetRequestConnectedAccountId struct { - ConnectedAccountId string `json:"connected_account_id" url:"connected_account_id"` - - _rawJSON json.RawMessage -} - -func (c *ConnectedAccountsGetRequestConnectedAccountId) UnmarshalJSON(data []byte) error { - type unmarshaler ConnectedAccountsGetRequestConnectedAccountId - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConnectedAccountsGetRequestConnectedAccountId(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConnectedAccountsGetRequestConnectedAccountId) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -type ConnectedAccountsGetRequestEmail struct { - Email string `json:"email" url:"email"` - - _rawJSON json.RawMessage -} - -func (c *ConnectedAccountsGetRequestEmail) UnmarshalJSON(data []byte) error { - type unmarshaler ConnectedAccountsGetRequestEmail - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConnectedAccountsGetRequestEmail(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConnectedAccountsGetRequestEmail) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -type ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting string - -const ( - ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingOff ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "off" - ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeat ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "heat" - ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingCool ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "cool" - ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeatCool ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting = "heat_cool" -) - -func NewThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingFromString(s string) (ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting, error) { - switch s { - case "off": - return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingOff, nil - case "heat": - return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeat, nil - case "cool": - return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingCool, nil - case "heat_cool": - return ThermostatsUpdateRequestDefaultClimateSettingHvacModeSettingHeatCool, nil - } - var t ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (t ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting) Ptr() *ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting { - return &t -} - -type UserIdentitiesGetRequestUserIdentityId struct { - UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` - - _rawJSON json.RawMessage -} - -func (u *UserIdentitiesGetRequestUserIdentityId) UnmarshalJSON(data []byte) error { - type unmarshaler UserIdentitiesGetRequestUserIdentityId - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *u = UserIdentitiesGetRequestUserIdentityId(value) - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentitiesGetRequestUserIdentityId) 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 UserIdentitiesGetRequestUserIdentityKey struct { - UserIdentityKey string `json:"user_identity_key" url:"user_identity_key"` - - _rawJSON json.RawMessage -} - -func (u *UserIdentitiesGetRequestUserIdentityKey) UnmarshalJSON(data []byte) error { - type unmarshaler UserIdentitiesGetRequestUserIdentityKey - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *u = UserIdentitiesGetRequestUserIdentityKey(value) - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentitiesGetRequestUserIdentityKey) 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) -} diff --git a/user_identities.go b/user_identities.go index 34a55be..f570863 100644 --- a/user_identities.go +++ b/user_identities.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" core "github.com/seamapi/go/core" + time "time" ) type UserIdentitiesAddAcsUserRequest struct { @@ -55,6 +56,60 @@ type UserIdentitiesRevokeAccessToDeviceRequest struct { DeviceId string `json:"device_id" url:"device_id"` } +type UserIdentity struct { + UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` + UserIdentityKey *string `json:"user_identity_key,omitempty" url:"user_identity_key,omitempty"` + EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` + DisplayName string `json:"display_name" url:"display_name"` + FullName *string `json:"full_name,omitempty" url:"full_name,omitempty"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + + _rawJSON json.RawMessage +} + +func (u *UserIdentity) UnmarshalJSON(data []byte) error { + type embed UserIdentity + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*u), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *u = UserIdentity(unmarshaler.embed) + u.CreatedAt = unmarshaler.CreatedAt.Time() + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UserIdentity) MarshalJSON() ([]byte, error) { + type embed UserIdentity + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*u), + CreatedAt: core.NewDateTime(u.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (u *UserIdentity) 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 UserIdentitiesAddAcsUserResponse struct { Ok bool `json:"ok" url:"ok"` @@ -200,6 +255,64 @@ func (u *UserIdentitiesGetRequest) Accept(visitor UserIdentitiesGetRequestVisito } } +type UserIdentitiesGetRequestUserIdentityId struct { + UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` + + _rawJSON json.RawMessage +} + +func (u *UserIdentitiesGetRequestUserIdentityId) UnmarshalJSON(data []byte) error { + type unmarshaler UserIdentitiesGetRequestUserIdentityId + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UserIdentitiesGetRequestUserIdentityId(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UserIdentitiesGetRequestUserIdentityId) 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 UserIdentitiesGetRequestUserIdentityKey struct { + UserIdentityKey string `json:"user_identity_key" url:"user_identity_key"` + + _rawJSON json.RawMessage +} + +func (u *UserIdentitiesGetRequestUserIdentityKey) UnmarshalJSON(data []byte) error { + type unmarshaler UserIdentitiesGetRequestUserIdentityKey + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UserIdentitiesGetRequestUserIdentityKey(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UserIdentitiesGetRequestUserIdentityKey) 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 UserIdentitiesGetResponse struct { UserIdentity *UserIdentity `json:"user_identity,omitempty" url:"user_identity,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -260,10 +373,7 @@ func (u *UserIdentitiesGrantAccessToDeviceResponse) String() string { } type UserIdentitiesListAccessibleDevicesResponse struct { - Devices []*Device `json:"devices,omitempty" url:"devices,omitempty"` - // --- - // deprecated: use devices. - // --- + Devices []*Device `json:"devices,omitempty" url:"devices,omitempty"` AccessibleDevices []*Device `json:"accessible_devices,omitempty" url:"accessible_devices,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/useridentities/enrollment_automations.go b/useridentities/enrollment_automations.go index 47ae147..f643a61 100644 --- a/useridentities/enrollment_automations.go +++ b/useridentities/enrollment_automations.go @@ -7,6 +7,7 @@ import ( fmt "fmt" seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" + time "time" ) type EnrollmentAutomationsDeleteRequest struct { @@ -118,6 +119,58 @@ func (e *EnrollmentAutomationsLaunchResponse) String() string { return fmt.Sprintf("%#v", e) } +type EnrollmentAutomationsLaunchResponseEnrollmentAutomation struct { + AcsCredentialProvisioningAutomationId string `json:"acs_credential_provisioning_automation_id" url:"acs_credential_provisioning_automation_id"` + CredentialManagerAcsSystemId string `json:"credential_manager_acs_system_id" url:"credential_manager_acs_system_id"` + UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + EnrollmentAutomationId string `json:"enrollment_automation_id" url:"enrollment_automation_id"` + + _rawJSON json.RawMessage +} + +func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) UnmarshalJSON(data []byte) error { + type embed EnrollmentAutomationsLaunchResponseEnrollmentAutomation + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*e), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *e = EnrollmentAutomationsLaunchResponseEnrollmentAutomation(unmarshaler.embed) + e.CreatedAt = unmarshaler.CreatedAt.Time() + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) MarshalJSON() ([]byte, error) { + type embed EnrollmentAutomationsLaunchResponseEnrollmentAutomation + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*e), + CreatedAt: core.NewDateTime(e.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) 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 EnrollmentAutomationsListResponse struct { EnrollmentAutomations []*seamapigo.EnrollmentAutomation `json:"enrollment_automations,omitempty" url:"enrollment_automations,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/useridentities/types.go b/useridentities/types.go deleted file mode 100644 index 19a9f0a..0000000 --- a/useridentities/types.go +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package useridentities - -import ( - json "encoding/json" - fmt "fmt" - core "github.com/seamapi/go/core" - time "time" -) - -type EnrollmentAutomationsLaunchResponseEnrollmentAutomation struct { - AcsCredentialProvisioningAutomationId string `json:"acs_credential_provisioning_automation_id" url:"acs_credential_provisioning_automation_id"` - CredentialManagerAcsSystemId string `json:"credential_manager_acs_system_id" url:"credential_manager_acs_system_id"` - UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - EnrollmentAutomationId string `json:"enrollment_automation_id" url:"enrollment_automation_id"` - - _rawJSON json.RawMessage -} - -func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) UnmarshalJSON(data []byte) error { - type embed EnrollmentAutomationsLaunchResponseEnrollmentAutomation - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *e = EnrollmentAutomationsLaunchResponseEnrollmentAutomation(unmarshaler.embed) - e.CreatedAt = unmarshaler.CreatedAt.Time() - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) MarshalJSON() ([]byte, error) { - type embed EnrollmentAutomationsLaunchResponseEnrollmentAutomation - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (e *EnrollmentAutomationsLaunchResponseEnrollmentAutomation) 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) -} diff --git a/webhooks.go b/webhooks.go index d1ad36f..8c75f02 100644 --- a/webhooks.go +++ b/webhooks.go @@ -21,6 +21,38 @@ type WebhooksGetRequest struct { WebhookId string `json:"webhook_id" url:"webhook_id"` } +type Webhook struct { + WebhookId string `json:"webhook_id" url:"webhook_id"` + Url string `json:"url" url:"url"` + EventTypes []string `json:"event_types,omitempty" url:"event_types,omitempty"` + Secret *string `json:"secret,omitempty" url:"secret,omitempty"` + + _rawJSON json.RawMessage +} + +func (w *Webhook) UnmarshalJSON(data []byte) error { + type unmarshaler Webhook + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *w = Webhook(value) + w._rawJSON = json.RawMessage(data) + return nil +} + +func (w *Webhook) String() string { + if len(w._rawJSON) > 0 { + if value, err := core.StringifyJSON(w._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(w); err == nil { + return value + } + return fmt.Sprintf("%#v", w) +} + type WebhooksCreateResponse struct { Webhook *Webhook `json:"webhook,omitempty" url:"webhook,omitempty"` Ok bool `json:"ok" url:"ok"` diff --git a/workspaces.go b/workspaces.go index 0abab6a..c7bccb8 100644 --- a/workspaces.go +++ b/workspaces.go @@ -9,14 +9,47 @@ import ( ) type WorkspacesCreateRequest struct { - Name string `json:"name" url:"name"` - // The name shown inside the connect webview - ConnectPartnerName string `json:"connect_partner_name" url:"connect_partner_name"` + Name string `json:"name" url:"name"` + CompanyName *string `json:"company_name,omitempty" url:"company_name,omitempty"` + ConnectPartnerName *string `json:"connect_partner_name,omitempty" url:"connect_partner_name,omitempty"` IsSandbox *bool `json:"is_sandbox,omitempty" url:"is_sandbox,omitempty"` WebviewPrimaryButtonColor *string `json:"webview_primary_button_color,omitempty" url:"webview_primary_button_color,omitempty"` WebviewLogoShape *WebviewLogoShape `json:"webview_logo_shape,omitempty" url:"webview_logo_shape,omitempty"` } +type Workspace struct { + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + Name string `json:"name" url:"name"` + CompanyName string `json:"company_name" url:"company_name"` + IsSandbox bool `json:"is_sandbox" url:"is_sandbox"` + ConnectPartnerName *string `json:"connect_partner_name,omitempty" url:"connect_partner_name,omitempty"` + + _rawJSON json.RawMessage +} + +func (w *Workspace) UnmarshalJSON(data []byte) error { + type unmarshaler Workspace + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *w = Workspace(value) + w._rawJSON = json.RawMessage(data) + return nil +} + +func (w *Workspace) String() string { + if len(w._rawJSON) > 0 { + if value, err := core.StringifyJSON(w._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(w); err == nil { + return value + } + return fmt.Sprintf("%#v", w) +} + type WorkspacesCreateResponse struct { Workspace *Workspace `json:"workspace,omitempty" url:"workspace,omitempty"` Ok bool `json:"ok" url:"ok"`