Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api)!: authentication method type is an enum, not a plain string #214

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 36
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch-6c0cb9620225dbe9e7180b514e51b2cd94753565749de1603e77d065cb531be1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch-aeb62bc4875f4eb1b2ae1f75ef9521e92022e863cba2ae67f907ed27ca93d527.yml
24 changes: 22 additions & 2 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ func (r introspectionJSON) RawJSON() string {

type IntrospectionAuthenticationMethod struct {
ConnectionStatus IntrospectionAuthenticationMethodsConnectionStatus `json:"connection_status"`
Type string `json:"type"`
JSON introspectionAuthenticationMethodJSON `json:"-"`
// The type of authentication method.
Type IntrospectionAuthenticationMethodsType `json:"type"`
JSON introspectionAuthenticationMethodJSON `json:"-"`
}

// introspectionAuthenticationMethodJSON contains the JSON metadata for the struct
Expand Down Expand Up @@ -167,6 +168,25 @@ func (r introspectionAuthenticationMethodsConnectionStatusJSON) RawJSON() string
return r.raw
}

// The type of authentication method.
type IntrospectionAuthenticationMethodsType string

const (
IntrospectionAuthenticationMethodsTypeAssisted IntrospectionAuthenticationMethodsType = "assisted"
IntrospectionAuthenticationMethodsTypeCredential IntrospectionAuthenticationMethodsType = "credential"
IntrospectionAuthenticationMethodsTypeAPIToken IntrospectionAuthenticationMethodsType = "api_token"
IntrospectionAuthenticationMethodsTypeAPICredential IntrospectionAuthenticationMethodsType = "api_credential"
IntrospectionAuthenticationMethodsTypeOAuth IntrospectionAuthenticationMethodsType = "oauth"
)

func (r IntrospectionAuthenticationMethodsType) IsKnown() bool {
switch r {
case IntrospectionAuthenticationMethodsTypeAssisted, IntrospectionAuthenticationMethodsTypeCredential, IntrospectionAuthenticationMethodsTypeAPIToken, IntrospectionAuthenticationMethodsTypeAPICredential, IntrospectionAuthenticationMethodsTypeOAuth:
return true
}
return false
}

// The type of application associated with a token.
type IntrospectionClientType string

Expand Down