diff --git a/acs/credentials.go b/acs/credentials.go index 314e9b4..5b4eaf5 100644 --- a/acs/credentials.go +++ b/acs/credentials.go @@ -15,16 +15,14 @@ type CredentialsAssignRequest struct { } type CredentialsCreateRequest struct { - AcsUserId string `json:"acs_user_id"` - AccessMethod CredentialsCreateRequestAccessMethod `json:"access_method,omitempty"` - Code *string `json:"code,omitempty"` - IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` - AssaAbloyCredentialServiceMobileEndpointId *string `json:"assa_abloy_credential_service_mobile_endpoint_id,omitempty"` - ExternalType *CredentialsCreateRequestExternalType `json:"external_type,omitempty"` - CardFormat *CredentialsCreateRequestCardFormat `json:"card_format,omitempty"` - IsOverrideKey *bool `json:"is_override_key,omitempty"` - StartsAt *time.Time `json:"starts_at,omitempty"` - EndsAt *time.Time `json:"ends_at,omitempty"` + AcsUserId string `json:"acs_user_id"` + AccessMethod CredentialsCreateRequestAccessMethod `json:"access_method,omitempty"` + Code *string `json:"code,omitempty"` + IsMultiPhoneSyncCredential *bool `json:"is_multi_phone_sync_credential,omitempty"` + ExternalType *CredentialsCreateRequestExternalType `json:"external_type,omitempty"` + VisionlineMetadata *CredentialsCreateRequestVisionlineMetadata `json:"visionline_metadata,omitempty"` + StartsAt *time.Time `json:"starts_at,omitempty"` + EndsAt *time.Time `json:"ends_at,omitempty"` } type CredentialsDeleteRequest struct { @@ -90,28 +88,6 @@ func (c CredentialsCreateRequestAccessMethod) Ptr() *CredentialsCreateRequestAcc return &c } -type CredentialsCreateRequestCardFormat string - -const ( - CredentialsCreateRequestCardFormatTlCode CredentialsCreateRequestCardFormat = "TLCode" - CredentialsCreateRequestCardFormatRfid48 CredentialsCreateRequestCardFormat = "rfid48" -) - -func NewCredentialsCreateRequestCardFormatFromString(s string) (CredentialsCreateRequestCardFormat, error) { - switch s { - case "TLCode": - return CredentialsCreateRequestCardFormatTlCode, nil - case "rfid48": - return CredentialsCreateRequestCardFormatRfid48, nil - } - var t CredentialsCreateRequestCardFormat - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CredentialsCreateRequestCardFormat) Ptr() *CredentialsCreateRequestCardFormat { - return &c -} - type CredentialsCreateRequestExternalType string const ( @@ -140,6 +116,37 @@ func (c CredentialsCreateRequestExternalType) Ptr() *CredentialsCreateRequestExt return &c } +type CredentialsCreateRequestVisionlineMetadata struct { + AssaAbloyCredentialServiceMobileEndpointId *string `json:"assa_abloy_credential_service_mobile_endpoint_id,omitempty"` + CardFormat *CredentialsCreateRequestVisionlineMetadataCardFormat `json:"card_format,omitempty"` + IsOverrideKey *bool `json:"is_override_key,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CredentialsCreateRequestVisionlineMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler CredentialsCreateRequestVisionlineMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CredentialsCreateRequestVisionlineMetadata(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CredentialsCreateRequestVisionlineMetadata) 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 CredentialsCreateResponse struct { AcsCredential *CredentialsCreateResponseAcsCredential `json:"acs_credential,omitempty"` Ok bool `json:"ok"` diff --git a/acs/types.go b/acs/types.go index be9c684..6985ea0 100644 --- a/acs/types.go +++ b/acs/types.go @@ -189,6 +189,28 @@ func (c CredentialsAssignResponseAcsCredentialExternalType) Ptr() *CredentialsAs return &c } +type CredentialsCreateRequestVisionlineMetadataCardFormat string + +const ( + CredentialsCreateRequestVisionlineMetadataCardFormatTlCode CredentialsCreateRequestVisionlineMetadataCardFormat = "TLCode" + CredentialsCreateRequestVisionlineMetadataCardFormatRfid48 CredentialsCreateRequestVisionlineMetadataCardFormat = "rfid48" +) + +func NewCredentialsCreateRequestVisionlineMetadataCardFormatFromString(s string) (CredentialsCreateRequestVisionlineMetadataCardFormat, error) { + switch s { + case "TLCode": + return CredentialsCreateRequestVisionlineMetadataCardFormatTlCode, nil + case "rfid48": + return CredentialsCreateRequestVisionlineMetadataCardFormatRfid48, nil + } + var t CredentialsCreateRequestVisionlineMetadataCardFormat + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CredentialsCreateRequestVisionlineMetadataCardFormat) Ptr() *CredentialsCreateRequestVisionlineMetadataCardFormat { + return &c +} + type CredentialsCreateResponseAcsCredential struct { AcsCredentialId string `json:"acs_credential_id"` AcsUserId *string `json:"acs_user_id,omitempty"` diff --git a/core/client_option.go b/core/client_option.go index faa4b9e..e50913c 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.4") + headers.Set("X-Fern-SDK-Version", "v0.2.5") return headers } diff --git a/noisesensors/noisethresholds/client.go b/noisesensors/noisethresholds/client.go index cde4298..f05fb71 100644 --- a/noisesensors/noisethresholds/client.go +++ b/noisesensors/noisethresholds/client.go @@ -32,7 +32,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -func (c *Client) Create(ctx context.Context, request *noisesensors.NoiseThresholdsCreateRequest) (*seamapigo.ActionAttempt, error) { +func (c *Client) Create(ctx context.Context, request *noisesensors.NoiseThresholdsCreateRequest) (*seamapigo.NoiseThreshold, error) { baseURL := "https://connect.getseam.com" if c.baseURL != "" { baseURL = c.baseURL @@ -79,7 +79,7 @@ func (c *Client) Create(ctx context.Context, request *noisesensors.NoiseThreshol ); err != nil { return nil, err } - return response.ActionAttempt, nil + return response.NoiseThreshold, nil } func (c *Client) Delete(ctx context.Context, request *noisesensors.NoiseThresholdsDeleteRequest) (*seamapigo.ActionAttempt, error) {