From 9ba37db445d389ad27c8e9134cec91a178e16297 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 01:32:53 +0000 Subject: [PATCH] SDK regeneration --- accesscodes/client/client.go | 8 +- accesscodes/unmanaged/client.go | 4 +- acs/accessgroups/client.go | 12 +- acs/credential_pools.go | 5 +- acs/credential_provisioning_automations.go | 5 +- acs/credentialpools/client.go | 4 +- .../client.go | 4 +- acs/credentials.go | 38 +- acs/credentials/client.go | 12 +- acs/entrances.go | 13 +- acs/entrances/client.go | 12 +- acs/systems/client.go | 8 +- acs/types.go | 2171 +---------------- acs/users.go | 4 +- acs/users/client.go | 16 +- client/client.go | 3 - client/options.go | 7 +- connect_webviews.go | 27 +- connected_accounts.go | 22 +- connectwebviews/client.go | 68 - core/request_option.go | 17 +- devices.go | 44 +- devices/unmanaged.go | 44 +- health.go | 97 - health/client/client.go | 163 -- health/service.go | 45 - health/service/client.go | 99 - locks.go | 44 +- networks.go | 8 +- networks/client.go | 8 +- noisesensors/noisethresholds/client.go | 8 +- option/request_option.go | 9 +- thermostats.go | 44 +- thermostats/climatesettingschedules/client.go | 4 +- types.go | 1251 +++++++--- user_identities.go | 16 +- useridentities/client/client.go | 22 +- .../enrollmentautomations/client.go | 12 +- workspaces/client.go | 4 +- 39 files changed, 1056 insertions(+), 3326 deletions(-) delete mode 100644 health.go delete mode 100644 health/client/client.go delete mode 100644 health/service.go delete mode 100644 health/service/client.go diff --git a/accesscodes/client/client.go b/accesscodes/client/client.go index bc48843..a4b9ec6 100644 --- a/accesscodes/client/client.go +++ b/accesscodes/client/client.go @@ -171,7 +171,7 @@ func (c *Client) Delete( ctx context.Context, request *seamapigo.AccessCodesDeleteRequest, opts ...option.RequestOption, -) (*seamapigo.ActionAttempt, error) { +) (*seamapigo.AccessCodesDeleteResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -227,7 +227,7 @@ func (c *Client) Delete( ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response, nil } func (c *Client) GenerateCode( @@ -486,7 +486,7 @@ func (c *Client) Update( ctx context.Context, request *seamapigo.AccessCodesUpdateRequest, opts ...option.RequestOption, -) (*seamapigo.ActionAttempt, error) { +) (*seamapigo.AccessCodesUpdateResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -542,5 +542,5 @@ func (c *Client) Update( ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response, nil } diff --git a/accesscodes/unmanaged/client.go b/accesscodes/unmanaged/client.go index cf07567..cde230b 100644 --- a/accesscodes/unmanaged/client.go +++ b/accesscodes/unmanaged/client.go @@ -102,7 +102,7 @@ func (c *Client) Delete( ctx context.Context, request *accesscodes.UnmanagedDeleteRequest, opts ...option.RequestOption, -) (*seamapigo.ActionAttempt, error) { +) (*accesscodes.UnmanagedDeleteResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,7 +158,7 @@ func (c *Client) Delete( ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response, nil } func (c *Client) Get( diff --git a/acs/accessgroups/client.go b/acs/accessgroups/client.go index 3bee1d1..23ea9bc 100644 --- a/acs/accessgroups/client.go +++ b/acs/accessgroups/client.go @@ -102,7 +102,7 @@ func (c *Client) Get( ctx context.Context, request *acs.AccessGroupsGetRequest, opts ...option.RequestOption, -) (*acs.AccessGroupsGetResponse, error) { +) (*seamapigo.AcsAccessGroup, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,14 +158,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.AcsAccessGroup, nil } func (c *Client) List( ctx context.Context, request *acs.AccessGroupsListRequest, opts ...option.RequestOption, -) (*acs.AccessGroupsListResponse, error) { +) ([]*seamapigo.AcsAccessGroup, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -221,14 +221,14 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsAccessGroups, nil } func (c *Client) ListUsers( ctx context.Context, request *acs.AccessGroupsListUsersRequest, opts ...option.RequestOption, -) (*acs.AccessGroupsListUsersResponse, error) { +) ([]*seamapigo.AcsUser, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -284,7 +284,7 @@ func (c *Client) ListUsers( ); err != nil { return nil, err } - return response, nil + return response.AcsUsers, nil } func (c *Client) RemoveUser( diff --git a/acs/credential_pools.go b/acs/credential_pools.go index 5571a83..f6619f2 100644 --- a/acs/credential_pools.go +++ b/acs/credential_pools.go @@ -5,6 +5,7 @@ package acs import ( json "encoding/json" fmt "fmt" + seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" ) @@ -13,8 +14,8 @@ type CredentialPoolsListRequest struct { } type CredentialPoolsListResponse struct { - AcsCredentialPools []*CredentialPoolsListResponseAcsCredentialPoolsItem `json:"acs_credential_pools,omitempty" url:"acs_credential_pools,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredentialPools []*seamapigo.AcsCredentialPool `json:"acs_credential_pools,omitempty" url:"acs_credential_pools,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/acs/credential_provisioning_automations.go b/acs/credential_provisioning_automations.go index 9bab443..bf99bbf 100644 --- a/acs/credential_provisioning_automations.go +++ b/acs/credential_provisioning_automations.go @@ -5,6 +5,7 @@ package acs import ( json "encoding/json" fmt "fmt" + seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" ) @@ -17,8 +18,8 @@ type CredentialProvisioningAutomationsLaunchRequest struct { } type CredentialProvisioningAutomationsLaunchResponse struct { - AcsCredentialProvisioningAutomation *CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation `json:"acs_credential_provisioning_automation,omitempty" url:"acs_credential_provisioning_automation,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredentialProvisioningAutomation *seamapigo.AcsCredentialProvisioningAutomation `json:"acs_credential_provisioning_automation,omitempty" url:"acs_credential_provisioning_automation,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/acs/credentialpools/client.go b/acs/credentialpools/client.go index 4fca7d0..0cf6735 100644 --- a/acs/credentialpools/client.go +++ b/acs/credentialpools/client.go @@ -39,7 +39,7 @@ func (c *Client) List( ctx context.Context, request *acs.CredentialPoolsListRequest, opts ...option.RequestOption, -) (*acs.CredentialPoolsListResponse, error) { +) ([]*seamapigo.AcsCredentialPool, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -95,5 +95,5 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsCredentialPools, nil } diff --git a/acs/credentialprovisioningautomations/client.go b/acs/credentialprovisioningautomations/client.go index 5784e64..2fda474 100644 --- a/acs/credentialprovisioningautomations/client.go +++ b/acs/credentialprovisioningautomations/client.go @@ -39,7 +39,7 @@ func (c *Client) Launch( ctx context.Context, request *acs.CredentialProvisioningAutomationsLaunchRequest, opts ...option.RequestOption, -) (*acs.CredentialProvisioningAutomationsLaunchResponse, error) { +) (*seamapigo.AcsCredentialProvisioningAutomation, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -95,5 +95,5 @@ func (c *Client) Launch( ); err != nil { return nil, err } - return response, nil + return response.AcsCredentialProvisioningAutomation, nil } diff --git a/acs/credentials.go b/acs/credentials.go index 39b48f6..d19c6aa 100644 --- a/acs/credentials.go +++ b/acs/credentials.go @@ -5,6 +5,7 @@ package acs import ( json "encoding/json" fmt "fmt" + seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" time "time" ) @@ -66,8 +67,8 @@ type CredentialsListRequest struct { } type CredentialsAssignResponse struct { - AcsCredential *CredentialsAssignResponseAcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -121,10 +122,15 @@ func (c CredentialsCreateRequestAccessMethod) Ptr() *CredentialsCreateRequestAcc } 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"` - IsOverrideKey *bool `json:"is_override_key,omitempty" url:"is_override_key,omitempty"` - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` + 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"` _rawJSON json.RawMessage } @@ -153,8 +159,8 @@ func (c *CredentialsCreateRequestVisionlineMetadata) String() string { } type CredentialsCreateResponse struct { - AcsCredential *CredentialsCreateResponseAcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -212,8 +218,8 @@ func (c *CredentialsDeleteResponse) String() string { } type CredentialsGetResponse struct { - AcsCredential *CredentialsGetResponseAcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -242,8 +248,8 @@ func (c *CredentialsGetResponse) String() string { } type CredentialsListResponse struct { - AcsCredentials []*CredentialsListResponseAcsCredentialsItem `json:"acs_credentials,omitempty" url:"acs_credentials,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredentials []*seamapigo.AcsCredential `json:"acs_credentials,omitempty" url:"acs_credentials,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -272,8 +278,8 @@ func (c *CredentialsListResponse) String() string { } type CredentialsUnassignResponse struct { - AcsCredential *CredentialsUnassignResponseAcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -302,8 +308,8 @@ func (c *CredentialsUnassignResponse) String() string { } type CredentialsUpdateResponse struct { - AcsCredential *CredentialsUpdateResponseAcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredential *seamapigo.AcsCredential `json:"acs_credential,omitempty" url:"acs_credential,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/acs/credentials/client.go b/acs/credentials/client.go index 7eb37e4..ebf05f8 100644 --- a/acs/credentials/client.go +++ b/acs/credentials/client.go @@ -102,7 +102,7 @@ func (c *Client) Create( ctx context.Context, request *acs.CredentialsCreateRequest, opts ...option.RequestOption, -) (*acs.CredentialsCreateResponse, error) { +) (*seamapigo.AcsCredential, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,7 +158,7 @@ func (c *Client) Create( ); err != nil { return nil, err } - return response, nil + return response.AcsCredential, nil } func (c *Client) Delete( @@ -228,7 +228,7 @@ func (c *Client) Get( ctx context.Context, request *acs.CredentialsGetRequest, opts ...option.RequestOption, -) (*acs.CredentialsGetResponse, error) { +) (*seamapigo.AcsCredential, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -284,14 +284,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.AcsCredential, nil } func (c *Client) List( ctx context.Context, request *acs.CredentialsListRequest, opts ...option.RequestOption, -) (*acs.CredentialsListResponse, error) { +) ([]*seamapigo.AcsCredential, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -347,7 +347,7 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsCredentials, nil } func (c *Client) Unassign( diff --git a/acs/entrances.go b/acs/entrances.go index 3782590..573475e 100644 --- a/acs/entrances.go +++ b/acs/entrances.go @@ -5,6 +5,7 @@ package acs import ( json "encoding/json" fmt "fmt" + seamapigo "github.com/seamapi/go" core "github.com/seamapi/go/core" ) @@ -28,8 +29,8 @@ type EntrancesListCredentialsWithAccessRequest struct { } type EntrancesGetResponse struct { - AcsEntrance *EntrancesGetResponseAcsEntrance `json:"acs_entrance,omitempty" url:"acs_entrance,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsEntrance *seamapigo.AcsEntrance `json:"acs_entrance,omitempty" url:"acs_entrance,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -87,8 +88,8 @@ func (e *EntrancesGrantAccessResponse) String() string { } type EntrancesListCredentialsWithAccessResponse struct { - AcsCredentials []*EntrancesListCredentialsWithAccessResponseAcsCredentialsItem `json:"acs_credentials,omitempty" url:"acs_credentials,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsCredentials []*seamapigo.AcsCredential `json:"acs_credentials,omitempty" url:"acs_credentials,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -117,8 +118,8 @@ func (e *EntrancesListCredentialsWithAccessResponse) String() string { } type EntrancesListResponse struct { - AcsEntrances []*EntrancesListResponseAcsEntrancesItem `json:"acs_entrances,omitempty" url:"acs_entrances,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsEntrances []*seamapigo.AcsEntrance `json:"acs_entrances,omitempty" url:"acs_entrances,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/acs/entrances/client.go b/acs/entrances/client.go index 030030e..e396201 100644 --- a/acs/entrances/client.go +++ b/acs/entrances/client.go @@ -39,7 +39,7 @@ func (c *Client) Get( ctx context.Context, request *acs.EntrancesGetRequest, opts ...option.RequestOption, -) (*acs.EntrancesGetResponse, error) { +) (*seamapigo.AcsEntrance, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -95,7 +95,7 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.AcsEntrance, nil } func (c *Client) GrantAccess( @@ -165,7 +165,7 @@ func (c *Client) List( ctx context.Context, request *acs.EntrancesListRequest, opts ...option.RequestOption, -) (*acs.EntrancesListResponse, error) { +) ([]*seamapigo.AcsEntrance, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -221,14 +221,14 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsEntrances, nil } func (c *Client) ListCredentialsWithAccess( ctx context.Context, request *acs.EntrancesListCredentialsWithAccessRequest, opts ...option.RequestOption, -) (*acs.EntrancesListCredentialsWithAccessResponse, error) { +) ([]*seamapigo.AcsCredential, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -284,5 +284,5 @@ func (c *Client) ListCredentialsWithAccess( ); err != nil { return nil, err } - return response, nil + return response.AcsCredentials, nil } diff --git a/acs/systems/client.go b/acs/systems/client.go index 45a9d14..27aa397 100644 --- a/acs/systems/client.go +++ b/acs/systems/client.go @@ -39,7 +39,7 @@ func (c *Client) Get( ctx context.Context, request *acs.SystemsGetRequest, opts ...option.RequestOption, -) (*acs.SystemsGetResponse, error) { +) (*seamapigo.AcsSystem, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -95,14 +95,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.AcsSystem, nil } func (c *Client) List( ctx context.Context, request *acs.SystemsListRequest, opts ...option.RequestOption, -) (*acs.SystemsListResponse, error) { +) ([]*seamapigo.AcsSystem, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,5 +158,5 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsSystems, nil } diff --git a/acs/types.go b/acs/types.go index 6f249ad..3be346e 100644 --- a/acs/types.go +++ b/acs/types.go @@ -3,331 +3,9 @@ package acs import ( - json "encoding/json" fmt "fmt" - core "github.com/seamapi/go/core" - time "time" ) -type CredentialPoolsListResponseAcsCredentialPoolsItem struct { - AcsCredentialPoolId string `json:"acs_credential_pool_id" url:"acs_credential_pool_id"` - AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` - DisplayName string `json:"display_name" url:"display_name"` - ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - externalType string - - _rawJSON json.RawMessage -} - -func (c *CredentialPoolsListResponseAcsCredentialPoolsItem) ExternalType() string { - return c.externalType -} - -func (c *CredentialPoolsListResponseAcsCredentialPoolsItem) UnmarshalJSON(data []byte) error { - type embed CredentialPoolsListResponseAcsCredentialPoolsItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialPoolsListResponseAcsCredentialPoolsItem(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.externalType = "hid_part_number" - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialPoolsListResponseAcsCredentialPoolsItem) MarshalJSON() ([]byte, error) { - type embed CredentialPoolsListResponseAcsCredentialPoolsItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - ExternalType string `json:"external_type"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - ExternalType: "hid_part_number", - } - return json.Marshal(marshaler) -} - -func (c *CredentialPoolsListResponseAcsCredentialPoolsItem) 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 CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation 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"` - - _rawJSON json.RawMessage -} - -func (c *CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation) UnmarshalJSON(data []byte) error { - type embed CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation) MarshalJSON() ([]byte, error) { - type embed CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialProvisioningAutomationsLaunchResponseAcsCredentialProvisioningAutomation) 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 CredentialsAssignResponseAcsCredential 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 CredentialsAssignResponseAcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsAssignResponseAcsCredentialExternalType `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 []*CredentialsAssignResponseAcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsAssignResponseAcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsAssignResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsAssignResponseAcsCredential) UnmarshalJSON(data []byte) error { - type embed CredentialsAssignResponseAcsCredential - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsAssignResponseAcsCredential(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsAssignResponseAcsCredential) MarshalJSON() ([]byte, error) { - type embed CredentialsAssignResponseAcsCredential - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsAssignResponseAcsCredential) 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 CredentialsAssignResponseAcsCredentialAccessMethod string - -const ( - CredentialsAssignResponseAcsCredentialAccessMethodCode CredentialsAssignResponseAcsCredentialAccessMethod = "code" - CredentialsAssignResponseAcsCredentialAccessMethodCard CredentialsAssignResponseAcsCredentialAccessMethod = "card" - CredentialsAssignResponseAcsCredentialAccessMethodMobileKey CredentialsAssignResponseAcsCredentialAccessMethod = "mobile_key" -) - -func NewCredentialsAssignResponseAcsCredentialAccessMethodFromString(s string) (CredentialsAssignResponseAcsCredentialAccessMethod, error) { - switch s { - case "code": - return CredentialsAssignResponseAcsCredentialAccessMethodCode, nil - case "card": - return CredentialsAssignResponseAcsCredentialAccessMethodCard, nil - case "mobile_key": - return CredentialsAssignResponseAcsCredentialAccessMethodMobileKey, nil - } - var t CredentialsAssignResponseAcsCredentialAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsAssignResponseAcsCredentialAccessMethod) Ptr() *CredentialsAssignResponseAcsCredentialAccessMethod { - return &c -} - -type CredentialsAssignResponseAcsCredentialErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsAssignResponseAcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsAssignResponseAcsCredentialErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsAssignResponseAcsCredentialErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsAssignResponseAcsCredentialErrorsItem) 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 CredentialsAssignResponseAcsCredentialExternalType string - -const ( - CredentialsAssignResponseAcsCredentialExternalTypePtiCard CredentialsAssignResponseAcsCredentialExternalType = "pti_card" - CredentialsAssignResponseAcsCredentialExternalTypeBrivoCredential CredentialsAssignResponseAcsCredentialExternalType = "brivo_credential" - CredentialsAssignResponseAcsCredentialExternalTypeHidCredential CredentialsAssignResponseAcsCredentialExternalType = "hid_credential" - CredentialsAssignResponseAcsCredentialExternalTypeVisionlineCard CredentialsAssignResponseAcsCredentialExternalType = "visionline_card" -) - -func NewCredentialsAssignResponseAcsCredentialExternalTypeFromString(s string) (CredentialsAssignResponseAcsCredentialExternalType, error) { - switch s { - case "pti_card": - return CredentialsAssignResponseAcsCredentialExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsAssignResponseAcsCredentialExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsAssignResponseAcsCredentialExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsAssignResponseAcsCredentialExternalTypeVisionlineCard, nil - } - var t CredentialsAssignResponseAcsCredentialExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsAssignResponseAcsCredentialExternalType) Ptr() *CredentialsAssignResponseAcsCredentialExternalType { - return &c -} - -type CredentialsAssignResponseAcsCredentialVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsAssignResponseAcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsAssignResponseAcsCredentialVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsAssignResponseAcsCredentialVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsAssignResponseAcsCredentialVisionlineMetadata) 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 CredentialsAssignResponseAcsCredentialWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsAssignResponseAcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsAssignResponseAcsCredentialWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsAssignResponseAcsCredentialWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsAssignResponseAcsCredentialWarningsItem) 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 CredentialsCreateRequestVisionlineMetadataCardFormat string const ( @@ -350,1853 +28,24 @@ func (c CredentialsCreateRequestVisionlineMetadataCardFormat) Ptr() *Credentials return &c } -type CredentialsCreateResponseAcsCredential 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 CredentialsCreateResponseAcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsCreateResponseAcsCredentialExternalType `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 []*CredentialsCreateResponseAcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsCreateResponseAcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsCreateResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsCreateResponseAcsCredential) UnmarshalJSON(data []byte) error { - type embed CredentialsCreateResponseAcsCredential - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsCreateResponseAcsCredential(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsCreateResponseAcsCredential) MarshalJSON() ([]byte, error) { - type embed CredentialsCreateResponseAcsCredential - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsCreateResponseAcsCredential) 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 CredentialsCreateResponseAcsCredentialAccessMethod string - -const ( - CredentialsCreateResponseAcsCredentialAccessMethodCode CredentialsCreateResponseAcsCredentialAccessMethod = "code" - CredentialsCreateResponseAcsCredentialAccessMethodCard CredentialsCreateResponseAcsCredentialAccessMethod = "card" - CredentialsCreateResponseAcsCredentialAccessMethodMobileKey CredentialsCreateResponseAcsCredentialAccessMethod = "mobile_key" -) - -func NewCredentialsCreateResponseAcsCredentialAccessMethodFromString(s string) (CredentialsCreateResponseAcsCredentialAccessMethod, error) { - switch s { - case "code": - return CredentialsCreateResponseAcsCredentialAccessMethodCode, nil - case "card": - return CredentialsCreateResponseAcsCredentialAccessMethodCard, nil - case "mobile_key": - return CredentialsCreateResponseAcsCredentialAccessMethodMobileKey, nil - } - var t CredentialsCreateResponseAcsCredentialAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsCreateResponseAcsCredentialAccessMethod) Ptr() *CredentialsCreateResponseAcsCredentialAccessMethod { - return &c -} - -type CredentialsCreateResponseAcsCredentialErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsCreateResponseAcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsCreateResponseAcsCredentialErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsCreateResponseAcsCredentialErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsCreateResponseAcsCredentialErrorsItem) 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 CredentialsCreateResponseAcsCredentialExternalType string - -const ( - CredentialsCreateResponseAcsCredentialExternalTypePtiCard CredentialsCreateResponseAcsCredentialExternalType = "pti_card" - CredentialsCreateResponseAcsCredentialExternalTypeBrivoCredential CredentialsCreateResponseAcsCredentialExternalType = "brivo_credential" - CredentialsCreateResponseAcsCredentialExternalTypeHidCredential CredentialsCreateResponseAcsCredentialExternalType = "hid_credential" - CredentialsCreateResponseAcsCredentialExternalTypeVisionlineCard CredentialsCreateResponseAcsCredentialExternalType = "visionline_card" -) - -func NewCredentialsCreateResponseAcsCredentialExternalTypeFromString(s string) (CredentialsCreateResponseAcsCredentialExternalType, error) { - switch s { - case "pti_card": - return CredentialsCreateResponseAcsCredentialExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsCreateResponseAcsCredentialExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsCreateResponseAcsCredentialExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsCreateResponseAcsCredentialExternalTypeVisionlineCard, nil - } - var t CredentialsCreateResponseAcsCredentialExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsCreateResponseAcsCredentialExternalType) Ptr() *CredentialsCreateResponseAcsCredentialExternalType { - return &c -} - -type CredentialsCreateResponseAcsCredentialVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsCreateResponseAcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsCreateResponseAcsCredentialVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsCreateResponseAcsCredentialVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsCreateResponseAcsCredentialVisionlineMetadata) 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 CredentialsCreateResponseAcsCredentialWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsCreateResponseAcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsCreateResponseAcsCredentialWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsCreateResponseAcsCredentialWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsCreateResponseAcsCredentialWarningsItem) 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 CredentialsGetResponseAcsCredential 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 CredentialsGetResponseAcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsGetResponseAcsCredentialExternalType `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 []*CredentialsGetResponseAcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsGetResponseAcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsGetResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsGetResponseAcsCredential) UnmarshalJSON(data []byte) error { - type embed CredentialsGetResponseAcsCredential - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsGetResponseAcsCredential(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsGetResponseAcsCredential) MarshalJSON() ([]byte, error) { - type embed CredentialsGetResponseAcsCredential - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsGetResponseAcsCredential) 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 CredentialsGetResponseAcsCredentialAccessMethod string - -const ( - CredentialsGetResponseAcsCredentialAccessMethodCode CredentialsGetResponseAcsCredentialAccessMethod = "code" - CredentialsGetResponseAcsCredentialAccessMethodCard CredentialsGetResponseAcsCredentialAccessMethod = "card" - CredentialsGetResponseAcsCredentialAccessMethodMobileKey CredentialsGetResponseAcsCredentialAccessMethod = "mobile_key" -) - -func NewCredentialsGetResponseAcsCredentialAccessMethodFromString(s string) (CredentialsGetResponseAcsCredentialAccessMethod, error) { - switch s { - case "code": - return CredentialsGetResponseAcsCredentialAccessMethodCode, nil - case "card": - return CredentialsGetResponseAcsCredentialAccessMethodCard, nil - case "mobile_key": - return CredentialsGetResponseAcsCredentialAccessMethodMobileKey, nil - } - var t CredentialsGetResponseAcsCredentialAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsGetResponseAcsCredentialAccessMethod) Ptr() *CredentialsGetResponseAcsCredentialAccessMethod { - return &c -} - -type CredentialsGetResponseAcsCredentialErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsGetResponseAcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsGetResponseAcsCredentialErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsGetResponseAcsCredentialErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsGetResponseAcsCredentialErrorsItem) 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 CredentialsGetResponseAcsCredentialExternalType string - -const ( - CredentialsGetResponseAcsCredentialExternalTypePtiCard CredentialsGetResponseAcsCredentialExternalType = "pti_card" - CredentialsGetResponseAcsCredentialExternalTypeBrivoCredential CredentialsGetResponseAcsCredentialExternalType = "brivo_credential" - CredentialsGetResponseAcsCredentialExternalTypeHidCredential CredentialsGetResponseAcsCredentialExternalType = "hid_credential" - CredentialsGetResponseAcsCredentialExternalTypeVisionlineCard CredentialsGetResponseAcsCredentialExternalType = "visionline_card" -) - -func NewCredentialsGetResponseAcsCredentialExternalTypeFromString(s string) (CredentialsGetResponseAcsCredentialExternalType, error) { - switch s { - case "pti_card": - return CredentialsGetResponseAcsCredentialExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsGetResponseAcsCredentialExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsGetResponseAcsCredentialExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsGetResponseAcsCredentialExternalTypeVisionlineCard, nil - } - var t CredentialsGetResponseAcsCredentialExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsGetResponseAcsCredentialExternalType) Ptr() *CredentialsGetResponseAcsCredentialExternalType { - return &c -} - -type CredentialsGetResponseAcsCredentialVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsGetResponseAcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsGetResponseAcsCredentialVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsGetResponseAcsCredentialVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsGetResponseAcsCredentialVisionlineMetadata) 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 CredentialsGetResponseAcsCredentialWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsGetResponseAcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsGetResponseAcsCredentialWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsGetResponseAcsCredentialWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsGetResponseAcsCredentialWarningsItem) 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 CredentialsListResponseAcsCredentialsItem 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 CredentialsListResponseAcsCredentialsItemAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsListResponseAcsCredentialsItemExternalType `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 []*CredentialsListResponseAcsCredentialsItemErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsListResponseAcsCredentialsItemWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsListResponseAcsCredentialsItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsListResponseAcsCredentialsItem) UnmarshalJSON(data []byte) error { - type embed CredentialsListResponseAcsCredentialsItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsListResponseAcsCredentialsItem(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsListResponseAcsCredentialsItem) MarshalJSON() ([]byte, error) { - type embed CredentialsListResponseAcsCredentialsItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsListResponseAcsCredentialsItem) 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 CredentialsListResponseAcsCredentialsItemAccessMethod string +type CredentialsCreateRequestVisionlineMetadataCardFunctionType string const ( - CredentialsListResponseAcsCredentialsItemAccessMethodCode CredentialsListResponseAcsCredentialsItemAccessMethod = "code" - CredentialsListResponseAcsCredentialsItemAccessMethodCard CredentialsListResponseAcsCredentialsItemAccessMethod = "card" - CredentialsListResponseAcsCredentialsItemAccessMethodMobileKey CredentialsListResponseAcsCredentialsItemAccessMethod = "mobile_key" + CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest CredentialsCreateRequestVisionlineMetadataCardFunctionType = "guest" + CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff CredentialsCreateRequestVisionlineMetadataCardFunctionType = "staff" ) -func NewCredentialsListResponseAcsCredentialsItemAccessMethodFromString(s string) (CredentialsListResponseAcsCredentialsItemAccessMethod, error) { +func NewCredentialsCreateRequestVisionlineMetadataCardFunctionTypeFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFunctionType, error) { switch s { - case "code": - return CredentialsListResponseAcsCredentialsItemAccessMethodCode, nil - case "card": - return CredentialsListResponseAcsCredentialsItemAccessMethodCard, nil - case "mobile_key": - return CredentialsListResponseAcsCredentialsItemAccessMethodMobileKey, nil + case "guest": + return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeGuest, nil + case "staff": + return CredentialsCreateRequestVisionlineMetadataCardFunctionTypeStaff, nil } - var t CredentialsListResponseAcsCredentialsItemAccessMethod + var t CredentialsCreateRequestVisionlineMetadataCardFunctionType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c CredentialsListResponseAcsCredentialsItemAccessMethod) Ptr() *CredentialsListResponseAcsCredentialsItemAccessMethod { +func (c CredentialsCreateRequestVisionlineMetadataCardFunctionType) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFunctionType { return &c } - -type CredentialsListResponseAcsCredentialsItemErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsListResponseAcsCredentialsItemErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsListResponseAcsCredentialsItemErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsListResponseAcsCredentialsItemErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsListResponseAcsCredentialsItemErrorsItem) 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 CredentialsListResponseAcsCredentialsItemExternalType string - -const ( - CredentialsListResponseAcsCredentialsItemExternalTypePtiCard CredentialsListResponseAcsCredentialsItemExternalType = "pti_card" - CredentialsListResponseAcsCredentialsItemExternalTypeBrivoCredential CredentialsListResponseAcsCredentialsItemExternalType = "brivo_credential" - CredentialsListResponseAcsCredentialsItemExternalTypeHidCredential CredentialsListResponseAcsCredentialsItemExternalType = "hid_credential" - CredentialsListResponseAcsCredentialsItemExternalTypeVisionlineCard CredentialsListResponseAcsCredentialsItemExternalType = "visionline_card" -) - -func NewCredentialsListResponseAcsCredentialsItemExternalTypeFromString(s string) (CredentialsListResponseAcsCredentialsItemExternalType, error) { - switch s { - case "pti_card": - return CredentialsListResponseAcsCredentialsItemExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsListResponseAcsCredentialsItemExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsListResponseAcsCredentialsItemExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsListResponseAcsCredentialsItemExternalTypeVisionlineCard, nil - } - var t CredentialsListResponseAcsCredentialsItemExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsListResponseAcsCredentialsItemExternalType) Ptr() *CredentialsListResponseAcsCredentialsItemExternalType { - return &c -} - -type CredentialsListResponseAcsCredentialsItemVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsListResponseAcsCredentialsItemVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsListResponseAcsCredentialsItemVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsListResponseAcsCredentialsItemVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsListResponseAcsCredentialsItemVisionlineMetadata) 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 CredentialsListResponseAcsCredentialsItemWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsListResponseAcsCredentialsItemWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsListResponseAcsCredentialsItemWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsListResponseAcsCredentialsItemWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsListResponseAcsCredentialsItemWarningsItem) 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 CredentialsUnassignResponseAcsCredential 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 CredentialsUnassignResponseAcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsUnassignResponseAcsCredentialExternalType `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 []*CredentialsUnassignResponseAcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsUnassignResponseAcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsUnassignResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUnassignResponseAcsCredential) UnmarshalJSON(data []byte) error { - type embed CredentialsUnassignResponseAcsCredential - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsUnassignResponseAcsCredential(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUnassignResponseAcsCredential) MarshalJSON() ([]byte, error) { - type embed CredentialsUnassignResponseAcsCredential - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsUnassignResponseAcsCredential) 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 CredentialsUnassignResponseAcsCredentialAccessMethod string - -const ( - CredentialsUnassignResponseAcsCredentialAccessMethodCode CredentialsUnassignResponseAcsCredentialAccessMethod = "code" - CredentialsUnassignResponseAcsCredentialAccessMethodCard CredentialsUnassignResponseAcsCredentialAccessMethod = "card" - CredentialsUnassignResponseAcsCredentialAccessMethodMobileKey CredentialsUnassignResponseAcsCredentialAccessMethod = "mobile_key" -) - -func NewCredentialsUnassignResponseAcsCredentialAccessMethodFromString(s string) (CredentialsUnassignResponseAcsCredentialAccessMethod, error) { - switch s { - case "code": - return CredentialsUnassignResponseAcsCredentialAccessMethodCode, nil - case "card": - return CredentialsUnassignResponseAcsCredentialAccessMethodCard, nil - case "mobile_key": - return CredentialsUnassignResponseAcsCredentialAccessMethodMobileKey, nil - } - var t CredentialsUnassignResponseAcsCredentialAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsUnassignResponseAcsCredentialAccessMethod) Ptr() *CredentialsUnassignResponseAcsCredentialAccessMethod { - return &c -} - -type CredentialsUnassignResponseAcsCredentialErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUnassignResponseAcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUnassignResponseAcsCredentialErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUnassignResponseAcsCredentialErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUnassignResponseAcsCredentialErrorsItem) 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 CredentialsUnassignResponseAcsCredentialExternalType string - -const ( - CredentialsUnassignResponseAcsCredentialExternalTypePtiCard CredentialsUnassignResponseAcsCredentialExternalType = "pti_card" - CredentialsUnassignResponseAcsCredentialExternalTypeBrivoCredential CredentialsUnassignResponseAcsCredentialExternalType = "brivo_credential" - CredentialsUnassignResponseAcsCredentialExternalTypeHidCredential CredentialsUnassignResponseAcsCredentialExternalType = "hid_credential" - CredentialsUnassignResponseAcsCredentialExternalTypeVisionlineCard CredentialsUnassignResponseAcsCredentialExternalType = "visionline_card" -) - -func NewCredentialsUnassignResponseAcsCredentialExternalTypeFromString(s string) (CredentialsUnassignResponseAcsCredentialExternalType, error) { - switch s { - case "pti_card": - return CredentialsUnassignResponseAcsCredentialExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsUnassignResponseAcsCredentialExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsUnassignResponseAcsCredentialExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsUnassignResponseAcsCredentialExternalTypeVisionlineCard, nil - } - var t CredentialsUnassignResponseAcsCredentialExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsUnassignResponseAcsCredentialExternalType) Ptr() *CredentialsUnassignResponseAcsCredentialExternalType { - return &c -} - -type CredentialsUnassignResponseAcsCredentialVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUnassignResponseAcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUnassignResponseAcsCredentialVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUnassignResponseAcsCredentialVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUnassignResponseAcsCredentialVisionlineMetadata) 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 CredentialsUnassignResponseAcsCredentialWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUnassignResponseAcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUnassignResponseAcsCredentialWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUnassignResponseAcsCredentialWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUnassignResponseAcsCredentialWarningsItem) 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 CredentialsUpdateResponseAcsCredential 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 CredentialsUpdateResponseAcsCredentialAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *CredentialsUpdateResponseAcsCredentialExternalType `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 []*CredentialsUpdateResponseAcsCredentialErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*CredentialsUpdateResponseAcsCredentialWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *CredentialsUpdateResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUpdateResponseAcsCredential) UnmarshalJSON(data []byte) error { - type embed CredentialsUpdateResponseAcsCredential - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = CredentialsUpdateResponseAcsCredential(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUpdateResponseAcsCredential) MarshalJSON() ([]byte, error) { - type embed CredentialsUpdateResponseAcsCredential - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: core.NewDateTime(c.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (c *CredentialsUpdateResponseAcsCredential) 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 CredentialsUpdateResponseAcsCredentialAccessMethod string - -const ( - CredentialsUpdateResponseAcsCredentialAccessMethodCode CredentialsUpdateResponseAcsCredentialAccessMethod = "code" - CredentialsUpdateResponseAcsCredentialAccessMethodCard CredentialsUpdateResponseAcsCredentialAccessMethod = "card" - CredentialsUpdateResponseAcsCredentialAccessMethodMobileKey CredentialsUpdateResponseAcsCredentialAccessMethod = "mobile_key" -) - -func NewCredentialsUpdateResponseAcsCredentialAccessMethodFromString(s string) (CredentialsUpdateResponseAcsCredentialAccessMethod, error) { - switch s { - case "code": - return CredentialsUpdateResponseAcsCredentialAccessMethodCode, nil - case "card": - return CredentialsUpdateResponseAcsCredentialAccessMethodCard, nil - case "mobile_key": - return CredentialsUpdateResponseAcsCredentialAccessMethodMobileKey, nil - } - var t CredentialsUpdateResponseAcsCredentialAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsUpdateResponseAcsCredentialAccessMethod) Ptr() *CredentialsUpdateResponseAcsCredentialAccessMethod { - return &c -} - -type CredentialsUpdateResponseAcsCredentialErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUpdateResponseAcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUpdateResponseAcsCredentialErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUpdateResponseAcsCredentialErrorsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUpdateResponseAcsCredentialErrorsItem) 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 CredentialsUpdateResponseAcsCredentialExternalType string - -const ( - CredentialsUpdateResponseAcsCredentialExternalTypePtiCard CredentialsUpdateResponseAcsCredentialExternalType = "pti_card" - CredentialsUpdateResponseAcsCredentialExternalTypeBrivoCredential CredentialsUpdateResponseAcsCredentialExternalType = "brivo_credential" - CredentialsUpdateResponseAcsCredentialExternalTypeHidCredential CredentialsUpdateResponseAcsCredentialExternalType = "hid_credential" - CredentialsUpdateResponseAcsCredentialExternalTypeVisionlineCard CredentialsUpdateResponseAcsCredentialExternalType = "visionline_card" -) - -func NewCredentialsUpdateResponseAcsCredentialExternalTypeFromString(s string) (CredentialsUpdateResponseAcsCredentialExternalType, error) { - switch s { - case "pti_card": - return CredentialsUpdateResponseAcsCredentialExternalTypePtiCard, nil - case "brivo_credential": - return CredentialsUpdateResponseAcsCredentialExternalTypeBrivoCredential, nil - case "hid_credential": - return CredentialsUpdateResponseAcsCredentialExternalTypeHidCredential, nil - case "visionline_card": - return CredentialsUpdateResponseAcsCredentialExternalTypeVisionlineCard, nil - } - var t CredentialsUpdateResponseAcsCredentialExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsUpdateResponseAcsCredentialExternalType) Ptr() *CredentialsUpdateResponseAcsCredentialExternalType { - return &c -} - -type CredentialsUpdateResponseAcsCredentialVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUpdateResponseAcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUpdateResponseAcsCredentialVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUpdateResponseAcsCredentialVisionlineMetadata(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUpdateResponseAcsCredentialVisionlineMetadata) 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 CredentialsUpdateResponseAcsCredentialWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (c *CredentialsUpdateResponseAcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler CredentialsUpdateResponseAcsCredentialWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CredentialsUpdateResponseAcsCredentialWarningsItem(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *CredentialsUpdateResponseAcsCredentialWarningsItem) 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 EntrancesGetResponseAcsEntrance 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"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - LatchMetadata *EntrancesGetResponseAcsEntranceLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` - VisionlineMetadata *EntrancesGetResponseAcsEntranceVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesGetResponseAcsEntrance) UnmarshalJSON(data []byte) error { - type embed EntrancesGetResponseAcsEntrance - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *e = EntrancesGetResponseAcsEntrance(unmarshaler.embed) - e.CreatedAt = unmarshaler.CreatedAt.Time() - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesGetResponseAcsEntrance) MarshalJSON() ([]byte, error) { - type embed EntrancesGetResponseAcsEntrance - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (e *EntrancesGetResponseAcsEntrance) 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 EntrancesGetResponseAcsEntranceLatchMetadata struct { - AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` - Name string `json:"name" url:"name"` - Type string `json:"type" url:"type"` - IsConnected bool `json:"is_connected" url:"is_connected"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesGetResponseAcsEntranceLatchMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesGetResponseAcsEntranceLatchMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesGetResponseAcsEntranceLatchMetadata(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesGetResponseAcsEntranceLatchMetadata) String() string { - if len(e._rawJSON) > 0 { - if value, err := core.StringifyJSON(e._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(e); err == nil { - return value - } - return fmt.Sprintf("%#v", e) -} - -type EntrancesGetResponseAcsEntranceVisionlineMetadata struct { - DoorName string `json:"door_name" url:"door_name"` - DoorCategory EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` - Profiles []*EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem `json:"profiles,omitempty" url:"profiles,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesGetResponseAcsEntranceVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesGetResponseAcsEntranceVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesGetResponseAcsEntranceVisionlineMetadata(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesGetResponseAcsEntranceVisionlineMetadata) 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 EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory string - -const ( - EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryEntrance EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory = "entrance" - EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryGuest EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory = "guest" - EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryElevatorReader EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory = "elevator reader" - EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryCommon EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory = "common" - EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryCommonPms EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory = "common (PMS)" -) - -func NewEntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryFromString(s string) (EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory, error) { - switch s { - case "entrance": - return EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryEntrance, nil - case "guest": - return EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryGuest, nil - case "elevator reader": - return EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryElevatorReader, nil - case "common": - return EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryCommon, nil - case "common (PMS)": - return EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategoryCommonPms, nil - } - var t EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory) Ptr() *EntrancesGetResponseAcsEntranceVisionlineMetadataDoorCategory { - return &e -} - -type EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem struct { - VisionlineDoorProfileId string `json:"visionline_door_profile_id" url:"visionline_door_profile_id"` - VisionlineDoorProfileType EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType `json:"visionline_door_profile_type,omitempty" url:"visionline_door_profile_type,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItem) 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 EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType string - -const ( - EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "BLE" - EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "commonDoor" - EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "touch" -) - -func NewEntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeFromString(s string) (EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType, error) { - switch s { - case "BLE": - return EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle, nil - case "commonDoor": - return EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor, nil - case "touch": - return EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch, nil - } - var t EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType) Ptr() *EntrancesGetResponseAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType { - return &e -} - -type EntrancesListCredentialsWithAccessResponseAcsCredentialsItem 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 EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod `json:"access_method,omitempty" url:"access_method,omitempty"` - ExternalType *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType `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 []*EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` - Warnings []*EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty" url:"is_multi_phone_sync_credential,omitempty"` - VisionlineMetadata *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItem) UnmarshalJSON(data []byte) error { - type embed EntrancesListCredentialsWithAccessResponseAcsCredentialsItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *e = EntrancesListCredentialsWithAccessResponseAcsCredentialsItem(unmarshaler.embed) - e.CreatedAt = unmarshaler.CreatedAt.Time() - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItem) MarshalJSON() ([]byte, error) { - type embed EntrancesListCredentialsWithAccessResponseAcsCredentialsItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItem) 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 EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod string - -const ( - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodCode EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod = "code" - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodCard EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod = "card" - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodMobileKey EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod = "mobile_key" -) - -func NewEntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodFromString(s string) (EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod, error) { - switch s { - case "code": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodCode, nil - case "card": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodCard, nil - case "mobile_key": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethodMobileKey, nil - } - var t EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod) Ptr() *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod { - return &e -} - -type EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem struct { - ErrorCode string `json:"error_code" url:"error_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem) 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 EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType string - -const ( - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypePtiCard EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType = "pti_card" - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeBrivoCredential EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType = "brivo_credential" - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeHidCredential EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType = "hid_credential" - EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeVisionlineCard EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType = "visionline_card" -) - -func NewEntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeFromString(s string) (EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType, error) { - switch s { - case "pti_card": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypePtiCard, nil - case "brivo_credential": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeBrivoCredential, nil - case "hid_credential": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeHidCredential, nil - case "visionline_card": - return EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalTypeVisionlineCard, nil - } - var t EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType) Ptr() *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType { - return &e -} - -type EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata struct { - JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` - GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` - CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata) 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 EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem struct { - WarningCode string `json:"warning_code" url:"warning_code"` - Message string `json:"message" url:"message"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem) 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 EntrancesListResponseAcsEntrancesItem 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"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - LatchMetadata *EntrancesListResponseAcsEntrancesItemLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` - VisionlineMetadata *EntrancesListResponseAcsEntrancesItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListResponseAcsEntrancesItem) UnmarshalJSON(data []byte) error { - type embed EntrancesListResponseAcsEntrancesItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *e = EntrancesListResponseAcsEntrancesItem(unmarshaler.embed) - e.CreatedAt = unmarshaler.CreatedAt.Time() - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListResponseAcsEntrancesItem) MarshalJSON() ([]byte, error) { - type embed EntrancesListResponseAcsEntrancesItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*e), - CreatedAt: core.NewDateTime(e.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (e *EntrancesListResponseAcsEntrancesItem) 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 EntrancesListResponseAcsEntrancesItemLatchMetadata struct { - AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` - Name string `json:"name" url:"name"` - Type string `json:"type" url:"type"` - IsConnected bool `json:"is_connected" url:"is_connected"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListResponseAcsEntrancesItemLatchMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListResponseAcsEntrancesItemLatchMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListResponseAcsEntrancesItemLatchMetadata(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListResponseAcsEntrancesItemLatchMetadata) String() string { - if len(e._rawJSON) > 0 { - if value, err := core.StringifyJSON(e._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(e); err == nil { - return value - } - return fmt.Sprintf("%#v", e) -} - -type EntrancesListResponseAcsEntrancesItemVisionlineMetadata struct { - DoorName string `json:"door_name" url:"door_name"` - DoorCategory EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` - Profiles []*EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem `json:"profiles,omitempty" url:"profiles,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListResponseAcsEntrancesItemVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListResponseAcsEntrancesItemVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListResponseAcsEntrancesItemVisionlineMetadata(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListResponseAcsEntrancesItemVisionlineMetadata) 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 EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory string - -const ( - EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryEntrance EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "entrance" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryGuest EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "guest" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryElevatorReader EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "elevator reader" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommon EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "common" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommonPms EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "common (PMS)" -) - -func NewEntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryFromString(s string) (EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory, error) { - switch s { - case "entrance": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryEntrance, nil - case "guest": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryGuest, nil - case "elevator reader": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryElevatorReader, nil - case "common": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommon, nil - case "common (PMS)": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommonPms, nil - } - var t EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory) Ptr() *EntrancesListResponseAcsEntrancesItemVisionlineMetadataDoorCategory { - return &e -} - -type EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem struct { - VisionlineDoorProfileId string `json:"visionline_door_profile_id" url:"visionline_door_profile_id"` - VisionlineDoorProfileType EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType `json:"visionline_door_profile_type,omitempty" url:"visionline_door_profile_type,omitempty"` - - _rawJSON json.RawMessage -} - -func (e *EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem) UnmarshalJSON(data []byte) error { - type unmarshaler EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *e = EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem(value) - e._rawJSON = json.RawMessage(data) - return nil -} - -func (e *EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItem) 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 EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType string - -const ( - EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "BLE" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "commonDoor" - EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "touch" -) - -func NewEntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeFromString(s string) (EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType, error) { - switch s { - case "BLE": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle, nil - case "commonDoor": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor, nil - case "touch": - return EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch, nil - } - var t EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (e EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType) Ptr() *EntrancesListResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType { - return &e -} - -type UsersListAccessibleEntrancesResponseAcsEntrancesItem 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"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - LatchMetadata *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` - VisionlineMetadata *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` - - _rawJSON json.RawMessage -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItem) UnmarshalJSON(data []byte) error { - type embed UsersListAccessibleEntrancesResponseAcsEntrancesItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UsersListAccessibleEntrancesResponseAcsEntrancesItem(unmarshaler.embed) - u.CreatedAt = unmarshaler.CreatedAt.Time() - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItem) MarshalJSON() ([]byte, error) { - type embed UsersListAccessibleEntrancesResponseAcsEntrancesItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - CreatedAt: core.NewDateTime(u.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItem) 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 UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata struct { - AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` - Name string `json:"name" url:"name"` - Type string `json:"type" url:"type"` - IsConnected bool `json:"is_connected" url:"is_connected"` - - _rawJSON json.RawMessage -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *u = UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata(value) - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemLatchMetadata) String() string { - if len(u._rawJSON) > 0 { - if value, err := core.StringifyJSON(u._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(u); err == nil { - return value - } - return fmt.Sprintf("%#v", u) -} - -type UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata struct { - DoorName string `json:"door_name" url:"door_name"` - DoorCategory UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` - Profiles []*UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem `json:"profiles,omitempty" url:"profiles,omitempty"` - - _rawJSON json.RawMessage -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *u = UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata(value) - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadata) 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 UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory string - -const ( - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryEntrance UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "entrance" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryGuest UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "guest" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryElevatorReader UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "elevator reader" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommon UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "common" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommonPms UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory = "common (PMS)" -) - -func NewUsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryFromString(s string) (UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory, error) { - switch s { - case "entrance": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryEntrance, nil - case "guest": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryGuest, nil - case "elevator reader": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryElevatorReader, nil - case "common": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommon, nil - case "common (PMS)": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategoryCommonPms, nil - } - var t UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (u UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory) Ptr() *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataDoorCategory { - return &u -} - -type UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem struct { - VisionlineDoorProfileId string `json:"visionline_door_profile_id" url:"visionline_door_profile_id"` - VisionlineDoorProfileType UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType `json:"visionline_door_profile_type,omitempty" url:"visionline_door_profile_type,omitempty"` - - _rawJSON json.RawMessage -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem) UnmarshalJSON(data []byte) error { - type unmarshaler UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *u = UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem(value) - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItem) 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 UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType string - -const ( - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "BLE" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "commonDoor" - UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType = "touch" -) - -func NewUsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeFromString(s string) (UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType, error) { - switch s { - case "BLE": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle, nil - case "commonDoor": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor, nil - case "touch": - return UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch, nil - } - var t UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (u UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType) Ptr() *UsersListAccessibleEntrancesResponseAcsEntrancesItemVisionlineMetadataProfilesItemVisionlineDoorProfileType { - return &u -} diff --git a/acs/users.go b/acs/users.go index 6262582..fef6779 100644 --- a/acs/users.go +++ b/acs/users.go @@ -232,8 +232,8 @@ func (u *UsersGetResponse) String() string { } type UsersListAccessibleEntrancesResponse struct { - AcsEntrances []*UsersListAccessibleEntrancesResponseAcsEntrancesItem `json:"acs_entrances,omitempty" url:"acs_entrances,omitempty"` - Ok bool `json:"ok" url:"ok"` + AcsEntrances []*seamapigo.AcsEntrance `json:"acs_entrances,omitempty" url:"acs_entrances,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/acs/users/client.go b/acs/users/client.go index c058ef9..96364a9 100644 --- a/acs/users/client.go +++ b/acs/users/client.go @@ -102,7 +102,7 @@ func (c *Client) Create( ctx context.Context, request *acs.UsersCreateRequest, opts ...option.RequestOption, -) (*acs.UsersCreateResponse, error) { +) (*seamapigo.AcsUser, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,7 +158,7 @@ func (c *Client) Create( ); err != nil { return nil, err } - return response, nil + return response.AcsUser, nil } func (c *Client) Delete( @@ -228,7 +228,7 @@ func (c *Client) Get( ctx context.Context, request *acs.UsersGetRequest, opts ...option.RequestOption, -) (*acs.UsersGetResponse, error) { +) (*seamapigo.AcsUser, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -284,14 +284,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.AcsUser, nil } func (c *Client) List( ctx context.Context, request *acs.UsersListRequest, opts ...option.RequestOption, -) (*acs.UsersListResponse, error) { +) ([]*seamapigo.AcsUser, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -347,14 +347,14 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.AcsUsers, nil } func (c *Client) ListAccessibleEntrances( ctx context.Context, request *acs.UsersListAccessibleEntrancesRequest, opts ...option.RequestOption, -) (*acs.UsersListAccessibleEntrancesResponse, error) { +) ([]*seamapigo.AcsEntrance, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -410,7 +410,7 @@ func (c *Client) ListAccessibleEntrances( ); err != nil { return nil, err } - return response, nil + return response.AcsEntrances, nil } func (c *Client) RemoveFromAccessGroup( diff --git a/client/client.go b/client/client.go index fc73f8b..cd1df68 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,6 @@ import ( core "github.com/seamapi/go/core" devicesclient "github.com/seamapi/go/devices/client" events "github.com/seamapi/go/events" - healthclient "github.com/seamapi/go/health/client" locks "github.com/seamapi/go/locks" networks "github.com/seamapi/go/networks" noisesensorsclient "github.com/seamapi/go/noisesensors/client" @@ -37,7 +36,6 @@ type Client struct { ConnectedAccounts *connectedaccounts.Client Devices *devicesclient.Client Events *events.Client - Health *healthclient.Client Locks *locks.Client Networks *networks.Client Phones *phonesclient.Client @@ -67,7 +65,6 @@ func NewClient(opts ...option.RequestOption) *Client { ConnectedAccounts: connectedaccounts.NewClient(opts...), Devices: devicesclient.NewClient(opts...), Events: events.NewClient(opts...), - Health: healthclient.NewClient(opts...), Locks: locks.NewClient(opts...), Networks: networks.NewClient(opts...), Phones: phonesclient.NewClient(opts...), diff --git a/client/options.go b/client/options.go index 51904e2..c187f09 100644 --- a/client/options.go +++ b/client/options.go @@ -29,16 +29,11 @@ func WithMaxAttempts(attempts uint) *core.MaxAttemptsOption { return option.WithMaxAttempts(attempts) } -// WithApiKey sets the 'Authorization: Bearer ' request header. +// WithApiKey sets the apiKey auth request header. func WithApiKey(apiKey string) *core.ApiKeyOption { return option.WithApiKey(apiKey) } -// WithSeamWorkspace sets the seamWorkspace request header. -func WithSeamWorkspace(seamWorkspace string) *core.SeamWorkspaceOption { - return option.WithSeamWorkspace(seamWorkspace) -} - // WithSeamClientSessionToken sets the seamClientSessionToken request header. func WithSeamClientSessionToken(seamClientSessionToken string) *core.SeamClientSessionTokenOption { return option.WithSeamClientSessionToken(seamClientSessionToken) diff --git a/connect_webviews.go b/connect_webviews.go index 6dbd0e7..8fae3bc 100644 --- a/connect_webviews.go +++ b/connect_webviews.go @@ -332,10 +332,9 @@ func (c *ConnectWebviewsGetResponse) String() string { } type ConnectWebviewsListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectWebviewsListRequestCustomMetadataHasValueFromString(value string) *ConnectWebviewsListRequestCustomMetadataHasValue { @@ -346,10 +345,6 @@ func NewConnectWebviewsListRequestCustomMetadataHasValueFromBoolean(value bool) return &ConnectWebviewsListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewConnectWebviewsListRequestCustomMetadataHasValueFromStringOptional(value *string) *ConnectWebviewsListRequestCustomMetadataHasValue { - return &ConnectWebviewsListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectWebviewsListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -363,12 +358,6 @@ func (c *ConnectWebviewsListRequestCustomMetadataHasValue) 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) } @@ -380,15 +369,12 @@ func (c ConnectWebviewsListRequestCustomMetadataHasValue) MarshalJSON() ([]byte, return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectWebviewsListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectWebviewsListRequestCustomMetadataHasValue) Accept(visitor ConnectWebviewsListRequestCustomMetadataHasValueVisitor) error { @@ -399,8 +385,6 @@ func (c *ConnectWebviewsListRequestCustomMetadataHasValue) Accept(visitor Connec return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } @@ -433,8 +417,3 @@ func (c *ConnectWebviewsListResponse) String() string { } return fmt.Sprintf("%#v", c) } - -type ConnectWebviewsViewRequest struct { - ConnectWebviewId string `json:"-" url:"connect_webview_id"` - AuthToken string `json:"-" url:"auth_token"` -} diff --git a/connected_accounts.go b/connected_accounts.go index 1cfdff8..c80456a 100644 --- a/connected_accounts.go +++ b/connected_accounts.go @@ -135,10 +135,9 @@ func (c *ConnectedAccountsGetResponse) String() string { } type ConnectedAccountsListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectedAccountsListRequestCustomMetadataHasValueFromString(value string) *ConnectedAccountsListRequestCustomMetadataHasValue { @@ -149,10 +148,6 @@ func NewConnectedAccountsListRequestCustomMetadataHasValueFromBoolean(value bool return &ConnectedAccountsListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewConnectedAccountsListRequestCustomMetadataHasValueFromStringOptional(value *string) *ConnectedAccountsListRequestCustomMetadataHasValue { - return &ConnectedAccountsListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectedAccountsListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -166,12 +161,6 @@ func (c *ConnectedAccountsListRequestCustomMetadataHasValue) 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) } @@ -183,15 +172,12 @@ func (c ConnectedAccountsListRequestCustomMetadataHasValue) MarshalJSON() ([]byt return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectedAccountsListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectedAccountsListRequestCustomMetadataHasValue) Accept(visitor ConnectedAccountsListRequestCustomMetadataHasValueVisitor) error { @@ -202,8 +188,6 @@ func (c *ConnectedAccountsListRequestCustomMetadataHasValue) Accept(visitor Conn return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } diff --git a/connectwebviews/client.go b/connectwebviews/client.go index 94fc55f..5e7e658 100644 --- a/connectwebviews/client.go +++ b/connectwebviews/client.go @@ -285,71 +285,3 @@ func (c *Client) List( } return response.ConnectWebviews, nil } - -func (c *Client) View( - ctx context.Context, - request *seamapigo.ConnectWebviewsViewRequest, - opts ...option.RequestOption, -) error { - options := core.NewRequestOptions(opts...) - - baseURL := "https://connect.getseam.com" - if c.baseURL != "" { - baseURL = c.baseURL - } - if options.BaseURL != "" { - baseURL = options.BaseURL - } - endpointURL := baseURL + "/" + "connect_webviews/view" - - queryParams, err := core.QueryValues(request) - if err != nil { - return err - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - 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 - } - - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - MaxAttempts: options.MaxAttempts, - Headers: headers, - Client: options.HTTPClient, - ErrorDecoder: errorDecoder, - }, - ); err != nil { - return err - } - return nil -} diff --git a/core/request_option.go b/core/request_option.go index d1bd58f..41e7f81 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -22,7 +22,6 @@ type RequestOptions struct { HTTPHeader http.Header MaxAttempts uint ApiKey string - SeamWorkspace string SeamClientSessionToken string ClientSessionToken string } @@ -45,10 +44,7 @@ func NewRequestOptions(opts ...RequestOption) *RequestOptions { // for the request(s). func (r *RequestOptions) ToHeader() http.Header { header := r.cloneHeader() - if r.ApiKey != "" { - header.Set("Authorization", "Bearer "+r.ApiKey) - } - header.Set("seam-workspace", fmt.Sprintf("%v", r.SeamWorkspace)) + header.Set("seam-workspace", fmt.Sprintf("%v", r.ApiKey)) header.Set("seam-client-session-token", fmt.Sprintf("%v", r.SeamClientSessionToken)) header.Set("client-session-token", fmt.Sprintf("%v", r.ClientSessionToken)) return header @@ -58,7 +54,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.0") + headers.Set("X-Fern-SDK-Version", "v0.3.1") return headers } @@ -107,15 +103,6 @@ func (a *ApiKeyOption) applyRequestOptions(opts *RequestOptions) { opts.ApiKey = a.ApiKey } -// SeamWorkspaceOption implements the RequestOption interface. -type SeamWorkspaceOption struct { - SeamWorkspace string -} - -func (s *SeamWorkspaceOption) applyRequestOptions(opts *RequestOptions) { - opts.SeamWorkspace = s.SeamWorkspace -} - // SeamClientSessionTokenOption implements the RequestOption interface. type SeamClientSessionTokenOption struct { SeamClientSessionToken string diff --git a/devices.go b/devices.go index 3c609bb..be5016d 100644 --- a/devices.go +++ b/devices.go @@ -151,10 +151,9 @@ func (d *DevicesListDeviceProvidersResponse) String() string { } type DevicesListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewDevicesListRequestCustomMetadataHasValueFromString(value string) *DevicesListRequestCustomMetadataHasValue { @@ -165,10 +164,6 @@ func NewDevicesListRequestCustomMetadataHasValueFromBoolean(value bool) *Devices return &DevicesListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewDevicesListRequestCustomMetadataHasValueFromStringOptional(value *string) *DevicesListRequestCustomMetadataHasValue { - return &DevicesListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (d *DevicesListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -182,12 +177,6 @@ func (d *DevicesListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) er 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) } @@ -199,15 +188,12 @@ func (d DevicesListRequestCustomMetadataHasValue) MarshalJSON() ([]byte, error) return json.Marshal(d.String) case "boolean": return json.Marshal(d.Boolean) - case "stringOptional": - return json.Marshal(d.StringOptional) } } type DevicesListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (d *DevicesListRequestCustomMetadataHasValue) Accept(visitor DevicesListRequestCustomMetadataHasValueVisitor) error { @@ -218,18 +204,17 @@ func (d *DevicesListRequestCustomMetadataHasValue) Accept(visitor DevicesListReq return visitor.VisitString(d.String) case "boolean": return visitor.VisitBoolean(d.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(d.StringOptional) } } type DevicesListRequestExcludeIfItem string const ( - DevicesListRequestExcludeIfItemCanRemotelyUnlock DevicesListRequestExcludeIfItem = "can_remotely_unlock" - DevicesListRequestExcludeIfItemCanRemotelyLock DevicesListRequestExcludeIfItem = "can_remotely_lock" - DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes DevicesListRequestExcludeIfItem = "can_program_online_access_codes" - DevicesListRequestExcludeIfItemCanSimulateRemoval DevicesListRequestExcludeIfItem = "can_simulate_removal" + DevicesListRequestExcludeIfItemCanRemotelyUnlock DevicesListRequestExcludeIfItem = "can_remotely_unlock" + DevicesListRequestExcludeIfItemCanRemotelyLock DevicesListRequestExcludeIfItem = "can_remotely_lock" + DevicesListRequestExcludeIfItemCanProgramOfflineAccessCodes DevicesListRequestExcludeIfItem = "can_program_offline_access_codes" + DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes DevicesListRequestExcludeIfItem = "can_program_online_access_codes" + DevicesListRequestExcludeIfItemCanSimulateRemoval DevicesListRequestExcludeIfItem = "can_simulate_removal" ) func NewDevicesListRequestExcludeIfItemFromString(s string) (DevicesListRequestExcludeIfItem, error) { @@ -238,6 +223,8 @@ func NewDevicesListRequestExcludeIfItemFromString(s string) (DevicesListRequestE return DevicesListRequestExcludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return DevicesListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return DevicesListRequestExcludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return DevicesListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": @@ -254,10 +241,11 @@ func (d DevicesListRequestExcludeIfItem) Ptr() *DevicesListRequestExcludeIfItem type DevicesListRequestIncludeIfItem string const ( - DevicesListRequestIncludeIfItemCanRemotelyUnlock DevicesListRequestIncludeIfItem = "can_remotely_unlock" - DevicesListRequestIncludeIfItemCanRemotelyLock DevicesListRequestIncludeIfItem = "can_remotely_lock" - DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes DevicesListRequestIncludeIfItem = "can_program_online_access_codes" - DevicesListRequestIncludeIfItemCanSimulateRemoval DevicesListRequestIncludeIfItem = "can_simulate_removal" + DevicesListRequestIncludeIfItemCanRemotelyUnlock DevicesListRequestIncludeIfItem = "can_remotely_unlock" + DevicesListRequestIncludeIfItemCanRemotelyLock DevicesListRequestIncludeIfItem = "can_remotely_lock" + DevicesListRequestIncludeIfItemCanProgramOfflineAccessCodes DevicesListRequestIncludeIfItem = "can_program_offline_access_codes" + DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes DevicesListRequestIncludeIfItem = "can_program_online_access_codes" + DevicesListRequestIncludeIfItemCanSimulateRemoval DevicesListRequestIncludeIfItem = "can_simulate_removal" ) func NewDevicesListRequestIncludeIfItemFromString(s string) (DevicesListRequestIncludeIfItem, error) { @@ -266,6 +254,8 @@ func NewDevicesListRequestIncludeIfItemFromString(s string) (DevicesListRequestI return DevicesListRequestIncludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return DevicesListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return DevicesListRequestIncludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return DevicesListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": diff --git a/devices/unmanaged.go b/devices/unmanaged.go index 375db9c..67b8e46 100644 --- a/devices/unmanaged.go +++ b/devices/unmanaged.go @@ -85,10 +85,9 @@ func (u *UnmanagedGetResponse) String() string { } type UnmanagedListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewUnmanagedListRequestCustomMetadataHasValueFromString(value string) *UnmanagedListRequestCustomMetadataHasValue { @@ -99,10 +98,6 @@ func NewUnmanagedListRequestCustomMetadataHasValueFromBoolean(value bool) *Unman return &UnmanagedListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewUnmanagedListRequestCustomMetadataHasValueFromStringOptional(value *string) *UnmanagedListRequestCustomMetadataHasValue { - return &UnmanagedListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (u *UnmanagedListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -116,12 +111,6 @@ func (u *UnmanagedListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) u.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - u.typeName = "stringOptional" - u.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, u) } @@ -133,15 +122,12 @@ func (u UnmanagedListRequestCustomMetadataHasValue) MarshalJSON() ([]byte, error return json.Marshal(u.String) case "boolean": return json.Marshal(u.Boolean) - case "stringOptional": - return json.Marshal(u.StringOptional) } } type UnmanagedListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (u *UnmanagedListRequestCustomMetadataHasValue) Accept(visitor UnmanagedListRequestCustomMetadataHasValueVisitor) error { @@ -152,18 +138,17 @@ func (u *UnmanagedListRequestCustomMetadataHasValue) Accept(visitor UnmanagedLis return visitor.VisitString(u.String) case "boolean": return visitor.VisitBoolean(u.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(u.StringOptional) } } type UnmanagedListRequestExcludeIfItem string const ( - UnmanagedListRequestExcludeIfItemCanRemotelyUnlock UnmanagedListRequestExcludeIfItem = "can_remotely_unlock" - UnmanagedListRequestExcludeIfItemCanRemotelyLock UnmanagedListRequestExcludeIfItem = "can_remotely_lock" - UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_online_access_codes" - UnmanagedListRequestExcludeIfItemCanSimulateRemoval UnmanagedListRequestExcludeIfItem = "can_simulate_removal" + UnmanagedListRequestExcludeIfItemCanRemotelyUnlock UnmanagedListRequestExcludeIfItem = "can_remotely_unlock" + UnmanagedListRequestExcludeIfItemCanRemotelyLock UnmanagedListRequestExcludeIfItem = "can_remotely_lock" + UnmanagedListRequestExcludeIfItemCanProgramOfflineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_offline_access_codes" + UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestExcludeIfItem = "can_program_online_access_codes" + UnmanagedListRequestExcludeIfItemCanSimulateRemoval UnmanagedListRequestExcludeIfItem = "can_simulate_removal" ) func NewUnmanagedListRequestExcludeIfItemFromString(s string) (UnmanagedListRequestExcludeIfItem, error) { @@ -172,6 +157,8 @@ func NewUnmanagedListRequestExcludeIfItemFromString(s string) (UnmanagedListRequ return UnmanagedListRequestExcludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return UnmanagedListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return UnmanagedListRequestExcludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return UnmanagedListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": @@ -188,10 +175,11 @@ func (u UnmanagedListRequestExcludeIfItem) Ptr() *UnmanagedListRequestExcludeIfI type UnmanagedListRequestIncludeIfItem string const ( - UnmanagedListRequestIncludeIfItemCanRemotelyUnlock UnmanagedListRequestIncludeIfItem = "can_remotely_unlock" - UnmanagedListRequestIncludeIfItemCanRemotelyLock UnmanagedListRequestIncludeIfItem = "can_remotely_lock" - UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_online_access_codes" - UnmanagedListRequestIncludeIfItemCanSimulateRemoval UnmanagedListRequestIncludeIfItem = "can_simulate_removal" + UnmanagedListRequestIncludeIfItemCanRemotelyUnlock UnmanagedListRequestIncludeIfItem = "can_remotely_unlock" + UnmanagedListRequestIncludeIfItemCanRemotelyLock UnmanagedListRequestIncludeIfItem = "can_remotely_lock" + UnmanagedListRequestIncludeIfItemCanProgramOfflineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_offline_access_codes" + UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes UnmanagedListRequestIncludeIfItem = "can_program_online_access_codes" + UnmanagedListRequestIncludeIfItemCanSimulateRemoval UnmanagedListRequestIncludeIfItem = "can_simulate_removal" ) func NewUnmanagedListRequestIncludeIfItemFromString(s string) (UnmanagedListRequestIncludeIfItem, error) { @@ -200,6 +188,8 @@ func NewUnmanagedListRequestIncludeIfItemFromString(s string) (UnmanagedListRequ return UnmanagedListRequestIncludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return UnmanagedListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return UnmanagedListRequestIncludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return UnmanagedListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": diff --git a/health.go b/health.go deleted file mode 100644 index f9a1d39..0000000 --- a/health.go +++ /dev/null @@ -1,97 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package api - -import ( - json "encoding/json" - fmt "fmt" - core "github.com/seamapi/go/core" -) - -type HealthGetServiceHealthRequest struct { - Service string `json:"service" url:"service"` -} - -type HealthGetHealthResponse struct { - Ok bool `json:"ok" url:"ok"` - LastServiceEvaluationAt *string `json:"last_service_evaluation_at,omitempty" url:"last_service_evaluation_at,omitempty"` - ServiceHealthStatuses []*ServiceHealth `json:"service_health_statuses,omitempty" url:"service_health_statuses,omitempty"` - msg string - - _rawJSON json.RawMessage -} - -func (h *HealthGetHealthResponse) Msg() string { - return h.msg -} - -func (h *HealthGetHealthResponse) UnmarshalJSON(data []byte) error { - type embed HealthGetHealthResponse - var unmarshaler = struct { - embed - }{ - embed: embed(*h), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *h = HealthGetHealthResponse(unmarshaler.embed) - h.msg = "I’m one with the Force. The Force is with me." - h._rawJSON = json.RawMessage(data) - return nil -} - -func (h *HealthGetHealthResponse) MarshalJSON() ([]byte, error) { - type embed HealthGetHealthResponse - var marshaler = struct { - embed - Msg string `json:"msg"` - }{ - embed: embed(*h), - Msg: "I’m one with the Force. The Force is with me.", - } - return json.Marshal(marshaler) -} - -func (h *HealthGetHealthResponse) String() string { - if len(h._rawJSON) > 0 { - if value, err := core.StringifyJSON(h._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(h); err == nil { - return value - } - return fmt.Sprintf("%#v", h) -} - -type HealthGetServiceHealthResponse struct { - Ok bool `json:"ok" url:"ok"` - LastServiceEvaluationAt string `json:"last_service_evaluation_at" url:"last_service_evaluation_at"` - ServiceHealth *ServiceHealth `json:"service_health,omitempty" url:"service_health,omitempty"` - - _rawJSON json.RawMessage -} - -func (h *HealthGetServiceHealthResponse) UnmarshalJSON(data []byte) error { - type unmarshaler HealthGetServiceHealthResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *h = HealthGetServiceHealthResponse(value) - h._rawJSON = json.RawMessage(data) - return nil -} - -func (h *HealthGetServiceHealthResponse) String() string { - if len(h._rawJSON) > 0 { - if value, err := core.StringifyJSON(h._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(h); err == nil { - return value - } - return fmt.Sprintf("%#v", h) -} diff --git a/health/client/client.go b/health/client/client.go deleted file mode 100644 index 669c050..0000000 --- a/health/client/client.go +++ /dev/null @@ -1,163 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package client - -import ( - bytes "bytes" - context "context" - json "encoding/json" - errors "errors" - seamapigo "github.com/seamapi/go" - core "github.com/seamapi/go/core" - service "github.com/seamapi/go/health/service" - option "github.com/seamapi/go/option" - io "io" - http "net/http" -) - -type Client struct { - baseURL string - caller *core.Caller - header http.Header - - Service *service.Client -} - -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) - return &Client{ - baseURL: options.BaseURL, - caller: core.NewCaller( - &core.CallerParams{ - Client: options.HTTPClient, - MaxAttempts: options.MaxAttempts, - }, - ), - header: options.ToHeader(), - Service: service.NewClient(opts...), - } -} - -func (c *Client) GetHealth( - ctx context.Context, - opts ...option.RequestOption, -) (*seamapigo.HealthGetHealthResponse, error) { - options := core.NewRequestOptions(opts...) - - baseURL := "https://connect.getseam.com" - if c.baseURL != "" { - baseURL = c.baseURL - } - if options.BaseURL != "" { - baseURL = options.BaseURL - } - endpointURL := baseURL + "/" + "health/get_health" - - 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 *seamapigo.HealthGetHealthResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - MaxAttempts: options.MaxAttempts, - Headers: headers, - Client: options.HTTPClient, - Response: &response, - ErrorDecoder: errorDecoder, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -func (c *Client) GetServiceHealth( - ctx context.Context, - request *seamapigo.HealthGetServiceHealthRequest, - opts ...option.RequestOption, -) (*seamapigo.HealthGetServiceHealthResponse, error) { - options := core.NewRequestOptions(opts...) - - baseURL := "https://connect.getseam.com" - if c.baseURL != "" { - baseURL = c.baseURL - } - if options.BaseURL != "" { - baseURL = options.BaseURL - } - endpointURL := baseURL + "/" + "health/get_service_health" - - 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 *seamapigo.HealthGetServiceHealthResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - MaxAttempts: options.MaxAttempts, - Headers: headers, - Client: options.HTTPClient, - Request: request, - Response: &response, - ErrorDecoder: errorDecoder, - }, - ); err != nil { - return nil, err - } - return response, nil -} diff --git a/health/service.go b/health/service.go deleted file mode 100644 index 435c354..0000000 --- a/health/service.go +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package health - -import ( - json "encoding/json" - fmt "fmt" - seamapigo "github.com/seamapi/go" - core "github.com/seamapi/go/core" -) - -type ServiceByServiceNameRequest struct { - ServiceName string `json:"service_name" url:"service_name"` -} - -type ServiceByServiceNameResponse struct { - Ok bool `json:"ok" url:"ok"` - LastServiceEvaluationAt string `json:"last_service_evaluation_at" url:"last_service_evaluation_at"` - ServiceHealth *seamapigo.ServiceHealth `json:"service_health,omitempty" url:"service_health,omitempty"` - - _rawJSON json.RawMessage -} - -func (s *ServiceByServiceNameResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ServiceByServiceNameResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *s = ServiceByServiceNameResponse(value) - s._rawJSON = json.RawMessage(data) - return nil -} - -func (s *ServiceByServiceNameResponse) String() string { - if len(s._rawJSON) > 0 { - if value, err := core.StringifyJSON(s._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(s); err == nil { - return value - } - return fmt.Sprintf("%#v", s) -} diff --git a/health/service/client.go b/health/service/client.go deleted file mode 100644 index 6fdd990..0000000 --- a/health/service/client.go +++ /dev/null @@ -1,99 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package service - -import ( - bytes "bytes" - context "context" - json "encoding/json" - errors "errors" - seamapigo "github.com/seamapi/go" - core "github.com/seamapi/go/core" - health "github.com/seamapi/go/health" - option "github.com/seamapi/go/option" - io "io" - http "net/http" -) - -type Client struct { - baseURL string - caller *core.Caller - header http.Header -} - -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) - return &Client{ - baseURL: options.BaseURL, - caller: core.NewCaller( - &core.CallerParams{ - Client: options.HTTPClient, - MaxAttempts: options.MaxAttempts, - }, - ), - header: options.ToHeader(), - } -} - -func (c *Client) ByServiceName( - ctx context.Context, - request *health.ServiceByServiceNameRequest, - opts ...option.RequestOption, -) (*health.ServiceByServiceNameResponse, error) { - options := core.NewRequestOptions(opts...) - - baseURL := "https://connect.getseam.com" - if c.baseURL != "" { - baseURL = c.baseURL - } - if options.BaseURL != "" { - baseURL = options.BaseURL - } - endpointURL := baseURL + "/" + "health/service/[service_name]" - - 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 *health.ServiceByServiceNameResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - MaxAttempts: options.MaxAttempts, - Headers: headers, - Client: options.HTTPClient, - Request: request, - Response: &response, - ErrorDecoder: errorDecoder, - }, - ); err != nil { - return nil, err - } - return response, nil -} diff --git a/locks.go b/locks.go index 1aaa09b..e1574b7 100644 --- a/locks.go +++ b/locks.go @@ -90,10 +90,9 @@ func (l *LocksGetResponse) String() string { } type LocksListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewLocksListRequestCustomMetadataHasValueFromString(value string) *LocksListRequestCustomMetadataHasValue { @@ -104,10 +103,6 @@ func NewLocksListRequestCustomMetadataHasValueFromBoolean(value bool) *LocksList return &LocksListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewLocksListRequestCustomMetadataHasValueFromStringOptional(value *string) *LocksListRequestCustomMetadataHasValue { - return &LocksListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (l *LocksListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -121,12 +116,6 @@ func (l *LocksListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) erro l.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - l.typeName = "stringOptional" - l.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, l) } @@ -138,15 +127,12 @@ func (l LocksListRequestCustomMetadataHasValue) MarshalJSON() ([]byte, error) { return json.Marshal(l.String) case "boolean": return json.Marshal(l.Boolean) - case "stringOptional": - return json.Marshal(l.StringOptional) } } type LocksListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (l *LocksListRequestCustomMetadataHasValue) Accept(visitor LocksListRequestCustomMetadataHasValueVisitor) error { @@ -157,18 +143,17 @@ func (l *LocksListRequestCustomMetadataHasValue) Accept(visitor LocksListRequest return visitor.VisitString(l.String) case "boolean": return visitor.VisitBoolean(l.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(l.StringOptional) } } type LocksListRequestExcludeIfItem string const ( - LocksListRequestExcludeIfItemCanRemotelyUnlock LocksListRequestExcludeIfItem = "can_remotely_unlock" - LocksListRequestExcludeIfItemCanRemotelyLock LocksListRequestExcludeIfItem = "can_remotely_lock" - LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes LocksListRequestExcludeIfItem = "can_program_online_access_codes" - LocksListRequestExcludeIfItemCanSimulateRemoval LocksListRequestExcludeIfItem = "can_simulate_removal" + LocksListRequestExcludeIfItemCanRemotelyUnlock LocksListRequestExcludeIfItem = "can_remotely_unlock" + LocksListRequestExcludeIfItemCanRemotelyLock LocksListRequestExcludeIfItem = "can_remotely_lock" + LocksListRequestExcludeIfItemCanProgramOfflineAccessCodes LocksListRequestExcludeIfItem = "can_program_offline_access_codes" + LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes LocksListRequestExcludeIfItem = "can_program_online_access_codes" + LocksListRequestExcludeIfItemCanSimulateRemoval LocksListRequestExcludeIfItem = "can_simulate_removal" ) func NewLocksListRequestExcludeIfItemFromString(s string) (LocksListRequestExcludeIfItem, error) { @@ -177,6 +162,8 @@ func NewLocksListRequestExcludeIfItemFromString(s string) (LocksListRequestExclu return LocksListRequestExcludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return LocksListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return LocksListRequestExcludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return LocksListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": @@ -193,10 +180,11 @@ func (l LocksListRequestExcludeIfItem) Ptr() *LocksListRequestExcludeIfItem { type LocksListRequestIncludeIfItem string const ( - LocksListRequestIncludeIfItemCanRemotelyUnlock LocksListRequestIncludeIfItem = "can_remotely_unlock" - LocksListRequestIncludeIfItemCanRemotelyLock LocksListRequestIncludeIfItem = "can_remotely_lock" - LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes LocksListRequestIncludeIfItem = "can_program_online_access_codes" - LocksListRequestIncludeIfItemCanSimulateRemoval LocksListRequestIncludeIfItem = "can_simulate_removal" + LocksListRequestIncludeIfItemCanRemotelyUnlock LocksListRequestIncludeIfItem = "can_remotely_unlock" + LocksListRequestIncludeIfItemCanRemotelyLock LocksListRequestIncludeIfItem = "can_remotely_lock" + LocksListRequestIncludeIfItemCanProgramOfflineAccessCodes LocksListRequestIncludeIfItem = "can_program_offline_access_codes" + LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes LocksListRequestIncludeIfItem = "can_program_online_access_codes" + LocksListRequestIncludeIfItemCanSimulateRemoval LocksListRequestIncludeIfItem = "can_simulate_removal" ) func NewLocksListRequestIncludeIfItemFromString(s string) (LocksListRequestIncludeIfItem, error) { @@ -205,6 +193,8 @@ func NewLocksListRequestIncludeIfItemFromString(s string) (LocksListRequestInclu return LocksListRequestIncludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return LocksListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return LocksListRequestIncludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return LocksListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": diff --git a/networks.go b/networks.go index 92a1c64..a7f4215 100644 --- a/networks.go +++ b/networks.go @@ -16,8 +16,8 @@ type NetworksListRequest struct { } type NetworksGetResponse struct { - Network *NetworksGetResponseNetwork `json:"network,omitempty" url:"network,omitempty"` - Ok bool `json:"ok" url:"ok"` + Network *Network `json:"network,omitempty" url:"network,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -46,8 +46,8 @@ func (n *NetworksGetResponse) String() string { } type NetworksListResponse struct { - Networks []*NetworksListResponseNetworksItem `json:"networks,omitempty" url:"networks,omitempty"` - Ok bool `json:"ok" url:"ok"` + Networks []*Network `json:"networks,omitempty" url:"networks,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/networks/client.go b/networks/client.go index 7e25e59..b8da773 100644 --- a/networks/client.go +++ b/networks/client.go @@ -38,7 +38,7 @@ func (c *Client) Get( ctx context.Context, request *seamapigo.NetworksGetRequest, opts ...option.RequestOption, -) (*seamapigo.NetworksGetResponse, error) { +) (*seamapigo.Network, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -94,14 +94,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.Network, nil } func (c *Client) List( ctx context.Context, request *seamapigo.NetworksListRequest, opts ...option.RequestOption, -) (*seamapigo.NetworksListResponse, error) { +) ([]*seamapigo.Network, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -157,5 +157,5 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.Networks, nil } diff --git a/noisesensors/noisethresholds/client.go b/noisesensors/noisethresholds/client.go index 9767e4f..ce5eb6c 100644 --- a/noisesensors/noisethresholds/client.go +++ b/noisesensors/noisethresholds/client.go @@ -102,7 +102,7 @@ func (c *Client) Delete( ctx context.Context, request *noisesensors.NoiseThresholdsDeleteRequest, opts ...option.RequestOption, -) (*seamapigo.ActionAttempt, error) { +) (*noisesensors.NoiseThresholdsDeleteResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,7 +158,7 @@ func (c *Client) Delete( ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response, nil } func (c *Client) Get( @@ -291,7 +291,7 @@ func (c *Client) Update( ctx context.Context, request *noisesensors.NoiseThresholdsUpdateRequest, opts ...option.RequestOption, -) (*seamapigo.ActionAttempt, error) { +) (*noisesensors.NoiseThresholdsUpdateResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -347,5 +347,5 @@ func (c *Client) Update( ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response, nil } diff --git a/option/request_option.go b/option/request_option.go index ad59428..408bc6a 100644 --- a/option/request_option.go +++ b/option/request_option.go @@ -40,20 +40,13 @@ func WithMaxAttempts(attempts uint) *core.MaxAttemptsOption { } } -// WithApiKey sets the 'Authorization: Bearer ' request header. +// WithApiKey sets the apiKey auth request header. func WithApiKey(apiKey string) *core.ApiKeyOption { return &core.ApiKeyOption{ ApiKey: apiKey, } } -// WithSeamWorkspace sets the seamWorkspace request header. -func WithSeamWorkspace(seamWorkspace string) *core.SeamWorkspaceOption { - return &core.SeamWorkspaceOption{ - SeamWorkspace: seamWorkspace, - } -} - // WithSeamClientSessionToken sets the seamClientSessionToken request header. func WithSeamClientSessionToken(seamClientSessionToken string) *core.SeamClientSessionTokenOption { return &core.SeamClientSessionTokenOption{ diff --git a/thermostats.go b/thermostats.go index 17be589..769961e 100644 --- a/thermostats.go +++ b/thermostats.go @@ -209,10 +209,9 @@ func (t *ThermostatsHeatResponse) String() string { } type ThermostatsListRequestCustomMetadataHasValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewThermostatsListRequestCustomMetadataHasValueFromString(value string) *ThermostatsListRequestCustomMetadataHasValue { @@ -223,10 +222,6 @@ func NewThermostatsListRequestCustomMetadataHasValueFromBoolean(value bool) *The return &ThermostatsListRequestCustomMetadataHasValue{typeName: "boolean", Boolean: value} } -func NewThermostatsListRequestCustomMetadataHasValueFromStringOptional(value *string) *ThermostatsListRequestCustomMetadataHasValue { - return &ThermostatsListRequestCustomMetadataHasValue{typeName: "stringOptional", StringOptional: value} -} - func (t *ThermostatsListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -240,12 +235,6 @@ func (t *ThermostatsListRequestCustomMetadataHasValue) UnmarshalJSON(data []byte t.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - t.typeName = "stringOptional" - t.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, t) } @@ -257,15 +246,12 @@ func (t ThermostatsListRequestCustomMetadataHasValue) MarshalJSON() ([]byte, err return json.Marshal(t.String) case "boolean": return json.Marshal(t.Boolean) - case "stringOptional": - return json.Marshal(t.StringOptional) } } type ThermostatsListRequestCustomMetadataHasValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (t *ThermostatsListRequestCustomMetadataHasValue) Accept(visitor ThermostatsListRequestCustomMetadataHasValueVisitor) error { @@ -276,18 +262,17 @@ func (t *ThermostatsListRequestCustomMetadataHasValue) Accept(visitor Thermostat return visitor.VisitString(t.String) case "boolean": return visitor.VisitBoolean(t.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(t.StringOptional) } } type ThermostatsListRequestExcludeIfItem string const ( - ThermostatsListRequestExcludeIfItemCanRemotelyUnlock ThermostatsListRequestExcludeIfItem = "can_remotely_unlock" - ThermostatsListRequestExcludeIfItemCanRemotelyLock ThermostatsListRequestExcludeIfItem = "can_remotely_lock" - ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_online_access_codes" - ThermostatsListRequestExcludeIfItemCanSimulateRemoval ThermostatsListRequestExcludeIfItem = "can_simulate_removal" + ThermostatsListRequestExcludeIfItemCanRemotelyUnlock ThermostatsListRequestExcludeIfItem = "can_remotely_unlock" + ThermostatsListRequestExcludeIfItemCanRemotelyLock ThermostatsListRequestExcludeIfItem = "can_remotely_lock" + ThermostatsListRequestExcludeIfItemCanProgramOfflineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_offline_access_codes" + ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestExcludeIfItem = "can_program_online_access_codes" + ThermostatsListRequestExcludeIfItemCanSimulateRemoval ThermostatsListRequestExcludeIfItem = "can_simulate_removal" ) func NewThermostatsListRequestExcludeIfItemFromString(s string) (ThermostatsListRequestExcludeIfItem, error) { @@ -296,6 +281,8 @@ func NewThermostatsListRequestExcludeIfItemFromString(s string) (ThermostatsList return ThermostatsListRequestExcludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return ThermostatsListRequestExcludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return ThermostatsListRequestExcludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return ThermostatsListRequestExcludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": @@ -312,10 +299,11 @@ func (t ThermostatsListRequestExcludeIfItem) Ptr() *ThermostatsListRequestExclud type ThermostatsListRequestIncludeIfItem string const ( - ThermostatsListRequestIncludeIfItemCanRemotelyUnlock ThermostatsListRequestIncludeIfItem = "can_remotely_unlock" - ThermostatsListRequestIncludeIfItemCanRemotelyLock ThermostatsListRequestIncludeIfItem = "can_remotely_lock" - ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_online_access_codes" - ThermostatsListRequestIncludeIfItemCanSimulateRemoval ThermostatsListRequestIncludeIfItem = "can_simulate_removal" + ThermostatsListRequestIncludeIfItemCanRemotelyUnlock ThermostatsListRequestIncludeIfItem = "can_remotely_unlock" + ThermostatsListRequestIncludeIfItemCanRemotelyLock ThermostatsListRequestIncludeIfItem = "can_remotely_lock" + ThermostatsListRequestIncludeIfItemCanProgramOfflineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_offline_access_codes" + ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes ThermostatsListRequestIncludeIfItem = "can_program_online_access_codes" + ThermostatsListRequestIncludeIfItemCanSimulateRemoval ThermostatsListRequestIncludeIfItem = "can_simulate_removal" ) func NewThermostatsListRequestIncludeIfItemFromString(s string) (ThermostatsListRequestIncludeIfItem, error) { @@ -324,6 +312,8 @@ func NewThermostatsListRequestIncludeIfItemFromString(s string) (ThermostatsList return ThermostatsListRequestIncludeIfItemCanRemotelyUnlock, nil case "can_remotely_lock": return ThermostatsListRequestIncludeIfItemCanRemotelyLock, nil + case "can_program_offline_access_codes": + return ThermostatsListRequestIncludeIfItemCanProgramOfflineAccessCodes, nil case "can_program_online_access_codes": return ThermostatsListRequestIncludeIfItemCanProgramOnlineAccessCodes, nil case "can_simulate_removal": diff --git a/thermostats/climatesettingschedules/client.go b/thermostats/climatesettingschedules/client.go index 7eca25f..2d763df 100644 --- a/thermostats/climatesettingschedules/client.go +++ b/thermostats/climatesettingschedules/client.go @@ -291,7 +291,7 @@ func (c *Client) Update( ctx context.Context, request *thermostats.ClimateSettingSchedulesUpdateRequest, opts ...option.RequestOption, -) (*seamapigo.ClimateSettingSchedule, error) { +) (*thermostats.ClimateSettingSchedulesUpdateResponse, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -347,5 +347,5 @@ func (c *Client) Update( ); err != nil { return nil, err } - return response.ClimateSettingSchedule, nil + return response, nil } diff --git a/types.go b/types.go index 25744e3..7f5ecc1 100644 --- a/types.go +++ b/types.go @@ -278,25 +278,571 @@ func (a AcsAccessGroupExternalType) Ptr() *AcsAccessGroupExternalType { return &a } +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"` + + _rawJSON json.RawMessage +} + +func (a *AcsCredential) UnmarshalJSON(data []byte) error { + type embed AcsCredential + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsCredential(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredential) MarshalJSON() ([]byte, error) { + type embed AcsCredential + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (a *AcsCredential) 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 AcsCredentialAccessMethod string + +const ( + AcsCredentialAccessMethodCode AcsCredentialAccessMethod = "code" + AcsCredentialAccessMethodCard AcsCredentialAccessMethod = "card" + AcsCredentialAccessMethodMobileKey AcsCredentialAccessMethod = "mobile_key" +) + +func NewAcsCredentialAccessMethodFromString(s string) (AcsCredentialAccessMethod, error) { + switch s { + case "code": + return AcsCredentialAccessMethodCode, nil + case "card": + return AcsCredentialAccessMethodCard, nil + case "mobile_key": + return AcsCredentialAccessMethodMobileKey, nil + } + var t AcsCredentialAccessMethod + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AcsCredentialAccessMethod) Ptr() *AcsCredentialAccessMethod { + return &a +} + +type AcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code" url:"error_code"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *AcsCredentialErrorsItem) UnmarshalJSON(data []byte) error { + type unmarshaler AcsCredentialErrorsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsCredentialErrorsItem(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredentialErrorsItem) 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 AcsCredentialExternalType string + +const ( + AcsCredentialExternalTypePtiCard AcsCredentialExternalType = "pti_card" + AcsCredentialExternalTypeBrivoCredential AcsCredentialExternalType = "brivo_credential" + AcsCredentialExternalTypeHidCredential AcsCredentialExternalType = "hid_credential" + AcsCredentialExternalTypeVisionlineCard AcsCredentialExternalType = "visionline_card" +) + +func NewAcsCredentialExternalTypeFromString(s string) (AcsCredentialExternalType, error) { + switch s { + case "pti_card": + return AcsCredentialExternalTypePtiCard, nil + case "brivo_credential": + return AcsCredentialExternalTypeBrivoCredential, nil + case "hid_credential": + return AcsCredentialExternalTypeHidCredential, nil + case "visionline_card": + return AcsCredentialExternalTypeVisionlineCard, nil + } + var t AcsCredentialExternalType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AcsCredentialExternalType) Ptr() *AcsCredentialExternalType { + return &a +} + +type AcsCredentialPool struct { + AcsCredentialPoolId string `json:"acs_credential_pool_id" url:"acs_credential_pool_id"` + AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` + DisplayName string `json:"display_name" url:"display_name"` + ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + WorkspaceId string `json:"workspace_id" url:"workspace_id"` + externalType string + + _rawJSON json.RawMessage +} + +func (a *AcsCredentialPool) ExternalType() string { + return a.externalType +} + +func (a *AcsCredentialPool) UnmarshalJSON(data []byte) error { + type embed AcsCredentialPool + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsCredentialPool(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a.externalType = "hid_part_number" + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredentialPool) MarshalJSON() ([]byte, error) { + type embed AcsCredentialPool + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + ExternalType string `json:"external_type"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + ExternalType: "hid_part_number", + } + return json.Marshal(marshaler) +} + +func (a *AcsCredentialPool) 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 AcsCredentialProvisioningAutomation 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"` + + _rawJSON json.RawMessage +} + +func (a *AcsCredentialProvisioningAutomation) UnmarshalJSON(data []byte) error { + type embed AcsCredentialProvisioningAutomation + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsCredentialProvisioningAutomation(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredentialProvisioningAutomation) MarshalJSON() ([]byte, error) { + type embed AcsCredentialProvisioningAutomation + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (a *AcsCredentialProvisioningAutomation) 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 AcsCredentialVisionlineMetadata struct { + CardFunctionType AcsCredentialVisionlineMetadataCardFunctionType `json:"card_function_type,omitempty" url:"card_function_type,omitempty"` + JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty" url:"joiner_acs_credential_ids,omitempty"` + GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty" url:"guest_acs_entrance_ids,omitempty"` + CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty" url:"common_acs_entrance_ids,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AcsCredentialVisionlineMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AcsCredentialVisionlineMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsCredentialVisionlineMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredentialVisionlineMetadata) 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 AcsCredentialVisionlineMetadataCardFunctionType string + +const ( + AcsCredentialVisionlineMetadataCardFunctionTypeGuest AcsCredentialVisionlineMetadataCardFunctionType = "guest" + AcsCredentialVisionlineMetadataCardFunctionTypeStaff AcsCredentialVisionlineMetadataCardFunctionType = "staff" +) + +func NewAcsCredentialVisionlineMetadataCardFunctionTypeFromString(s string) (AcsCredentialVisionlineMetadataCardFunctionType, error) { + switch s { + case "guest": + return AcsCredentialVisionlineMetadataCardFunctionTypeGuest, nil + case "staff": + return AcsCredentialVisionlineMetadataCardFunctionTypeStaff, nil + } + var t AcsCredentialVisionlineMetadataCardFunctionType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AcsCredentialVisionlineMetadataCardFunctionType) Ptr() *AcsCredentialVisionlineMetadataCardFunctionType { + return &a +} + +type AcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code" url:"warning_code"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *AcsCredentialWarningsItem) UnmarshalJSON(data []byte) error { + type unmarshaler AcsCredentialWarningsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsCredentialWarningsItem(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsCredentialWarningsItem) 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 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"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + LatchMetadata *AcsEntranceLatchMetadata `json:"latch_metadata,omitempty" url:"latch_metadata,omitempty"` + VisionlineMetadata *AcsEntranceVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AcsEntrance) UnmarshalJSON(data []byte) error { + type embed AcsEntrance + var unmarshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AcsEntrance(unmarshaler.embed) + a.CreatedAt = unmarshaler.CreatedAt.Time() + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsEntrance) MarshalJSON() ([]byte, error) { + type embed AcsEntrance + var marshaler = struct { + embed + CreatedAt *core.DateTime `json:"created_at"` + }{ + embed: embed(*a), + CreatedAt: core.NewDateTime(a.CreatedAt), + } + return json.Marshal(marshaler) +} + +func (a *AcsEntrance) 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 AcsEntranceLatchMetadata struct { + AccessibilityType string `json:"accessibility_type" url:"accessibility_type"` + DoorName string `json:"door_name" url:"door_name"` + DoorType string `json:"door_type" url:"door_type"` + IsConnected bool `json:"is_connected" url:"is_connected"` + + _rawJSON json.RawMessage +} + +func (a *AcsEntranceLatchMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AcsEntranceLatchMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsEntranceLatchMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsEntranceLatchMetadata) 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 AcsEntranceVisionlineMetadata struct { + DoorName string `json:"door_name" url:"door_name"` + DoorCategory AcsEntranceVisionlineMetadataDoorCategory `json:"door_category,omitempty" url:"door_category,omitempty"` + Profiles []*AcsEntranceVisionlineMetadataProfilesItem `json:"profiles,omitempty" url:"profiles,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AcsEntranceVisionlineMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AcsEntranceVisionlineMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsEntranceVisionlineMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsEntranceVisionlineMetadata) 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 AcsEntranceVisionlineMetadataDoorCategory string + +const ( + AcsEntranceVisionlineMetadataDoorCategoryEntrance AcsEntranceVisionlineMetadataDoorCategory = "entrance" + AcsEntranceVisionlineMetadataDoorCategoryGuest AcsEntranceVisionlineMetadataDoorCategory = "guest" + AcsEntranceVisionlineMetadataDoorCategoryElevatorReader AcsEntranceVisionlineMetadataDoorCategory = "elevator reader" + AcsEntranceVisionlineMetadataDoorCategoryCommon AcsEntranceVisionlineMetadataDoorCategory = "common" + AcsEntranceVisionlineMetadataDoorCategoryCommonPms AcsEntranceVisionlineMetadataDoorCategory = "common (PMS)" +) + +func NewAcsEntranceVisionlineMetadataDoorCategoryFromString(s string) (AcsEntranceVisionlineMetadataDoorCategory, error) { + switch s { + case "entrance": + return AcsEntranceVisionlineMetadataDoorCategoryEntrance, nil + case "guest": + return AcsEntranceVisionlineMetadataDoorCategoryGuest, nil + case "elevator reader": + return AcsEntranceVisionlineMetadataDoorCategoryElevatorReader, nil + case "common": + return AcsEntranceVisionlineMetadataDoorCategoryCommon, nil + case "common (PMS)": + return AcsEntranceVisionlineMetadataDoorCategoryCommonPms, nil + } + var t AcsEntranceVisionlineMetadataDoorCategory + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AcsEntranceVisionlineMetadataDoorCategory) Ptr() *AcsEntranceVisionlineMetadataDoorCategory { + return &a +} + +type AcsEntranceVisionlineMetadataProfilesItem struct { + VisionlineDoorProfileId string `json:"visionline_door_profile_id" url:"visionline_door_profile_id"` + VisionlineDoorProfileType AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType `json:"visionline_door_profile_type,omitempty" url:"visionline_door_profile_type,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AcsEntranceVisionlineMetadataProfilesItem) UnmarshalJSON(data []byte) error { + type unmarshaler AcsEntranceVisionlineMetadataProfilesItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsEntranceVisionlineMetadataProfilesItem(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsEntranceVisionlineMetadataProfilesItem) 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 AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType string + +const ( + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "BLE" + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "commonDoor" + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType = "touch" +) + +func NewAcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeFromString(s string) (AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType, error) { + switch s { + case "BLE": + return AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeBle, nil + case "commonDoor": + return AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeCommonDoor, nil + case "touch": + return AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileTypeTouch, nil + } + var t AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType) Ptr() *AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType { + return &a +} + type AcsSystem struct { - AcsSystemId string `json:"acs_system_id" url:"acs_system_id"` - ExternalType AcsSystemExternalType `json:"external_type,omitempty" url:"external_type,omitempty"` - ExternalTypeDisplayName string `json:"external_type_display_name" url:"external_type_display_name"` + 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"` + SystemType *AcsSystemSystemType `json:"system_type,omitempty" url:"system_type,omitempty"` // --- // deprecated: use external_type_display_name // --- - SystemTypeDisplayName string `json:"system_type_display_name" url:"system_type_display_name"` - Name string `json:"name" url:"name"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - 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"` + 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"` _rawJSON json.RawMessage } @@ -437,6 +983,7 @@ type AcsUser struct { IsSuspended bool `json:"is_suspended" url:"is_suspended"` AccessSchedule *AcsUserAccessSchedule `json:"access_schedule,omitempty" url:"access_schedule,omitempty"` UserIdentityId *string `json:"user_identity_id,omitempty" url:"user_identity_id,omitempty"` + UserIdentityFullName *string `json:"user_identity_full_name,omitempty" url:"user_identity_full_name,omitempty"` 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"` @@ -550,6 +1097,7 @@ const ( AcsUserExternalTypeBrivoUser AcsUserExternalType = "brivo_user" AcsUserExternalTypeHidCredentialManagerUser AcsUserExternalType = "hid_credential_manager_user" AcsUserExternalTypeSaltoSiteUser AcsUserExternalType = "salto_site_user" + AcsUserExternalTypeLatchUser AcsUserExternalType = "latch_user" ) func NewAcsUserExternalTypeFromString(s string) (AcsUserExternalType, error) { @@ -562,6 +1110,8 @@ func NewAcsUserExternalTypeFromString(s string) (AcsUserExternalType, error) { return AcsUserExternalTypeHidCredentialManagerUser, nil case "salto_site_user": return AcsUserExternalTypeSaltoSiteUser, nil + case "latch_user": + return AcsUserExternalTypeLatchUser, nil } var t AcsUserExternalType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -953,16 +1503,22 @@ func (c ClimateSettingScheduleHvacModeSetting) Ptr() *ClimateSettingScheduleHvac } type ConnectWebview struct { - ConnectWebviewId string `json:"connect_webview_id" url:"connect_webview_id"` - ConnectedAccountId *string `json:"connected_account_id,omitempty" url:"connected_account_id,omitempty"` - Url string `json:"url" url:"url"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - 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"` - AnyProviderAllowed bool `json:"any_provider_allowed" url:"any_provider_allowed"` + 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"` - CreatedAt time.Time `json:"created_at" url:"created_at"` + 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"` @@ -1022,10 +1578,9 @@ func (c *ConnectWebview) String() string { } type ConnectWebviewCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectWebviewCustomMetadataValueFromString(value string) *ConnectWebviewCustomMetadataValue { @@ -1036,10 +1591,6 @@ func NewConnectWebviewCustomMetadataValueFromBoolean(value bool) *ConnectWebview return &ConnectWebviewCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewConnectWebviewCustomMetadataValueFromStringOptional(value *string) *ConnectWebviewCustomMetadataValue { - return &ConnectWebviewCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectWebviewCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -1053,12 +1604,6 @@ func (c *ConnectWebviewCustomMetadataValue) UnmarshalJSON(data []byte) error { 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) } @@ -1070,15 +1615,12 @@ func (c ConnectWebviewCustomMetadataValue) MarshalJSON() ([]byte, error) { return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectWebviewCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectWebviewCustomMetadataValue) Accept(visitor ConnectWebviewCustomMetadataValueVisitor) error { @@ -1089,8 +1631,6 @@ func (c *ConnectWebviewCustomMetadataValue) Accept(visitor ConnectWebviewCustomM return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } @@ -1175,10 +1715,9 @@ func (c *ConnectedAccount) String() string { } type ConnectedAccountCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewConnectedAccountCustomMetadataValueFromString(value string) *ConnectedAccountCustomMetadataValue { @@ -1189,10 +1728,6 @@ func NewConnectedAccountCustomMetadataValueFromBoolean(value bool) *ConnectedAcc return &ConnectedAccountCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewConnectedAccountCustomMetadataValueFromStringOptional(value *string) *ConnectedAccountCustomMetadataValue { - return &ConnectedAccountCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (c *ConnectedAccountCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -1206,12 +1741,6 @@ func (c *ConnectedAccountCustomMetadataValue) UnmarshalJSON(data []byte) error { 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) } @@ -1223,15 +1752,12 @@ func (c ConnectedAccountCustomMetadataValue) MarshalJSON() ([]byte, error) { return json.Marshal(c.String) case "boolean": return json.Marshal(c.Boolean) - case "stringOptional": - return json.Marshal(c.StringOptional) } } type ConnectedAccountCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (c *ConnectedAccountCustomMetadataValue) Accept(visitor ConnectedAccountCustomMetadataValueVisitor) error { @@ -1242,8 +1768,6 @@ func (c *ConnectedAccountCustomMetadataValue) Accept(visitor ConnectedAccountCus return visitor.VisitString(c.String) case "boolean": return visitor.VisitBoolean(c.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(c.StringOptional) } } @@ -1306,12 +1830,13 @@ type Device struct { // Date and time at which the device object was created. CreatedAt time.Time `json:"created_at" url:"created_at"` // Indicates whether Seam manages the device. - IsManaged bool `json:"is_managed" url:"is_managed"` - CustomMetadata map[string]*DeviceCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` - CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` - CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` - CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` - CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` + IsManaged bool `json:"is_managed" url:"is_managed"` + CustomMetadata map[string]*DeviceCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` + CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` + 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"` _rawJSON json.RawMessage } @@ -1392,10 +1917,9 @@ func (d DeviceCapabilitiesSupportedItem) Ptr() *DeviceCapabilitiesSupportedItem } type DeviceCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewDeviceCustomMetadataValueFromString(value string) *DeviceCustomMetadataValue { @@ -1406,10 +1930,6 @@ func NewDeviceCustomMetadataValueFromBoolean(value bool) *DeviceCustomMetadataVa return &DeviceCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewDeviceCustomMetadataValueFromStringOptional(value *string) *DeviceCustomMetadataValue { - return &DeviceCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (d *DeviceCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -1423,12 +1943,6 @@ func (d *DeviceCustomMetadataValue) UnmarshalJSON(data []byte) error { 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) } @@ -1440,15 +1954,12 @@ func (d DeviceCustomMetadataValue) MarshalJSON() ([]byte, error) { return json.Marshal(d.String) case "boolean": return json.Marshal(d.Boolean) - case "stringOptional": - return json.Marshal(d.StringOptional) } } type DeviceCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (d *DeviceCustomMetadataValue) Accept(visitor DeviceCustomMetadataValueVisitor) error { @@ -1459,8 +1970,6 @@ func (d *DeviceCustomMetadataValue) Accept(visitor DeviceCustomMetadataValueVisi return visitor.VisitString(d.String) case "boolean": return visitor.VisitBoolean(d.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(d.StringOptional) } } @@ -1633,6 +2142,8 @@ func (d *DeviceProperties) String() string { type DevicePropertiesAccessoryKeypad struct { // Indicates if the accessory_keypad is connected to the device. IsConnected bool `json:"is_connected" url:"is_connected"` + // Indicates if the keypad battery properties. + Battery *DevicePropertiesAccessoryKeypadBattery `json:"battery,omitempty" url:"battery,omitempty"` _rawJSON json.RawMessage } @@ -1660,6 +2171,36 @@ func (d *DevicePropertiesAccessoryKeypad) String() string { return fmt.Sprintf("%#v", d) } +// Indicates if the keypad battery properties. +type DevicePropertiesAccessoryKeypadBattery struct { + Level float64 `json:"level" url:"level"` + + _rawJSON json.RawMessage +} + +func (d *DevicePropertiesAccessoryKeypadBattery) UnmarshalJSON(data []byte) error { + type unmarshaler DevicePropertiesAccessoryKeypadBattery + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DevicePropertiesAccessoryKeypadBattery(value) + d._rawJSON = json.RawMessage(data) + return nil +} + +func (d *DevicePropertiesAccessoryKeypadBattery) String() string { + if len(d._rawJSON) > 0 { + if value, err := core.StringifyJSON(d._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + type DevicePropertiesAppearance struct { // Name of the device as seen from the provider API and application, not settable through Seam. Name string `json:"name" url:"name"` @@ -1786,12 +2327,13 @@ func (d *DevicePropertiesAugustMetadata) String() string { } type DevicePropertiesAvigilonAltaMetadata struct { - EntryName string `json:"entry_name" url:"entry_name"` - OrgName string `json:"org_name" url:"org_name"` - ZoneId float64 `json:"zone_id" url:"zone_id"` - ZoneName string `json:"zone_name" url:"zone_name"` - SiteId float64 `json:"site_id" url:"site_id"` - SiteName string `json:"site_name" url:"site_name"` + EntryName string `json:"entry_name" url:"entry_name"` + OrgName string `json:"org_name" url:"org_name"` + ZoneId float64 `json:"zone_id" url:"zone_id"` + ZoneName string `json:"zone_name" url:"zone_name"` + SiteId float64 `json:"site_id" url:"site_id"` + SiteName string `json:"site_name" url:"site_name"` + EntryRelaysTotalCount float64 `json:"entry_relays_total_count" url:"entry_relays_total_count"` _rawJSON json.RawMessage } @@ -2056,6 +2598,7 @@ const ( DevicePropertiesCodeConstraintsItemZeroConstraintTypeStartDateInFuture DevicePropertiesCodeConstraintsItemZeroConstraintType = "start_date_in_future" DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoAscendingOrDescendingSequence DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_ascending_or_descending_sequence" DevicePropertiesCodeConstraintsItemZeroConstraintTypeAtLeastThreeUniqueDigits DevicePropertiesCodeConstraintsItemZeroConstraintType = "at_least_three_unique_digits" + DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotContain089 DevicePropertiesCodeConstraintsItemZeroConstraintType = "cannot_contain_089" ) func NewDevicePropertiesCodeConstraintsItemZeroConstraintTypeFromString(s string) (DevicePropertiesCodeConstraintsItemZeroConstraintType, error) { @@ -2076,6 +2619,8 @@ func NewDevicePropertiesCodeConstraintsItemZeroConstraintTypeFromString(s string return DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoAscendingOrDescendingSequence, nil case "at_least_three_unique_digits": return DevicePropertiesCodeConstraintsItemZeroConstraintTypeAtLeastThreeUniqueDigits, nil + case "cannot_contain_089": + return DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotContain089, nil } var t DevicePropertiesCodeConstraintsItemZeroConstraintType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -2120,6 +2665,7 @@ type DevicePropertiesDormakabaOracodeMetadata struct { DoorId float64 `json:"door_id" url:"door_id"` DoorName string `json:"door_name" url:"door_name"` DeviceId *float64 `json:"device_id,omitempty" url:"device_id,omitempty"` + DoorIsWireless bool `json:"door_is_wireless" url:"door_is_wireless"` SiteId float64 `json:"site_id" url:"site_id"` SiteName string `json:"site_name" url:"site_name"` IanaTimezone *string `json:"iana_timezone,omitempty" url:"iana_timezone,omitempty"` @@ -2377,6 +2923,7 @@ type DevicePropertiesIgloohomeMetadata struct { DeviceName string `json:"device_name" url:"device_name"` BridgeId *string `json:"bridge_id,omitempty" url:"bridge_id,omitempty"` BridgeName *string `json:"bridge_name,omitempty" url:"bridge_name,omitempty"` + KeypadId *string `json:"keypad_id,omitempty" url:"keypad_id,omitempty"` _rawJSON json.RawMessage } @@ -2841,6 +3388,8 @@ type DevicePropertiesNukiMetadata struct { DeviceId string `json:"device_id" url:"device_id"` DeviceName string `json:"device_name" url:"device_name"` KeypadBatteryCritical *bool `json:"keypad_battery_critical,omitempty" url:"keypad_battery_critical,omitempty"` + KeypadPaired *bool `json:"keypad_paired,omitempty" url:"keypad_paired,omitempty"` + Keypad2Paired *bool `json:"keypad_2_paired,omitempty" url:"keypad_2_paired,omitempty"` _rawJSON json.RawMessage } @@ -3115,12 +3664,14 @@ func (d *DevicePropertiesTwoNMetadata) String() string { } type DevicePropertiesWyzeMetadata struct { - DeviceId string `json:"device_id" url:"device_id"` - DeviceName string `json:"device_name" url:"device_name"` - ProductName string `json:"product_name" url:"product_name"` - ProductType string `json:"product_type" url:"product_type"` - ProductModel string `json:"product_model" url:"product_model"` - DeviceInfoModel string `json:"device_info_model" url:"device_info_model"` + DeviceId string `json:"device_id" url:"device_id"` + DeviceName string `json:"device_name" url:"device_name"` + ProductName string `json:"product_name" url:"product_name"` + ProductType string `json:"product_type" url:"product_type"` + ProductModel string `json:"product_model" url:"product_model"` + DeviceInfoModel string `json:"device_info_model" url:"device_info_model"` + KeypadUuid *string `json:"keypad_uuid,omitempty" url:"keypad_uuid,omitempty"` + LockerStatusHardlock *float64 `json:"locker_status_hardlock,omitempty" url:"locker_status_hardlock,omitempty"` _rawJSON json.RawMessage } @@ -3529,12 +4080,13 @@ func (e *EnrollmentAutomation) String() string { } type Event struct { - EventId string `json:"event_id" url:"event_id"` - DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` - EventType string `json:"event_type" url:"event_type"` - WorkspaceId string `json:"workspace_id" url:"workspace_id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - OccurredAt time.Time `json:"occurred_at" url:"occurred_at"` + EventId string `json:"event_id" url:"event_id"` + DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` + ActionAttemptId *string `json:"action_attempt_id,omitempty" url:"action_attempt_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 } @@ -3959,6 +4511,56 @@ 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"` @@ -4016,12 +4618,13 @@ type Phone struct { // Date and time at which the device object was created. CreatedAt time.Time `json:"created_at" url:"created_at"` // Indicates whether Seam manages the device. - IsManaged bool `json:"is_managed" url:"is_managed"` - CustomMetadata map[string]*PhoneCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` - CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` - CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` - CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` - CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` + IsManaged bool `json:"is_managed" url:"is_managed"` + CustomMetadata map[string]*PhoneCustomMetadataValue `json:"custom_metadata,omitempty" url:"custom_metadata,omitempty"` + CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` + 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"` _rawJSON json.RawMessage } @@ -4102,10 +4705,9 @@ func (p PhoneCapabilitiesSupportedItem) Ptr() *PhoneCapabilitiesSupportedItem { } type PhoneCustomMetadataValue struct { - typeName string - String string - Boolean bool - StringOptional *string + typeName string + String string + Boolean bool } func NewPhoneCustomMetadataValueFromString(value string) *PhoneCustomMetadataValue { @@ -4116,10 +4718,6 @@ func NewPhoneCustomMetadataValueFromBoolean(value bool) *PhoneCustomMetadataValu return &PhoneCustomMetadataValue{typeName: "boolean", Boolean: value} } -func NewPhoneCustomMetadataValueFromStringOptional(value *string) *PhoneCustomMetadataValue { - return &PhoneCustomMetadataValue{typeName: "stringOptional", StringOptional: value} -} - func (p *PhoneCustomMetadataValue) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { @@ -4133,12 +4731,6 @@ func (p *PhoneCustomMetadataValue) UnmarshalJSON(data []byte) error { p.Boolean = valueBoolean return nil } - var valueStringOptional *string - if err := json.Unmarshal(data, &valueStringOptional); err == nil { - p.typeName = "stringOptional" - p.StringOptional = valueStringOptional - return nil - } return fmt.Errorf("%s cannot be deserialized as a %T", data, p) } @@ -4150,15 +4742,12 @@ func (p PhoneCustomMetadataValue) MarshalJSON() ([]byte, error) { return json.Marshal(p.String) case "boolean": return json.Marshal(p.Boolean) - case "stringOptional": - return json.Marshal(p.StringOptional) } } type PhoneCustomMetadataValueVisitor interface { VisitString(string) error VisitBoolean(bool) error - VisitStringOptional(*string) error } func (p *PhoneCustomMetadataValue) Accept(visitor PhoneCustomMetadataValueVisitor) error { @@ -4169,8 +4758,6 @@ func (p *PhoneCustomMetadataValue) Accept(visitor PhoneCustomMetadataValueVisito return visitor.VisitString(p.String) case "boolean": return visitor.VisitBoolean(p.Boolean) - case "stringOptional": - return visitor.VisitStringOptional(p.StringOptional) } } @@ -4623,14 +5210,15 @@ type UnmanagedDevice struct { // Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. Warnings []*UnmanagedDeviceWarningsItem `json:"warnings,omitempty" url:"warnings,omitempty"` // Date and time at which the device object was created. - CreatedAt time.Time `json:"created_at" url:"created_at"` - IsManaged bool `json:"is_managed" url:"is_managed"` - Properties *UnmanagedDeviceProperties `json:"properties,omitempty" url:"properties,omitempty"` - CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` - CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` - CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty" url:"can_program_online_access_codes,omitempty"` - CanSimulateRemoval *bool `json:"can_simulate_removal,omitempty" url:"can_simulate_removal,omitempty"` - DeviceProvider *UnmanagedDeviceDeviceProvider `json:"device_provider,omitempty" url:"device_provider,omitempty"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + IsManaged bool `json:"is_managed" url:"is_managed"` + Properties *UnmanagedDeviceProperties `json:"properties,omitempty" url:"properties,omitempty"` + CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty" url:"can_remotely_unlock,omitempty"` + CanRemotelyLock *bool `json:"can_remotely_lock,omitempty" url:"can_remotely_lock,omitempty"` + 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"` + DeviceProvider *UnmanagedDeviceDeviceProvider `json:"device_provider,omitempty" url:"device_provider,omitempty"` _rawJSON json.RawMessage } @@ -4770,6 +5358,8 @@ 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 // --- @@ -4819,6 +5409,69 @@ func (u *UnmanagedDeviceProperties) String() string { return fmt.Sprintf("%#v", u) } +// Represents the accessory keypad state. +type UnmanagedDevicePropertiesAccessoryKeypad struct { + // Indicates if the accessory_keypad is connected to the device. + IsConnected bool `json:"is_connected" url:"is_connected"` + // Indicates if the keypad battery properties. + Battery *UnmanagedDevicePropertiesAccessoryKeypadBattery `json:"battery,omitempty" url:"battery,omitempty"` + + _rawJSON json.RawMessage +} + +func (u *UnmanagedDevicePropertiesAccessoryKeypad) UnmarshalJSON(data []byte) error { + type unmarshaler UnmanagedDevicePropertiesAccessoryKeypad + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UnmanagedDevicePropertiesAccessoryKeypad(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UnmanagedDevicePropertiesAccessoryKeypad) 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) +} + +// Indicates if the keypad battery properties. +type UnmanagedDevicePropertiesAccessoryKeypadBattery struct { + Level float64 `json:"level" url:"level"` + + _rawJSON json.RawMessage +} + +func (u *UnmanagedDevicePropertiesAccessoryKeypadBattery) UnmarshalJSON(data []byte) error { + type unmarshaler UnmanagedDevicePropertiesAccessoryKeypadBattery + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UnmanagedDevicePropertiesAccessoryKeypadBattery(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UnmanagedDevicePropertiesAccessoryKeypadBattery) 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) +} + // Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage. type UnmanagedDevicePropertiesBattery struct { Level float64 `json:"level" url:"level"` @@ -4927,18 +5580,72 @@ type UnmanagedDeviceWarningsItem struct { _rawJSON json.RawMessage } -func (u *UnmanagedDeviceWarningsItem) UnmarshalJSON(data []byte) error { - type unmarshaler UnmanagedDeviceWarningsItem - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (u *UnmanagedDeviceWarningsItem) UnmarshalJSON(data []byte) error { + type unmarshaler UnmanagedDeviceWarningsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UnmanagedDeviceWarningsItem(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UnmanagedDeviceWarningsItem) 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 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 = UnmanagedDeviceWarningsItem(value) + *u = UserIdentity(unmarshaler.embed) + u.CreatedAt = unmarshaler.CreatedAt.Time() u._rawJSON = json.RawMessage(data) return nil } -func (u *UnmanagedDeviceWarningsItem) String() string { +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 @@ -5072,106 +5779,6 @@ func (c *ConnectedAccountsGetRequestEmail) String() string { return fmt.Sprintf("%#v", c) } -type NetworksGetResponseNetwork 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 *NetworksGetResponseNetwork) UnmarshalJSON(data []byte) error { - type embed NetworksGetResponseNetwork - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *n = NetworksGetResponseNetwork(unmarshaler.embed) - n.CreatedAt = unmarshaler.CreatedAt.Time() - n._rawJSON = json.RawMessage(data) - return nil -} - -func (n *NetworksGetResponseNetwork) MarshalJSON() ([]byte, error) { - type embed NetworksGetResponseNetwork - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - CreatedAt: core.NewDateTime(n.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (n *NetworksGetResponseNetwork) 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 NetworksListResponseNetworksItem 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 *NetworksListResponseNetworksItem) UnmarshalJSON(data []byte) error { - type embed NetworksListResponseNetworksItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *n = NetworksListResponseNetworksItem(unmarshaler.embed) - n.CreatedAt = unmarshaler.CreatedAt.Time() - n._rawJSON = json.RawMessage(data) - return nil -} - -func (n *NetworksListResponseNetworksItem) MarshalJSON() ([]byte, error) { - type embed NetworksListResponseNetworksItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*n), - CreatedAt: core.NewDateTime(n.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (n *NetworksListResponseNetworksItem) 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 ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting string const ( @@ -5200,60 +5807,6 @@ func (t ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting) Ptr() *The return &t } -type UserIdentitiesCreateResponseUserIdentity 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 *UserIdentitiesCreateResponseUserIdentity) UnmarshalJSON(data []byte) error { - type embed UserIdentitiesCreateResponseUserIdentity - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UserIdentitiesCreateResponseUserIdentity(unmarshaler.embed) - u.CreatedAt = unmarshaler.CreatedAt.Time() - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentitiesCreateResponseUserIdentity) MarshalJSON() ([]byte, error) { - type embed UserIdentitiesCreateResponseUserIdentity - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - CreatedAt: core.NewDateTime(u.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (u *UserIdentitiesCreateResponseUserIdentity) 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 UserIdentitiesGetRequestUserIdentityId struct { UserIdentityId string `json:"user_identity_id" url:"user_identity_id"` @@ -5311,111 +5864,3 @@ func (u *UserIdentitiesGetRequestUserIdentityKey) String() string { } return fmt.Sprintf("%#v", u) } - -type UserIdentitiesGetResponseUserIdentity 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 *UserIdentitiesGetResponseUserIdentity) UnmarshalJSON(data []byte) error { - type embed UserIdentitiesGetResponseUserIdentity - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UserIdentitiesGetResponseUserIdentity(unmarshaler.embed) - u.CreatedAt = unmarshaler.CreatedAt.Time() - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentitiesGetResponseUserIdentity) MarshalJSON() ([]byte, error) { - type embed UserIdentitiesGetResponseUserIdentity - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - CreatedAt: core.NewDateTime(u.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (u *UserIdentitiesGetResponseUserIdentity) 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 UserIdentitiesListResponseUserIdentitiesItem 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 *UserIdentitiesListResponseUserIdentitiesItem) UnmarshalJSON(data []byte) error { - type embed UserIdentitiesListResponseUserIdentitiesItem - var unmarshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UserIdentitiesListResponseUserIdentitiesItem(unmarshaler.embed) - u.CreatedAt = unmarshaler.CreatedAt.Time() - u._rawJSON = json.RawMessage(data) - return nil -} - -func (u *UserIdentitiesListResponseUserIdentitiesItem) MarshalJSON() ([]byte, error) { - type embed UserIdentitiesListResponseUserIdentitiesItem - var marshaler = struct { - embed - CreatedAt *core.DateTime `json:"created_at"` - }{ - embed: embed(*u), - CreatedAt: core.NewDateTime(u.CreatedAt), - } - return json.Marshal(marshaler) -} - -func (u *UserIdentitiesListResponseUserIdentitiesItem) 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 1dedc75..34a55be 100644 --- a/user_identities.go +++ b/user_identities.go @@ -85,8 +85,8 @@ func (u *UserIdentitiesAddAcsUserResponse) String() string { } type UserIdentitiesCreateResponse struct { - UserIdentity *UserIdentitiesCreateResponseUserIdentity `json:"user_identity,omitempty" url:"user_identity,omitempty"` - Ok bool `json:"ok" url:"ok"` + UserIdentity *UserIdentity `json:"user_identity,omitempty" url:"user_identity,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -201,8 +201,8 @@ func (u *UserIdentitiesGetRequest) Accept(visitor UserIdentitiesGetRequestVisito } type UserIdentitiesGetResponse struct { - UserIdentity *UserIdentitiesGetResponseUserIdentity `json:"user_identity,omitempty" url:"user_identity,omitempty"` - Ok bool `json:"ok" url:"ok"` + UserIdentity *UserIdentity `json:"user_identity,omitempty" url:"user_identity,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } @@ -260,6 +260,10 @@ func (u *UserIdentitiesGrantAccessToDeviceResponse) String() string { } type UserIdentitiesListAccessibleDevicesResponse struct { + Devices []*Device `json:"devices,omitempty" url:"devices,omitempty"` + // --- + // deprecated: use devices. + // --- AccessibleDevices []*Device `json:"accessible_devices,omitempty" url:"accessible_devices,omitempty"` Ok bool `json:"ok" url:"ok"` @@ -350,8 +354,8 @@ func (u *UserIdentitiesListAcsUsersResponse) String() string { } type UserIdentitiesListResponse struct { - UserIdentities []*UserIdentitiesListResponseUserIdentitiesItem `json:"user_identities,omitempty" url:"user_identities,omitempty"` - Ok bool `json:"ok" url:"ok"` + UserIdentities []*UserIdentity `json:"user_identities,omitempty" url:"user_identities,omitempty"` + Ok bool `json:"ok" url:"ok"` _rawJSON json.RawMessage } diff --git a/useridentities/client/client.go b/useridentities/client/client.go index 67d3be6..817fc2c 100644 --- a/useridentities/client/client.go +++ b/useridentities/client/client.go @@ -105,7 +105,7 @@ func (c *Client) Create( ctx context.Context, request *seamapigo.UserIdentitiesCreateRequest, opts ...option.RequestOption, -) (*seamapigo.UserIdentitiesCreateResponse, error) { +) (*seamapigo.UserIdentity, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -161,7 +161,7 @@ func (c *Client) Create( ); err != nil { return nil, err } - return response, nil + return response.UserIdentity, nil } func (c *Client) Delete( @@ -231,7 +231,7 @@ func (c *Client) Get( ctx context.Context, request *seamapigo.UserIdentitiesGetRequest, opts ...option.RequestOption, -) (*seamapigo.UserIdentitiesGetResponse, error) { +) (*seamapigo.UserIdentity, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -287,7 +287,7 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.UserIdentity, nil } func (c *Client) GrantAccessToDevice( @@ -357,7 +357,7 @@ func (c *Client) List( ctx context.Context, request *seamapigo.UserIdentitiesListRequest, opts ...option.RequestOption, -) ([]*seamapigo.UserIdentitiesListResponseUserIdentitiesItem, error) { +) ([]*seamapigo.UserIdentity, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -420,7 +420,7 @@ func (c *Client) ListAccessibleDevices( ctx context.Context, request *seamapigo.UserIdentitiesListAccessibleDevicesRequest, opts ...option.RequestOption, -) (*seamapigo.UserIdentitiesListAccessibleDevicesResponse, error) { +) ([]*seamapigo.Device, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -476,14 +476,14 @@ func (c *Client) ListAccessibleDevices( ); err != nil { return nil, err } - return response, nil + return response.Devices, nil } func (c *Client) ListAcsSystems( ctx context.Context, request *seamapigo.UserIdentitiesListAcsSystemsRequest, opts ...option.RequestOption, -) (*seamapigo.UserIdentitiesListAcsSystemsResponse, error) { +) ([]*seamapigo.AcsSystem, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -539,14 +539,14 @@ func (c *Client) ListAcsSystems( ); err != nil { return nil, err } - return response, nil + return response.AcsSystems, nil } func (c *Client) ListAcsUsers( ctx context.Context, request *seamapigo.UserIdentitiesListAcsUsersRequest, opts ...option.RequestOption, -) (*seamapigo.UserIdentitiesListAcsUsersResponse, error) { +) ([]*seamapigo.AcsUser, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -602,7 +602,7 @@ func (c *Client) ListAcsUsers( ); err != nil { return nil, err } - return response, nil + return response.AcsUsers, nil } func (c *Client) RemoveAcsUser( diff --git a/useridentities/enrollmentautomations/client.go b/useridentities/enrollmentautomations/client.go index 586206a..3c99074 100644 --- a/useridentities/enrollmentautomations/client.go +++ b/useridentities/enrollmentautomations/client.go @@ -102,7 +102,7 @@ func (c *Client) Get( ctx context.Context, request *useridentities.EnrollmentAutomationsGetRequest, opts ...option.RequestOption, -) (*useridentities.EnrollmentAutomationsGetResponse, error) { +) (*seamapigo.EnrollmentAutomation, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -158,14 +158,14 @@ func (c *Client) Get( ); err != nil { return nil, err } - return response, nil + return response.EnrollmentAutomation, nil } func (c *Client) Launch( ctx context.Context, request *useridentities.EnrollmentAutomationsLaunchRequest, opts ...option.RequestOption, -) (*useridentities.EnrollmentAutomationsLaunchResponse, error) { +) (*useridentities.EnrollmentAutomationsLaunchResponseEnrollmentAutomation, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -221,14 +221,14 @@ func (c *Client) Launch( ); err != nil { return nil, err } - return response, nil + return response.EnrollmentAutomation, nil } func (c *Client) List( ctx context.Context, request *useridentities.EnrollmentAutomationsListRequest, opts ...option.RequestOption, -) (*useridentities.EnrollmentAutomationsListResponse, error) { +) ([]*seamapigo.EnrollmentAutomation, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -284,5 +284,5 @@ func (c *Client) List( ); err != nil { return nil, err } - return response, nil + return response.EnrollmentAutomations, nil } diff --git a/workspaces/client.go b/workspaces/client.go index a418928..f74e991 100644 --- a/workspaces/client.go +++ b/workspaces/client.go @@ -38,7 +38,7 @@ func (c *Client) Create( ctx context.Context, request *seamapigo.WorkspacesCreateRequest, opts ...option.RequestOption, -) (*seamapigo.WorkspacesCreateResponse, error) { +) (*seamapigo.Workspace, error) { options := core.NewRequestOptions(opts...) baseURL := "https://connect.getseam.com" @@ -94,7 +94,7 @@ func (c *Client) Create( ); err != nil { return nil, err } - return response, nil + return response.Workspace, nil } func (c *Client) Get(