Files
sdk/model_provider_credential_in.go

307 lines
8.5 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 ProviderCredentialIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderCredentialIn{}
// ProviderCredentialIn struct for ProviderCredentialIn
type ProviderCredentialIn struct {
// AccountID scopes the credential where the provider's Verify needs one.
AccountId *string `json:"accountId,omitempty"`
// Label names this connection; empty means \"default\".
Label *string `json:"label,omitempty"`
// OAuth is a bundle the CLI already obtained through its own local PKCE flow. Present ⇒ the Adopt path; absent ⇒ the Token path.
Oauth *ProviderOauthBundleIn `json:"oauth,omitempty"`
// Provider is the user-scoped provider's registry id, from the path.
Provider *string `json:"provider,omitempty"`
// Token is the customer-held credential for the Verify path. Read on STDIN by the CLI, never argv; never logged, echoed, or stored outside KMS.
Token *string `json:"token,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderCredentialIn ProviderCredentialIn
// NewProviderCredentialIn instantiates a new ProviderCredentialIn 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 NewProviderCredentialIn() *ProviderCredentialIn {
this := ProviderCredentialIn{}
return &this
}
// NewProviderCredentialInWithDefaults instantiates a new ProviderCredentialIn 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 NewProviderCredentialInWithDefaults() *ProviderCredentialIn {
this := ProviderCredentialIn{}
return &this
}
// GetAccountId returns the AccountId field value if set, zero value otherwise.
func (o *ProviderCredentialIn) GetAccountId() string {
if o == nil || IsNil(o.AccountId) {
var ret string
return ret
}
return *o.AccountId
}
// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderCredentialIn) GetAccountIdOk() (*string, bool) {
if o == nil || IsNil(o.AccountId) {
return nil, false
}
return o.AccountId, true
}
// HasAccountId returns a boolean if a field has been set.
func (o *ProviderCredentialIn) HasAccountId() bool {
if o != nil && !IsNil(o.AccountId) {
return true
}
return false
}
// SetAccountId gets a reference to the given string and assigns it to the AccountId field.
func (o *ProviderCredentialIn) SetAccountId(v string) {
o.AccountId = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) SetLabel(v string) {
o.Label = &v
}
// GetOauth returns the Oauth field value if set, zero value otherwise.
func (o *ProviderCredentialIn) GetOauth() ProviderOauthBundleIn {
if o == nil || IsNil(o.Oauth) {
var ret ProviderOauthBundleIn
return ret
}
return *o.Oauth
}
// GetOauthOk returns a tuple with the Oauth field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderCredentialIn) GetOauthOk() (*ProviderOauthBundleIn, bool) {
if o == nil || IsNil(o.Oauth) {
return nil, false
}
return o.Oauth, true
}
// HasOauth returns a boolean if a field has been set.
func (o *ProviderCredentialIn) HasOauth() bool {
if o != nil && !IsNil(o.Oauth) {
return true
}
return false
}
// SetOauth gets a reference to the given ProviderOauthBundleIn and assigns it to the Oauth field.
func (o *ProviderCredentialIn) SetOauth(v ProviderOauthBundleIn) {
o.Oauth = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) SetProvider(v string) {
o.Provider = &v
}
// GetToken returns the Token field value if set, zero value otherwise.
func (o *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) 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 *ProviderCredentialIn) SetToken(v string) {
o.Token = &v
}
func (o ProviderCredentialIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderCredentialIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AccountId) {
toSerialize["accountId"] = o.AccountId
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.Oauth) {
toSerialize["oauth"] = o.Oauth
}
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 *ProviderCredentialIn) UnmarshalJSON(data []byte) (err error) {
varProviderCredentialIn := _ProviderCredentialIn{}
err = json.Unmarshal(data, &varProviderCredentialIn)
if err != nil {
return err
}
*o = ProviderCredentialIn(varProviderCredentialIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accountId")
delete(additionalProperties, "label")
delete(additionalProperties, "oauth")
delete(additionalProperties, "provider")
delete(additionalProperties, "token")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderCredentialIn struct {
value *ProviderCredentialIn
isSet bool
}
func (v NullableProviderCredentialIn) Get() *ProviderCredentialIn {
return v.value
}
func (v *NullableProviderCredentialIn) Set(val *ProviderCredentialIn) {
v.value = val
v.isSet = true
}
func (v NullableProviderCredentialIn) IsSet() bool {
return v.isSet
}
func (v *NullableProviderCredentialIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderCredentialIn(val *ProviderCredentialIn) *NullableProviderCredentialIn {
return &NullableProviderCredentialIn{value: val, isSet: true}
}
func (v NullableProviderCredentialIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderCredentialIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}