Files
sdk/model_provider_connection_view.go

459 lines
13 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 ProviderConnectionView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderConnectionView{}
// ProviderConnectionView struct for ProviderConnectionView
type ProviderConnectionView struct {
// Account is the human label of the connected third-party account (the Slack team name, the GitHub org login). Provider-supplied and sanitized on ingest.
Account *string `json:"account,omitempty"`
// ConnectedAt is when the connection was last (re)established, RFC 3339 UTC.
ConnectedAt *string `json:"connectedAt,omitempty"`
// ExpiresAt is when the access token expires, RFC 3339 UTC; empty for a credential that does not expire. Reading the token rotates it inside the window, so a reader never sees an expired one.
ExpiresAt *string `json:"expiresAt,omitempty"`
// ExternalID is the provider's own id for the account (Slack team.id, GitHub installation_id) — the value inbound webhooks are mapped back to this org by.
ExternalId *string `json:"externalId,omitempty"`
// ID is provider + \":\" + label, the address every connection route takes. Empty on the org plane, where a provider's connection is addressed by the provider alone.
Id *string `json:"id,omitempty"`
// Kind is personal or page for a social account that has one. Empty for every other connector.
Kind *string `json:"kind,omitempty"`
// Label is the caller's own name for this connection (\"default\", \"work\").
Label *string `json:"label,omitempty"`
// Provider is the connected provider's registry id. Empty where the reader already knows it, which is every org-plane card.
Provider *string `json:"provider,omitempty"`
// Scopes are the permissions the provider granted. Never null; [] when none.
Scopes []string `json:"scopes,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderConnectionView ProviderConnectionView
// NewProviderConnectionView instantiates a new ProviderConnectionView 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 NewProviderConnectionView() *ProviderConnectionView {
this := ProviderConnectionView{}
return &this
}
// NewProviderConnectionViewWithDefaults instantiates a new ProviderConnectionView 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 NewProviderConnectionViewWithDefaults() *ProviderConnectionView {
this := ProviderConnectionView{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetAccount(v string) {
o.Account = &v
}
// GetConnectedAt returns the ConnectedAt field value if set, zero value otherwise.
func (o *ProviderConnectionView) GetConnectedAt() string {
if o == nil || IsNil(o.ConnectedAt) {
var ret string
return ret
}
return *o.ConnectedAt
}
// GetConnectedAtOk returns a tuple with the ConnectedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderConnectionView) GetConnectedAtOk() (*string, bool) {
if o == nil || IsNil(o.ConnectedAt) {
return nil, false
}
return o.ConnectedAt, true
}
// HasConnectedAt returns a boolean if a field has been set.
func (o *ProviderConnectionView) HasConnectedAt() bool {
if o != nil && !IsNil(o.ConnectedAt) {
return true
}
return false
}
// SetConnectedAt gets a reference to the given string and assigns it to the ConnectedAt field.
func (o *ProviderConnectionView) SetConnectedAt(v string) {
o.ConnectedAt = &v
}
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetExpiresAt(v string) {
o.ExpiresAt = &v
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetExternalId(v string) {
o.ExternalId = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ProviderConnectionView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderConnectionView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *ProviderConnectionView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ProviderConnectionView) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *ProviderConnectionView) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderConnectionView) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *ProviderConnectionView) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *ProviderConnectionView) SetKind(v string) {
o.Kind = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetLabel(v string) {
o.Label = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetProvider(v string) {
o.Provider = &v
}
// GetScopes returns the Scopes field value if set, zero value otherwise.
func (o *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) 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 *ProviderConnectionView) SetScopes(v []string) {
o.Scopes = v
}
func (o ProviderConnectionView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderConnectionView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.ConnectedAt) {
toSerialize["connectedAt"] = o.ConnectedAt
}
if !IsNil(o.ExpiresAt) {
toSerialize["expiresAt"] = o.ExpiresAt
}
if !IsNil(o.ExternalId) {
toSerialize["externalId"] = o.ExternalId
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
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 *ProviderConnectionView) UnmarshalJSON(data []byte) (err error) {
varProviderConnectionView := _ProviderConnectionView{}
err = json.Unmarshal(data, &varProviderConnectionView)
if err != nil {
return err
}
*o = ProviderConnectionView(varProviderConnectionView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "connectedAt")
delete(additionalProperties, "expiresAt")
delete(additionalProperties, "externalId")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "label")
delete(additionalProperties, "provider")
delete(additionalProperties, "scopes")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderConnectionView struct {
value *ProviderConnectionView
isSet bool
}
func (v NullableProviderConnectionView) Get() *ProviderConnectionView {
return v.value
}
func (v *NullableProviderConnectionView) Set(val *ProviderConnectionView) {
v.value = val
v.isSet = true
}
func (v NullableProviderConnectionView) IsSet() bool {
return v.isSet
}
func (v *NullableProviderConnectionView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderConnectionView(val *ProviderConnectionView) *NullableProviderConnectionView {
return &NullableProviderConnectionView{value: val, isSet: true}
}
func (v NullableProviderConnectionView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderConnectionView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}