mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.0 KiB
Go
269 lines
7.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 ProviderTokenOut type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProviderTokenOut{}
|
|
|
|
// ProviderTokenOut struct for ProviderTokenOut
|
|
type ProviderTokenOut struct {
|
|
// ExpiresAt is when this token expires, RFC 3339 UTC; empty if non-expiring.
|
|
ExpiresAt *string `json:"expiresAt,omitempty"`
|
|
// Label is the connector's label.
|
|
Label *string `json:"label,omitempty"`
|
|
// Provider is the connector's provider id.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Token is the access token, rotated first if it was within the refresh window.
|
|
Token *string `json:"token,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProviderTokenOut ProviderTokenOut
|
|
|
|
// NewProviderTokenOut instantiates a new ProviderTokenOut 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 NewProviderTokenOut() *ProviderTokenOut {
|
|
this := ProviderTokenOut{}
|
|
return &this
|
|
}
|
|
|
|
// NewProviderTokenOutWithDefaults instantiates a new ProviderTokenOut 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 NewProviderTokenOutWithDefaults() *ProviderTokenOut {
|
|
this := ProviderTokenOut{}
|
|
return &this
|
|
}
|
|
|
|
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
|
|
func (o *ProviderTokenOut) GetExpiresAt() string {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ExpiresAt
|
|
}
|
|
|
|
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderTokenOut) GetExpiresAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
return nil, false
|
|
}
|
|
return o.ExpiresAt, true
|
|
}
|
|
|
|
// HasExpiresAt returns a boolean if a field has been set.
|
|
func (o *ProviderTokenOut) HasExpiresAt() bool {
|
|
if o != nil && !IsNil(o.ExpiresAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field.
|
|
func (o *ProviderTokenOut) SetExpiresAt(v string) {
|
|
o.ExpiresAt = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *ProviderTokenOut) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderTokenOut) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *ProviderTokenOut) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *ProviderTokenOut) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *ProviderTokenOut) GetProvider() string {
|
|
if o == nil || IsNil(o.Provider) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Provider
|
|
}
|
|
|
|
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderTokenOut) GetProviderOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Provider) {
|
|
return nil, false
|
|
}
|
|
return o.Provider, true
|
|
}
|
|
|
|
// HasProvider returns a boolean if a field has been set.
|
|
func (o *ProviderTokenOut) HasProvider() bool {
|
|
if o != nil && !IsNil(o.Provider) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
|
func (o *ProviderTokenOut) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetToken returns the Token field value if set, zero value otherwise.
|
|
func (o *ProviderTokenOut) GetToken() string {
|
|
if o == nil || IsNil(o.Token) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token
|
|
}
|
|
|
|
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderTokenOut) GetTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token) {
|
|
return nil, false
|
|
}
|
|
return o.Token, true
|
|
}
|
|
|
|
// HasToken returns a boolean if a field has been set.
|
|
func (o *ProviderTokenOut) HasToken() bool {
|
|
if o != nil && !IsNil(o.Token) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken gets a reference to the given string and assigns it to the Token field.
|
|
func (o *ProviderTokenOut) SetToken(v string) {
|
|
o.Token = &v
|
|
}
|
|
|
|
func (o ProviderTokenOut) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProviderTokenOut) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ExpiresAt) {
|
|
toSerialize["expiresAt"] = o.ExpiresAt
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Token) {
|
|
toSerialize["token"] = o.Token
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProviderTokenOut) UnmarshalJSON(data []byte) (err error) {
|
|
varProviderTokenOut := _ProviderTokenOut{}
|
|
|
|
err = json.Unmarshal(data, &varProviderTokenOut)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProviderTokenOut(varProviderTokenOut)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "expiresAt")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "token")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProviderTokenOut struct {
|
|
value *ProviderTokenOut
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProviderTokenOut) Get() *ProviderTokenOut {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProviderTokenOut) Set(val *ProviderTokenOut) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProviderTokenOut) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProviderTokenOut) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProviderTokenOut(val *ProviderTokenOut) *NullableProviderTokenOut {
|
|
return &NullableProviderTokenOut{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProviderTokenOut) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProviderTokenOut) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|