Skip to content

Commit

Permalink
SDK regeneration (#25)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Feb 2, 2024
1 parent be88b45 commit d591872
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 35 deletions.
71 changes: 39 additions & 32 deletions acs/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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"`
Expand Down
22 changes: 22 additions & 0 deletions acs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
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.4")
headers.Set("X-Fern-SDK-Version", "v0.2.5")
return headers
}
4 changes: 2 additions & 2 deletions noisesensors/noisethresholds/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) 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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d591872

Please sign in to comment.