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 20, 2024
1 parent 166d199 commit 9e35503
Show file tree
Hide file tree
Showing 11 changed files with 799 additions and 15 deletions.
434 changes: 434 additions & 0 deletions acs/types.go

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions acs/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`

Expand Down
16 changes: 10 additions & 6 deletions acs/users/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,19 +65,21 @@ func (c *Client) AddToAccessGroup(ctx context.Context, request *acs.UsersAddToAc
return apiError
}

var response *acs.UsersAddToAccessGroupResponse
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 err
return nil, err
}
return nil
return response, nil
}

func (c *Client) Create(ctx context.Context, request *acs.UsersCreateRequest) (*acs.UsersCreateResponse, error) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -363,19 +365,21 @@ func (c *Client) RemoveFromAccessGroup(ctx context.Context, request *acs.UsersRe
return apiError
}

var response *acs.UsersRemoveFromAccessGroupResponse
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 err
return nil, err
}
return nil
return response, nil
}

func (c *Client) RevokeAccessToAllEntrances(ctx context.Context, request *acs.UsersRevokeAccessToAllEntrancesRequest) (*acs.UsersRevokeAccessToAllEntrancesResponse, error) {
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.2.9")
headers.Set("X-Fern-SDK-Version", "v0.2.10")
return headers
}
33 changes: 33 additions & 0 deletions phones.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
50 changes: 50 additions & 0 deletions phones/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
51 changes: 43 additions & 8 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
37 changes: 37 additions & 0 deletions user_identities.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Loading

0 comments on commit 9e35503

Please sign in to comment.