From 9e35503682b81475cd817560ac87bc0ca6051091 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:18:04 +0000 Subject: [PATCH] SDK regeneration --- acs/types.go | 434 ++++++++++++++++++ acs/users.go | 58 +++ acs/users/client.go | 16 +- core/client_option.go | 2 +- phones.go | 33 ++ phones/client/client.go | 50 ++ types.go | 51 +- user_identities.go | 37 ++ useridentities/client/client.go | 50 ++ useridentities/enrollment_automations.go | 33 ++ .../enrollmentautomations/client.go | 50 ++ 11 files changed, 799 insertions(+), 15 deletions(-) diff --git a/acs/types.go b/acs/types.go index 9fc5a5c..6530a35 100644 --- a/acs/types.go +++ b/acs/types.go @@ -109,6 +109,8 @@ type CredentialsAssignResponseAcsCredential struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsAssignResponseAcsCredentialErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsAssignResponseAcsCredentialWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsAssignResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -163,6 +165,36 @@ func (c CredentialsAssignResponseAcsCredentialAccessMethod) Ptr() *CredentialsAs return &c } +type CredentialsAssignResponseAcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -222,6 +254,36 @@ func (c *CredentialsAssignResponseAcsCredentialVisionlineMetadata) String() stri return fmt.Sprintf("%#v", c) } +type CredentialsAssignResponseAcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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 ( @@ -259,6 +321,8 @@ type CredentialsCreateResponseAcsCredential struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsCreateResponseAcsCredentialErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsCreateResponseAcsCredentialWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsCreateResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -313,6 +377,36 @@ func (c CredentialsCreateResponseAcsCredentialAccessMethod) Ptr() *CredentialsCr return &c } +type CredentialsCreateResponseAcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -372,6 +466,36 @@ func (c *CredentialsCreateResponseAcsCredentialVisionlineMetadata) String() stri return fmt.Sprintf("%#v", c) } +type CredentialsCreateResponseAcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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"` AcsUserId *string `json:"acs_user_id,omitempty"` @@ -387,6 +511,8 @@ type CredentialsGetResponseAcsCredential struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsGetResponseAcsCredentialErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsGetResponseAcsCredentialWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsGetResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -441,6 +567,36 @@ func (c CredentialsGetResponseAcsCredentialAccessMethod) Ptr() *CredentialsGetRe return &c } +type CredentialsGetResponseAcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -500,6 +656,36 @@ func (c *CredentialsGetResponseAcsCredentialVisionlineMetadata) String() string return fmt.Sprintf("%#v", c) } +type CredentialsGetResponseAcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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 CredentialsListRequestOne struct { AcsSystemId string `json:"acs_system_id"` @@ -632,6 +818,8 @@ type CredentialsListResponseAcsCredentialsItem struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsListResponseAcsCredentialsItemErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsListResponseAcsCredentialsItemWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsListResponseAcsCredentialsItemVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -686,6 +874,36 @@ func (c CredentialsListResponseAcsCredentialsItemAccessMethod) Ptr() *Credential return &c } +type CredentialsListResponseAcsCredentialsItemErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -745,6 +963,36 @@ func (c *CredentialsListResponseAcsCredentialsItemVisionlineMetadata) String() s return fmt.Sprintf("%#v", c) } +type CredentialsListResponseAcsCredentialsItemWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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"` AcsUserId *string `json:"acs_user_id,omitempty"` @@ -760,6 +1008,8 @@ type CredentialsUnassignResponseAcsCredential struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsUnassignResponseAcsCredentialErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsUnassignResponseAcsCredentialWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsUnassignResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -814,6 +1064,36 @@ func (c CredentialsUnassignResponseAcsCredentialAccessMethod) Ptr() *Credentials return &c } +type CredentialsUnassignResponseAcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -873,6 +1153,36 @@ func (c *CredentialsUnassignResponseAcsCredentialVisionlineMetadata) String() st return fmt.Sprintf("%#v", c) } +type CredentialsUnassignResponseAcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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"` AcsUserId *string `json:"acs_user_id,omitempty"` @@ -888,6 +1198,8 @@ type CredentialsUpdateResponseAcsCredential struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*CredentialsUpdateResponseAcsCredentialErrorsItem `json:"errors,omitempty"` + Warnings []*CredentialsUpdateResponseAcsCredentialWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *CredentialsUpdateResponseAcsCredentialVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -942,6 +1254,36 @@ func (c CredentialsUpdateResponseAcsCredentialAccessMethod) Ptr() *CredentialsUp return &c } +type CredentialsUpdateResponseAcsCredentialErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -1001,6 +1343,36 @@ func (c *CredentialsUpdateResponseAcsCredentialVisionlineMetadata) String() stri return fmt.Sprintf("%#v", c) } +type CredentialsUpdateResponseAcsCredentialWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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"` DisplayName string `json:"display_name"` @@ -1166,6 +1538,8 @@ type EntrancesListCredentialsWithAccessResponseAcsCredentialsItem struct { WorkspaceId string `json:"workspace_id"` StartsAt *string `json:"starts_at,omitempty"` EndsAt *string `json:"ends_at,omitempty"` + Errors []*EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem `json:"errors,omitempty"` + Warnings []*EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem `json:"warnings,omitempty"` IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` VisionlineMetadata *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata `json:"visionline_metadata,omitempty"` @@ -1220,6 +1594,36 @@ func (e EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod return &e } +type EntrancesListCredentialsWithAccessResponseAcsCredentialsItemErrorsItem struct { + ErrorCode string `json:"error_code"` + Message string `json:"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 ( @@ -1279,6 +1683,36 @@ func (e *EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineM return fmt.Sprintf("%#v", e) } +type EntrancesListCredentialsWithAccessResponseAcsCredentialsItemWarningsItem struct { + WarningCode string `json:"warning_code"` + Message string `json:"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"` DisplayName string `json:"display_name"` diff --git a/acs/users.go b/acs/users.go index 5f397a1..c65594b 100644 --- a/acs/users.go +++ b/acs/users.go @@ -59,6 +59,35 @@ type UsersSuspendRequest struct { AcsUserId string `json:"acs_user_id"` } +type UsersAddToAccessGroupResponse struct { + Ok bool `json:"ok"` + + _rawJSON json.RawMessage +} + +func (u *UsersAddToAccessGroupResponse) UnmarshalJSON(data []byte) error { + type unmarshaler UsersAddToAccessGroupResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UsersAddToAccessGroupResponse(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UsersAddToAccessGroupResponse) 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 UsersCreateRequestAccessSchedule struct { StartsAt time.Time `json:"starts_at"` EndsAt time.Time `json:"ends_at"` @@ -238,6 +267,35 @@ func (u *UsersListResponse) String() string { return fmt.Sprintf("%#v", u) } +type UsersRemoveFromAccessGroupResponse struct { + Ok bool `json:"ok"` + + _rawJSON json.RawMessage +} + +func (u *UsersRemoveFromAccessGroupResponse) UnmarshalJSON(data []byte) error { + type unmarshaler UsersRemoveFromAccessGroupResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UsersRemoveFromAccessGroupResponse(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UsersRemoveFromAccessGroupResponse) 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 UsersRevokeAccessToAllEntrancesResponse struct { Ok bool `json:"ok"` diff --git a/acs/users/client.go b/acs/users/client.go index 5020f46..c7e7996 100644 --- a/acs/users/client.go +++ b/acs/users/client.go @@ -32,7 +32,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -func (c *Client) AddToAccessGroup(ctx context.Context, request *acs.UsersAddToAccessGroupRequest) error { +func (c *Client) AddToAccessGroup(ctx context.Context, request *acs.UsersAddToAccessGroupRequest) (*acs.UsersAddToAccessGroupResponse, error) { baseURL := "https://connect.getseam.com" if c.baseURL != "" { baseURL = c.baseURL @@ -65,6 +65,7 @@ func (c *Client) AddToAccessGroup(ctx context.Context, request *acs.UsersAddToAc return apiError } + var response *acs.UsersAddToAccessGroupResponse if err := c.caller.Call( ctx, &core.CallParams{ @@ -72,12 +73,13 @@ func (c *Client) AddToAccessGroup(ctx context.Context, request *acs.UsersAddToAc Method: http.MethodPost, Headers: c.header, Request: request, + Response: &response, ErrorDecoder: errorDecoder, }, ); err != nil { - return err + return nil, err } - return nil + return response, nil } func (c *Client) Create(ctx context.Context, request *acs.UsersCreateRequest) (*acs.UsersCreateResponse, error) { @@ -330,7 +332,7 @@ func (c *Client) ListAccessibleEntrances(ctx context.Context, request *acs.Users return response, nil } -func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRemoveFromAccessGroupRequest) error { +func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRemoveFromAccessGroupRequest) (*acs.UsersRemoveFromAccessGroupResponse, error) { baseURL := "https://connect.getseam.com" if c.baseURL != "" { baseURL = c.baseURL @@ -363,6 +365,7 @@ func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRe return apiError } + var response *acs.UsersRemoveFromAccessGroupResponse if err := c.caller.Call( ctx, &core.CallParams{ @@ -370,12 +373,13 @@ func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRe Method: http.MethodPost, Headers: c.header, Request: request, + Response: &response, ErrorDecoder: errorDecoder, }, ); err != nil { - return err + return nil, err } - return nil + return response, nil } func (c *Client) RevokeAccessToAllEntrances(ctx context.Context, request *acs.UsersRevokeAccessToAllEntrancesRequest) (*acs.UsersRevokeAccessToAllEntrancesResponse, error) { diff --git a/core/client_option.go b/core/client_option.go index b3a28d6..161c8ac 100644 --- a/core/client_option.go +++ b/core/client_option.go @@ -50,6 +50,6 @@ func (c *ClientOptions) cloneHeader() http.Header { headers := c.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/seamapi/go") - headers.Set("X-Fern-SDK-Version", "v0.2.9") + headers.Set("X-Fern-SDK-Version", "v0.2.10") return headers } diff --git a/phones.go b/phones.go index 61bb9ba..c7ddced 100644 --- a/phones.go +++ b/phones.go @@ -8,10 +8,43 @@ import ( core "github.com/seamapi/go/core" ) +type PhonesDeactivateRequest struct { + DeviceId string `json:"device_id"` +} + type PhonesListRequest struct { OwnerUserIdentityId *string `json:"owner_user_identity_id,omitempty"` } +type PhonesDeactivateResponse struct { + Ok bool `json:"ok"` + + _rawJSON json.RawMessage +} + +func (p *PhonesDeactivateResponse) UnmarshalJSON(data []byte) error { + type unmarshaler PhonesDeactivateResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PhonesDeactivateResponse(value) + p._rawJSON = json.RawMessage(data) + return nil +} + +func (p *PhonesDeactivateResponse) String() string { + if len(p._rawJSON) > 0 { + if value, err := core.StringifyJSON(p._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + type PhonesListResponse struct { Phones []*Phone `json:"phones,omitempty"` Ok bool `json:"ok"` diff --git a/phones/client/client.go b/phones/client/client.go index 053ae4a..66b5a47 100644 --- a/phones/client/client.go +++ b/phones/client/client.go @@ -35,6 +35,56 @@ func NewClient(opts ...core.ClientOption) *Client { } } +func (c *Client) Deactivate(ctx context.Context, request *seamapigo.PhonesDeactivateRequest) (*seamapigo.PhonesDeactivateResponse, error) { + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "phones/deactivate" + + 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.PhonesDeactivateResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: c.header, + Request: request, + Response: &response, + ErrorDecoder: errorDecoder, + }, + ); err != nil { + return nil, err + } + return response, nil +} + func (c *Client) List(ctx context.Context, request *seamapigo.PhonesListRequest) ([]*seamapigo.Phone, error) { baseURL := "https://connect.getseam.com" if c.baseURL != "" { diff --git a/types.go b/types.go index 4b047a4..21f001f 100644 --- a/types.go +++ b/types.go @@ -1111,8 +1111,10 @@ type Device struct { // Date and time at which the device object was created. CreatedAt time.Time `json:"created_at"` // Indicates whether Seam manages the device. - IsManaged bool `json:"is_managed"` - CustomMetadata map[string]*DeviceCustomMetadataValue `json:"custom_metadata,omitempty"` + IsManaged bool `json:"is_managed"` + CustomMetadata map[string]*DeviceCustomMetadataValue `json:"custom_metadata,omitempty"` + CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty"` + CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty"` _rawJSON json.RawMessage } @@ -1361,6 +1363,7 @@ type DeviceProperties struct { IgloohomeMetadata *DevicePropertiesIgloohomeMetadata `json:"igloohome_metadata,omitempty"` NestMetadata *DevicePropertiesNestMetadata `json:"nest_metadata,omitempty"` EcobeeMetadata *DevicePropertiesEcobeeMetadata `json:"ecobee_metadata,omitempty"` + HoneywellMetadata *DevicePropertiesHoneywellMetadata `json:"honeywell_metadata,omitempty"` HubitatMetadata *DevicePropertiesHubitatMetadata `json:"hubitat_metadata,omitempty"` DormakabaOracodeMetadata *DevicePropertiesDormakabaOracodeMetadata `json:"dormakaba_oracode_metadata,omitempty"` WyzeMetadata *DevicePropertiesWyzeMetadata `json:"wyze_metadata,omitempty"` @@ -1987,6 +1990,36 @@ func (d *DevicePropertiesGenieMetadata) String() string { return fmt.Sprintf("%#v", d) } +type DevicePropertiesHoneywellMetadata struct { + HoneywellDeviceId string `json:"honeywell_device_id"` + DeviceName string `json:"device_name"` + + _rawJSON json.RawMessage +} + +func (d *DevicePropertiesHoneywellMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler DevicePropertiesHoneywellMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DevicePropertiesHoneywellMetadata(value) + d._rawJSON = json.RawMessage(data) + return nil +} + +func (d *DevicePropertiesHoneywellMetadata) 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 DevicePropertiesHubitatMetadata struct { DeviceId string `json:"device_id"` DeviceName string `json:"device_name"` @@ -2576,10 +2609,10 @@ func (d *DevicePropertiesSaltoMetadata) String() string { } type DevicePropertiesSchlageMetadata struct { - DeviceId string `json:"device_id"` - DeviceName string `json:"device_name"` - AccessCodeLength float64 `json:"access_code_length"` - Model *string `json:"model,omitempty"` + DeviceId string `json:"device_id"` + DeviceName string `json:"device_name"` + AccessCodeLength *float64 `json:"access_code_length,omitempty"` + Model *string `json:"model,omitempty"` _rawJSON json.RawMessage } @@ -3493,8 +3526,10 @@ type Phone struct { // Date and time at which the device object was created. CreatedAt time.Time `json:"created_at"` // Indicates whether Seam manages the device. - IsManaged bool `json:"is_managed"` - CustomMetadata map[string]*PhoneCustomMetadataValue `json:"custom_metadata,omitempty"` + IsManaged bool `json:"is_managed"` + CustomMetadata map[string]*PhoneCustomMetadataValue `json:"custom_metadata,omitempty"` + CanRemotelyUnlock *bool `json:"can_remotely_unlock,omitempty"` + CanProgramOnlineAccessCodes *bool `json:"can_program_online_access_codes,omitempty"` _rawJSON json.RawMessage } diff --git a/user_identities.go b/user_identities.go index a9f4039..f5d726c 100644 --- a/user_identities.go +++ b/user_identities.go @@ -432,3 +432,40 @@ func (u *UserIdentitiesRevokeAccessToDeviceResponse) String() string { } return fmt.Sprintf("%#v", u) } + +type UserIdentitiesUpdateResponse struct { + Ok bool `json:"ok"` + + _rawJSON json.RawMessage +} + +func (u *UserIdentitiesUpdateResponse) UnmarshalJSON(data []byte) error { + type unmarshaler UserIdentitiesUpdateResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UserIdentitiesUpdateResponse(value) + u._rawJSON = json.RawMessage(data) + return nil +} + +func (u *UserIdentitiesUpdateResponse) 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 UserIdentitiesUpdateRequest struct { + UserIdentityId string `json:"user_identity_id"` + UserIdentityKey *string `json:"user_identity_key,omitempty"` + EmailAddress *string `json:"email_address,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + FullName *string `json:"full_name,omitempty"` +} diff --git a/useridentities/client/client.go b/useridentities/client/client.go index f0a4fff..1d24f2a 100644 --- a/useridentities/client/client.go +++ b/useridentities/client/client.go @@ -583,3 +583,53 @@ func (c *Client) RevokeAccessToDevice(ctx context.Context, request *seamapigo.Us } return response, nil } + +func (c *Client) Update(ctx context.Context, request *seamapigo.UserIdentitiesUpdateRequest) (*seamapigo.UserIdentitiesUpdateResponse, error) { + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "user_identities/update" + + 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.UserIdentitiesUpdateResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: c.header, + Request: request, + Response: &response, + ErrorDecoder: errorDecoder, + }, + ); err != nil { + return nil, err + } + return response, nil +} diff --git a/useridentities/enrollment_automations.go b/useridentities/enrollment_automations.go index ec4526b..9965c95 100644 --- a/useridentities/enrollment_automations.go +++ b/useridentities/enrollment_automations.go @@ -9,6 +9,10 @@ import ( core "github.com/seamapi/go/core" ) +type EnrollmentAutomationsDeleteRequest struct { + EnrollmentAutomationId string `json:"enrollment_automation_id"` +} + type EnrollmentAutomationsGetRequest struct { EnrollmentAutomationId string `json:"enrollment_automation_id"` } @@ -25,6 +29,35 @@ type EnrollmentAutomationsListRequest struct { UserIdentityId string `json:"user_identity_id"` } +type EnrollmentAutomationsDeleteResponse struct { + Ok bool `json:"ok"` + + _rawJSON json.RawMessage +} + +func (e *EnrollmentAutomationsDeleteResponse) UnmarshalJSON(data []byte) error { + type unmarshaler EnrollmentAutomationsDeleteResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = EnrollmentAutomationsDeleteResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *EnrollmentAutomationsDeleteResponse) 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 EnrollmentAutomationsGetResponse struct { EnrollmentAutomation *seamapigo.EnrollmentAutomation `json:"enrollment_automation,omitempty"` Ok bool `json:"ok"` diff --git a/useridentities/enrollmentautomations/client.go b/useridentities/enrollmentautomations/client.go index f4fb092..7579b90 100644 --- a/useridentities/enrollmentautomations/client.go +++ b/useridentities/enrollmentautomations/client.go @@ -32,6 +32,56 @@ func NewClient(opts ...core.ClientOption) *Client { } } +func (c *Client) Delete(ctx context.Context, request *useridentities.EnrollmentAutomationsDeleteRequest) (*useridentities.EnrollmentAutomationsDeleteResponse, error) { + baseURL := "https://connect.getseam.com" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "user_identities/enrollment_automations/delete" + + 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 *useridentities.EnrollmentAutomationsDeleteResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: c.header, + Request: request, + Response: &response, + ErrorDecoder: errorDecoder, + }, + ); err != nil { + return nil, err + } + return response, nil +} + func (c *Client) Get(ctx context.Context, request *useridentities.EnrollmentAutomationsGetRequest) (*useridentities.EnrollmentAutomationsGetResponse, error) { baseURL := "https://connect.getseam.com" if c.baseURL != "" {