Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Feb 8, 2024
1 parent 61f9976 commit e70f933
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 7 deletions.
1 change: 1 addition & 0 deletions access_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type AccessCodesCreateRequest struct {
type AccessCodesCreateMultipleRequest struct {
DeviceIds []string `json:"device_ids,omitempty"`
BehaviorWhenCodeCannotBeShared *AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared `json:"behavior_when_code_cannot_be_shared,omitempty"`
PreferredCodeLength *float64 `json:"preferred_code_length,omitempty"`
Name *string `json:"name,omitempty"`
StartsAt *string `json:"starts_at,omitempty"`
EndsAt *string `json:"ends_at,omitempty"`
Expand Down
21 changes: 21 additions & 0 deletions acs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ type CredentialsAssignResponseAcsCredential struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsAssignResponseAcsCredentialAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -192,6 +193,8 @@ func (c CredentialsAssignResponseAcsCredentialExternalType) Ptr() *CredentialsAs

type CredentialsAssignResponseAcsCredentialVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -246,6 +249,7 @@ type CredentialsCreateResponseAcsCredential struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsCreateResponseAcsCredentialAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -339,6 +343,8 @@ func (c CredentialsCreateResponseAcsCredentialExternalType) Ptr() *CredentialsCr

type CredentialsCreateResponseAcsCredentialVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -371,6 +377,7 @@ type CredentialsGetResponseAcsCredential struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsGetResponseAcsCredentialAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -464,6 +471,8 @@ func (c CredentialsGetResponseAcsCredentialExternalType) Ptr() *CredentialsGetRe

type CredentialsGetResponseAcsCredentialVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -613,6 +622,7 @@ type CredentialsListResponseAcsCredentialsItem struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsListResponseAcsCredentialsItemAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -706,6 +716,8 @@ func (c CredentialsListResponseAcsCredentialsItemExternalType) Ptr() *Credential

type CredentialsListResponseAcsCredentialsItemVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -738,6 +750,7 @@ type CredentialsUnassignResponseAcsCredential struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsUnassignResponseAcsCredentialAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -831,6 +844,8 @@ func (c CredentialsUnassignResponseAcsCredentialExternalType) Ptr() *Credentials

type CredentialsUnassignResponseAcsCredentialVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -863,6 +878,7 @@ type CredentialsUpdateResponseAcsCredential struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod CredentialsUpdateResponseAcsCredentialAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -956,6 +972,8 @@ func (c CredentialsUpdateResponseAcsCredentialExternalType) Ptr() *CredentialsUp

type CredentialsUpdateResponseAcsCredentialVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -1106,6 +1124,7 @@ type EntrancesListCredentialsWithAccessResponseAcsCredentialsItem struct {
AcsUserId *string `json:"acs_user_id,omitempty"`
AcsCredentialPoolId *string `json:"acs_credential_pool_id,omitempty"`
AcsSystemId string `json:"acs_system_id"`
ParentAcsCredentialId *string `json:"parent_acs_credential_id,omitempty"`
DisplayName string `json:"display_name"`
Code *string `json:"code,omitempty"`
AccessMethod EntrancesListCredentialsWithAccessResponseAcsCredentialsItemAccessMethod `json:"access_method,omitempty"`
Expand Down Expand Up @@ -1199,6 +1218,8 @@ func (e EntrancesListCredentialsWithAccessResponseAcsCredentialsItemExternalType

type EntrancesListCredentialsWithAccessResponseAcsCredentialsItemVisionlineMetadata struct {
JoinerAcsCredentialIds []string `json:"joiner_acs_credential_ids,omitempty"`
GuestAcsEntranceIds []string `json:"guest_acs_entrance_ids,omitempty"`
CommonAcsEntranceIds []string `json:"common_acs_entrance_ids,omitempty"`

_rawJSON json.RawMessage
}
Expand Down
33 changes: 33 additions & 0 deletions acs/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ type UsersRemoveFromAccessGroupRequest struct {
AcsAccessGroupId string `json:"acs_access_group_id"`
}

type UsersRevokeAccessToAllEntrancesRequest struct {
AcsUserId string `json:"acs_user_id"`
}

type UsersSuspendRequest struct {
AcsUserId string `json:"acs_user_id"`
}
Expand Down Expand Up @@ -234,6 +238,35 @@ func (u *UsersListResponse) String() string {
return fmt.Sprintf("%#v", u)
}

type UsersRevokeAccessToAllEntrancesResponse struct {
Ok bool `json:"ok"`

_rawJSON json.RawMessage
}

func (u *UsersRevokeAccessToAllEntrancesResponse) UnmarshalJSON(data []byte) error {
type unmarshaler UsersRevokeAccessToAllEntrancesResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*u = UsersRevokeAccessToAllEntrancesResponse(value)
u._rawJSON = json.RawMessage(data)
return nil
}

func (u *UsersRevokeAccessToAllEntrancesResponse) 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 UsersSuspendResponse struct {
Ok bool `json:"ok"`

Expand Down
50 changes: 50 additions & 0 deletions acs/users/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,56 @@ func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRe
return nil
}

func (c *Client) RevokeAccessToAllEntrances(ctx context.Context, request *acs.UsersRevokeAccessToAllEntrancesRequest) (*acs.UsersRevokeAccessToAllEntrancesResponse, error) {
baseURL := "https://connect.getseam.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "acs/users/revoke_access_to_all_entrances"

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
if err != nil {
return err
}
apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
decoder := json.NewDecoder(bytes.NewReader(raw))
switch statusCode {
case 400:
value := new(seamapigo.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return apiError
}
return value
case 401:
value := new(seamapigo.UnauthorizedError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return apiError
}
return value
}
return apiError
}

var response *acs.UsersRevokeAccessToAllEntrancesResponse
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) Suspend(ctx context.Context, request *acs.UsersSuspendRequest) (*acs.UsersSuspendResponse, error) {
baseURL := "https://connect.getseam.com"
if c.baseURL != "" {
Expand Down
3 changes: 3 additions & 0 deletions connect_webviews.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const (
AcceptedProviderAssaAbloyCredentialService AcceptedProvider = "assa_abloy_credential_service"
AcceptedProviderSeamBridge AcceptedProvider = "seam_bridge"
AcceptedProviderTedee AcceptedProvider = "tedee"
AcceptedProviderHoneywell AcceptedProvider = "honeywell"
AcceptedProviderYaleAccess AcceptedProvider = "yale_access"
AcceptedProviderHidCm AcceptedProvider = "hid_cm"
AcceptedProviderGoogleNest AcceptedProvider = "google_nest"
Expand Down Expand Up @@ -148,6 +149,8 @@ func NewAcceptedProviderFromString(s string) (AcceptedProvider, error) {
return AcceptedProviderSeamBridge, nil
case "tedee":
return AcceptedProviderTedee, nil
case "honeywell":
return AcceptedProviderHoneywell, nil
case "yale_access":
return AcceptedProviderYaleAccess, nil
case "hid_cm":
Expand Down
2 changes: 1 addition & 1 deletion core/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.4")
headers.Set("X-Fern-SDK-Version", "v0.2.8")
return headers
}
53 changes: 47 additions & 6 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ type DeviceProperties struct {
HubitatMetadata *DevicePropertiesHubitatMetadata `json:"hubitat_metadata,omitempty"`
DormakabaOracodeMetadata *DevicePropertiesDormakabaOracodeMetadata `json:"dormakaba_oracode_metadata,omitempty"`
WyzeMetadata *DevicePropertiesWyzeMetadata `json:"wyze_metadata,omitempty"`
TedeeMetadata *DevicePropertiesTedeeMetadata `json:"tedee_metadata,omitempty"`
ExperimentalSupportedCodeFromAccessCodesLengths []float64 `json:"_experimental_supported_code_from_access_codes_lengths,omitempty"`
CodeConstraints []*DevicePropertiesCodeConstraintsItem `json:"code_constraints,omitempty"`
SupportedCodeLengths []float64 `json:"supported_code_lengths,omitempty"`
Expand Down Expand Up @@ -1754,12 +1755,14 @@ func (d *DevicePropertiesCodeConstraintsItemZero) String() string {
type DevicePropertiesCodeConstraintsItemZeroConstraintType string

const (
DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoZeros DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_zeros"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotStartWith12 DevicePropertiesCodeConstraintsItemZeroConstraintType = "cannot_start_with_12"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoTripleConsecutiveInts DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_triple_consecutive_ints"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotSpecifyPinCode DevicePropertiesCodeConstraintsItemZeroConstraintType = "cannot_specify_pin_code"
DevicePropertiesCodeConstraintsItemZeroConstraintTypePinCodeMatchesExistingSet DevicePropertiesCodeConstraintsItemZeroConstraintType = "pin_code_matches_existing_set"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeStartDateInFuture DevicePropertiesCodeConstraintsItemZeroConstraintType = "start_date_in_future"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoZeros DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_zeros"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotStartWith12 DevicePropertiesCodeConstraintsItemZeroConstraintType = "cannot_start_with_12"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoTripleConsecutiveInts DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_triple_consecutive_ints"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeCannotSpecifyPinCode DevicePropertiesCodeConstraintsItemZeroConstraintType = "cannot_specify_pin_code"
DevicePropertiesCodeConstraintsItemZeroConstraintTypePinCodeMatchesExistingSet DevicePropertiesCodeConstraintsItemZeroConstraintType = "pin_code_matches_existing_set"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeStartDateInFuture DevicePropertiesCodeConstraintsItemZeroConstraintType = "start_date_in_future"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoAscendingOrDescendingSequence DevicePropertiesCodeConstraintsItemZeroConstraintType = "no_ascending_or_descending_sequence"
DevicePropertiesCodeConstraintsItemZeroConstraintTypeAtLeastThreeUniqueDigits DevicePropertiesCodeConstraintsItemZeroConstraintType = "at_least_three_unique_digits"
)

func NewDevicePropertiesCodeConstraintsItemZeroConstraintTypeFromString(s string) (DevicePropertiesCodeConstraintsItemZeroConstraintType, error) {
Expand All @@ -1776,6 +1779,10 @@ func NewDevicePropertiesCodeConstraintsItemZeroConstraintTypeFromString(s string
return DevicePropertiesCodeConstraintsItemZeroConstraintTypePinCodeMatchesExistingSet, nil
case "start_date_in_future":
return DevicePropertiesCodeConstraintsItemZeroConstraintTypeStartDateInFuture, nil
case "no_ascending_or_descending_sequence":
return DevicePropertiesCodeConstraintsItemZeroConstraintTypeNoAscendingOrDescendingSequence, nil
case "at_least_three_unique_digits":
return DevicePropertiesCodeConstraintsItemZeroConstraintTypeAtLeastThreeUniqueDigits, nil
}
var t DevicePropertiesCodeConstraintsItemZeroConstraintType
return "", fmt.Errorf("%s is not a valid %T", s, t)
Expand Down Expand Up @@ -2685,6 +2692,40 @@ func (d *DevicePropertiesSmartthingsMetadata) String() string {
return fmt.Sprintf("%#v", d)
}

type DevicePropertiesTedeeMetadata struct {
DeviceId float64 `json:"device_id"`
SerialNumber string `json:"serial_number"`
DeviceName string `json:"device_name"`
DeviceModel string `json:"device_model"`
BridgeId float64 `json:"bridge_id"`
BridgeName string `json:"bridge_name"`

_rawJSON json.RawMessage
}

func (d *DevicePropertiesTedeeMetadata) UnmarshalJSON(data []byte) error {
type unmarshaler DevicePropertiesTedeeMetadata
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DevicePropertiesTedeeMetadata(value)
d._rawJSON = json.RawMessage(data)
return nil
}

func (d *DevicePropertiesTedeeMetadata) 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 DevicePropertiesTtlockMetadata struct {
LockId float64 `json:"lock_id"`
LockAlias string `json:"lock_alias"`
Expand Down
Loading

0 comments on commit e70f933

Please sign in to comment.