diff --git a/client/client.go b/client/client.go index eee1d14..cd1df68 100644 --- a/client/client.go +++ b/client/client.go @@ -32,10 +32,10 @@ type Client struct { AccessCodes *accesscodesclient.Client ActionAttempts *actionattempts.Client ClientSessions *clientsessions.Client + ConnectWebviews *connectwebviews.Client ConnectedAccounts *connectedaccounts.Client Devices *devicesclient.Client Events *events.Client - ConnectWebviews *connectwebviews.Client Locks *locks.Client Networks *networks.Client Phones *phonesclient.Client @@ -61,10 +61,10 @@ func NewClient(opts ...option.RequestOption) *Client { AccessCodes: accesscodesclient.NewClient(opts...), ActionAttempts: actionattempts.NewClient(opts...), ClientSessions: clientsessions.NewClient(opts...), + ConnectWebviews: connectwebviews.NewClient(opts...), ConnectedAccounts: connectedaccounts.NewClient(opts...), Devices: devicesclient.NewClient(opts...), Events: events.NewClient(opts...), - ConnectWebviews: connectwebviews.NewClient(opts...), Locks: locks.NewClient(opts...), Networks: networks.NewClient(opts...), Phones: phonesclient.NewClient(opts...), diff --git a/core/request_option.go b/core/request_option.go index 72216ed..0bffde7 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -58,7 +58,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/seamapi/go") - headers.Set("X-Fern-SDK-Version", "v0.3.3") + headers.Set("X-Fern-SDK-Version", "v0.3.4") return headers } diff --git a/types.go b/types.go index 2a15c12..6066cbc 100644 --- a/types.go +++ b/types.go @@ -626,6 +626,7 @@ type AcsEntrance struct { 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"` + Errors []*AcsEntranceErrorsItem `json:"errors,omitempty" url:"errors,omitempty"` VisionlineMetadata *AcsEntranceVisionlineMetadata `json:"visionline_metadata,omitempty" url:"visionline_metadata,omitempty"` _rawJSON json.RawMessage @@ -672,6 +673,36 @@ func (a *AcsEntrance) String() string { return fmt.Sprintf("%#v", a) } +type AcsEntranceErrorsItem struct { + ErrorCode string `json:"error_code" url:"error_code"` + Message string `json:"message" url:"message"` + + _rawJSON json.RawMessage +} + +func (a *AcsEntranceErrorsItem) UnmarshalJSON(data []byte) error { + type unmarshaler AcsEntranceErrorsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AcsEntranceErrorsItem(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AcsEntranceErrorsItem) 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"` @@ -2507,45 +2538,24 @@ func (d *DevicePropertiesCodeConstraintsItem) Accept(visitor DevicePropertiesCod } type DevicePropertiesCodeConstraintsItemMaxLength struct { - MinLength *float64 `json:"min_length,omitempty" url:"min_length,omitempty"` - MaxLength *float64 `json:"max_length,omitempty" url:"max_length,omitempty"` - constraintType string + ConstraintType DevicePropertiesCodeConstraintsItemMaxLengthConstraintType `json:"constraint_type,omitempty" url:"constraint_type,omitempty"` + MinLength *float64 `json:"min_length,omitempty" url:"min_length,omitempty"` + MaxLength *float64 `json:"max_length,omitempty" url:"max_length,omitempty"` _rawJSON json.RawMessage } -func (d *DevicePropertiesCodeConstraintsItemMaxLength) ConstraintType() string { - return d.constraintType -} - func (d *DevicePropertiesCodeConstraintsItemMaxLength) UnmarshalJSON(data []byte) error { - type embed DevicePropertiesCodeConstraintsItemMaxLength - var unmarshaler = struct { - embed - }{ - embed: embed(*d), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + type unmarshaler DevicePropertiesCodeConstraintsItemMaxLength + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DevicePropertiesCodeConstraintsItemMaxLength(unmarshaler.embed) - d.constraintType = "name_length" + *d = DevicePropertiesCodeConstraintsItemMaxLength(value) d._rawJSON = json.RawMessage(data) return nil } -func (d *DevicePropertiesCodeConstraintsItemMaxLength) MarshalJSON() ([]byte, error) { - type embed DevicePropertiesCodeConstraintsItemMaxLength - var marshaler = struct { - embed - ConstraintType string `json:"constraint_type"` - }{ - embed: embed(*d), - ConstraintType: "name_length", - } - return json.Marshal(marshaler) -} - func (d *DevicePropertiesCodeConstraintsItemMaxLength) String() string { if len(d._rawJSON) > 0 { if value, err := core.StringifyJSON(d._rawJSON); err == nil { @@ -2558,6 +2568,28 @@ func (d *DevicePropertiesCodeConstraintsItemMaxLength) String() string { return fmt.Sprintf("%#v", d) } +type DevicePropertiesCodeConstraintsItemMaxLengthConstraintType string + +const ( + DevicePropertiesCodeConstraintsItemMaxLengthConstraintTypeNameLength DevicePropertiesCodeConstraintsItemMaxLengthConstraintType = "name_length" + DevicePropertiesCodeConstraintsItemMaxLengthConstraintTypeNameMustBeUnique DevicePropertiesCodeConstraintsItemMaxLengthConstraintType = "name_must_be_unique" +) + +func NewDevicePropertiesCodeConstraintsItemMaxLengthConstraintTypeFromString(s string) (DevicePropertiesCodeConstraintsItemMaxLengthConstraintType, error) { + switch s { + case "name_length": + return DevicePropertiesCodeConstraintsItemMaxLengthConstraintTypeNameLength, nil + case "name_must_be_unique": + return DevicePropertiesCodeConstraintsItemMaxLengthConstraintTypeNameMustBeUnique, nil + } + var t DevicePropertiesCodeConstraintsItemMaxLengthConstraintType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DevicePropertiesCodeConstraintsItemMaxLengthConstraintType) Ptr() *DevicePropertiesCodeConstraintsItemMaxLengthConstraintType { + return &d +} + type DevicePropertiesCodeConstraintsItemZero struct { ConstraintType DevicePropertiesCodeConstraintsItemZeroConstraintType `json:"constraint_type,omitempty" url:"constraint_type,omitempty"`