mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.0 KiB
Go
231 lines
6.0 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the KmsKmsToken type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KmsKmsToken{}
|
|
|
|
// KmsKmsToken struct for KmsKmsToken
|
|
type KmsKmsToken struct {
|
|
// AccessToken is IAM's own JWT, verbatim. Its `owner` claim scopes it to exactly one org, which is what every secret operation then reads.
|
|
AccessToken *string `json:"accessToken,omitempty"`
|
|
// ExpiresIn is the token's lifetime in seconds, as IAM reported it.
|
|
ExpiresIn *int64 `json:"expiresIn,omitempty"`
|
|
// TokenType is `Bearer`.
|
|
TokenType *string `json:"tokenType,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KmsKmsToken KmsKmsToken
|
|
|
|
// NewKmsKmsToken instantiates a new KmsKmsToken object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewKmsKmsToken() *KmsKmsToken {
|
|
this := KmsKmsToken{}
|
|
return &this
|
|
}
|
|
|
|
// NewKmsKmsTokenWithDefaults instantiates a new KmsKmsToken object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewKmsKmsTokenWithDefaults() *KmsKmsToken {
|
|
this := KmsKmsToken{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccessToken returns the AccessToken field value if set, zero value otherwise.
|
|
func (o *KmsKmsToken) GetAccessToken() string {
|
|
if o == nil || IsNil(o.AccessToken) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.AccessToken
|
|
}
|
|
|
|
// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KmsKmsToken) GetAccessTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.AccessToken) {
|
|
return nil, false
|
|
}
|
|
return o.AccessToken, true
|
|
}
|
|
|
|
// HasAccessToken returns a boolean if a field has been set.
|
|
func (o *KmsKmsToken) HasAccessToken() bool {
|
|
if o != nil && !IsNil(o.AccessToken) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field.
|
|
func (o *KmsKmsToken) SetAccessToken(v string) {
|
|
o.AccessToken = &v
|
|
}
|
|
|
|
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
|
|
func (o *KmsKmsToken) GetExpiresIn() int64 {
|
|
if o == nil || IsNil(o.ExpiresIn) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.ExpiresIn
|
|
}
|
|
|
|
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KmsKmsToken) GetExpiresInOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.ExpiresIn) {
|
|
return nil, false
|
|
}
|
|
return o.ExpiresIn, true
|
|
}
|
|
|
|
// HasExpiresIn returns a boolean if a field has been set.
|
|
func (o *KmsKmsToken) HasExpiresIn() bool {
|
|
if o != nil && !IsNil(o.ExpiresIn) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresIn gets a reference to the given int64 and assigns it to the ExpiresIn field.
|
|
func (o *KmsKmsToken) SetExpiresIn(v int64) {
|
|
o.ExpiresIn = &v
|
|
}
|
|
|
|
// GetTokenType returns the TokenType field value if set, zero value otherwise.
|
|
func (o *KmsKmsToken) GetTokenType() string {
|
|
if o == nil || IsNil(o.TokenType) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TokenType
|
|
}
|
|
|
|
// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KmsKmsToken) GetTokenTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TokenType) {
|
|
return nil, false
|
|
}
|
|
return o.TokenType, true
|
|
}
|
|
|
|
// HasTokenType returns a boolean if a field has been set.
|
|
func (o *KmsKmsToken) HasTokenType() bool {
|
|
if o != nil && !IsNil(o.TokenType) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokenType gets a reference to the given string and assigns it to the TokenType field.
|
|
func (o *KmsKmsToken) SetTokenType(v string) {
|
|
o.TokenType = &v
|
|
}
|
|
|
|
func (o KmsKmsToken) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KmsKmsToken) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AccessToken) {
|
|
toSerialize["accessToken"] = o.AccessToken
|
|
}
|
|
if !IsNil(o.ExpiresIn) {
|
|
toSerialize["expiresIn"] = o.ExpiresIn
|
|
}
|
|
if !IsNil(o.TokenType) {
|
|
toSerialize["tokenType"] = o.TokenType
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *KmsKmsToken) UnmarshalJSON(data []byte) (err error) {
|
|
varKmsKmsToken := _KmsKmsToken{}
|
|
|
|
err = json.Unmarshal(data, &varKmsKmsToken)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KmsKmsToken(varKmsKmsToken)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "accessToken")
|
|
delete(additionalProperties, "expiresIn")
|
|
delete(additionalProperties, "tokenType")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableKmsKmsToken struct {
|
|
value *KmsKmsToken
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKmsKmsToken) Get() *KmsKmsToken {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKmsKmsToken) Set(val *KmsKmsToken) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKmsKmsToken) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKmsKmsToken) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKmsKmsToken(val *KmsKmsToken) *NullableKmsKmsToken {
|
|
return &NullableKmsKmsToken{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKmsKmsToken) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKmsKmsToken) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|