mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.6 KiB
Go
345 lines
9.6 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 ProviderConnectOut type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProviderConnectOut{}
|
|
|
|
// ProviderConnectOut struct for ProviderConnectOut
|
|
type ProviderConnectOut struct {
|
|
// Account is the account label the provider reported for the credential. apikey path only; a pointer because \"\" is a real answer the provider gave.
|
|
Account *string `json:"account,omitempty"`
|
|
// AuthorizeURL is the provider consent URL to send the user to. OAuth path only.
|
|
AuthorizeUrl *string `json:"authorizeUrl,omitempty"`
|
|
// Connected is true on the apikey path once the credential verified and sealed.
|
|
Connected *bool `json:"connected,omitempty"`
|
|
// ExternalID is the provider's account id for the credential. apikey path only.
|
|
ExternalId *string `json:"externalId,omitempty"`
|
|
// Provider is the connector's registry id. apikey path only.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Scopes are the permissions the credential carries. apikey path only; never null on that path ([] when the provider reported none).
|
|
Scopes []string `json:"scopes,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProviderConnectOut ProviderConnectOut
|
|
|
|
// NewProviderConnectOut instantiates a new ProviderConnectOut 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 NewProviderConnectOut() *ProviderConnectOut {
|
|
this := ProviderConnectOut{}
|
|
return &this
|
|
}
|
|
|
|
// NewProviderConnectOutWithDefaults instantiates a new ProviderConnectOut 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 NewProviderConnectOutWithDefaults() *ProviderConnectOut {
|
|
this := ProviderConnectOut{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccount returns the Account field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) GetAccount() string {
|
|
if o == nil || IsNil(o.Account) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Account
|
|
}
|
|
|
|
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderConnectOut) GetAccountOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Account) {
|
|
return nil, false
|
|
}
|
|
return o.Account, true
|
|
}
|
|
|
|
// HasAccount returns a boolean if a field has been set.
|
|
func (o *ProviderConnectOut) HasAccount() bool {
|
|
if o != nil && !IsNil(o.Account) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccount gets a reference to the given string and assigns it to the Account field.
|
|
func (o *ProviderConnectOut) SetAccount(v string) {
|
|
o.Account = &v
|
|
}
|
|
|
|
// GetAuthorizeUrl returns the AuthorizeUrl field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) GetAuthorizeUrl() string {
|
|
if o == nil || IsNil(o.AuthorizeUrl) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.AuthorizeUrl
|
|
}
|
|
|
|
// GetAuthorizeUrlOk returns a tuple with the AuthorizeUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderConnectOut) GetAuthorizeUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.AuthorizeUrl) {
|
|
return nil, false
|
|
}
|
|
return o.AuthorizeUrl, true
|
|
}
|
|
|
|
// HasAuthorizeUrl returns a boolean if a field has been set.
|
|
func (o *ProviderConnectOut) HasAuthorizeUrl() bool {
|
|
if o != nil && !IsNil(o.AuthorizeUrl) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAuthorizeUrl gets a reference to the given string and assigns it to the AuthorizeUrl field.
|
|
func (o *ProviderConnectOut) SetAuthorizeUrl(v string) {
|
|
o.AuthorizeUrl = &v
|
|
}
|
|
|
|
// GetConnected returns the Connected field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) GetConnected() bool {
|
|
if o == nil || IsNil(o.Connected) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Connected
|
|
}
|
|
|
|
// GetConnectedOk returns a tuple with the Connected field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderConnectOut) GetConnectedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Connected) {
|
|
return nil, false
|
|
}
|
|
return o.Connected, true
|
|
}
|
|
|
|
// HasConnected returns a boolean if a field has been set.
|
|
func (o *ProviderConnectOut) HasConnected() bool {
|
|
if o != nil && !IsNil(o.Connected) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetConnected gets a reference to the given bool and assigns it to the Connected field.
|
|
func (o *ProviderConnectOut) SetConnected(v bool) {
|
|
o.Connected = &v
|
|
}
|
|
|
|
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) GetExternalId() string {
|
|
if o == nil || IsNil(o.ExternalId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ExternalId
|
|
}
|
|
|
|
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderConnectOut) GetExternalIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ExternalId) {
|
|
return nil, false
|
|
}
|
|
return o.ExternalId, true
|
|
}
|
|
|
|
// HasExternalId returns a boolean if a field has been set.
|
|
func (o *ProviderConnectOut) HasExternalId() bool {
|
|
if o != nil && !IsNil(o.ExternalId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
|
|
func (o *ProviderConnectOut) SetExternalId(v string) {
|
|
o.ExternalId = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) 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 *ProviderConnectOut) 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 *ProviderConnectOut) 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 *ProviderConnectOut) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetScopes returns the Scopes field value if set, zero value otherwise.
|
|
func (o *ProviderConnectOut) GetScopes() []string {
|
|
if o == nil || IsNil(o.Scopes) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Scopes
|
|
}
|
|
|
|
// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderConnectOut) GetScopesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Scopes) {
|
|
return nil, false
|
|
}
|
|
return o.Scopes, true
|
|
}
|
|
|
|
// HasScopes returns a boolean if a field has been set.
|
|
func (o *ProviderConnectOut) HasScopes() bool {
|
|
if o != nil && !IsNil(o.Scopes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScopes gets a reference to the given []string and assigns it to the Scopes field.
|
|
func (o *ProviderConnectOut) SetScopes(v []string) {
|
|
o.Scopes = v
|
|
}
|
|
|
|
func (o ProviderConnectOut) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProviderConnectOut) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Account) {
|
|
toSerialize["account"] = o.Account
|
|
}
|
|
if !IsNil(o.AuthorizeUrl) {
|
|
toSerialize["authorizeUrl"] = o.AuthorizeUrl
|
|
}
|
|
if !IsNil(o.Connected) {
|
|
toSerialize["connected"] = o.Connected
|
|
}
|
|
if !IsNil(o.ExternalId) {
|
|
toSerialize["externalId"] = o.ExternalId
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Scopes) {
|
|
toSerialize["scopes"] = o.Scopes
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProviderConnectOut) UnmarshalJSON(data []byte) (err error) {
|
|
varProviderConnectOut := _ProviderConnectOut{}
|
|
|
|
err = json.Unmarshal(data, &varProviderConnectOut)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProviderConnectOut(varProviderConnectOut)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "account")
|
|
delete(additionalProperties, "authorizeUrl")
|
|
delete(additionalProperties, "connected")
|
|
delete(additionalProperties, "externalId")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "scopes")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProviderConnectOut struct {
|
|
value *ProviderConnectOut
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProviderConnectOut) Get() *ProviderConnectOut {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProviderConnectOut) Set(val *ProviderConnectOut) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProviderConnectOut) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProviderConnectOut) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProviderConnectOut(val *ProviderConnectOut) *NullableProviderConnectOut {
|
|
return &NullableProviderConnectOut{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProviderConnectOut) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProviderConnectOut) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|