Files
sdk/model_provider_google_user_out.go

345 lines
9.8 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 ProviderGoogleUserOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGoogleUserOut{}
// ProviderGoogleUserOut struct for ProviderGoogleUserOut
type ProviderGoogleUserOut struct {
// Configured is whether this deployment holds the OAuth client. False means nobody can connect here yet, and connect answers 503.
Configured *bool `json:"configured,omitempty"`
// Connected is whether the caller has connected their own Google account in this org.
Connected *bool `json:"connected,omitempty"`
// ConnectedAt is when the connection was made, RFC 3339 UTC.
ConnectedAt *string `json:"connectedAt,omitempty"`
// Email is the Google account they connected: the From of every message sent as them. Absent when not connected.
Email *string `json:"email,omitempty"`
// ExpiresAt is when the current access token expires, RFC 3339 UTC. It is rotated before it does.
ExpiresAt *string `json:"expiresAt,omitempty"`
// Send is whether the grant lets Hanzo send mail as them. A connection is only kept when it does, so this is Connected unless the person later narrowed the grant at Google.
Send *bool `json:"send,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGoogleUserOut ProviderGoogleUserOut
// NewProviderGoogleUserOut instantiates a new ProviderGoogleUserOut 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 NewProviderGoogleUserOut() *ProviderGoogleUserOut {
this := ProviderGoogleUserOut{}
return &this
}
// NewProviderGoogleUserOutWithDefaults instantiates a new ProviderGoogleUserOut 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 NewProviderGoogleUserOutWithDefaults() *ProviderGoogleUserOut {
this := ProviderGoogleUserOut{}
return &this
}
// GetConfigured returns the Configured field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) GetConfigured() bool {
if o == nil || IsNil(o.Configured) {
var ret bool
return ret
}
return *o.Configured
}
// GetConfiguredOk returns a tuple with the Configured field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGoogleUserOut) GetConfiguredOk() (*bool, bool) {
if o == nil || IsNil(o.Configured) {
return nil, false
}
return o.Configured, true
}
// HasConfigured returns a boolean if a field has been set.
func (o *ProviderGoogleUserOut) HasConfigured() bool {
if o != nil && !IsNil(o.Configured) {
return true
}
return false
}
// SetConfigured gets a reference to the given bool and assigns it to the Configured field.
func (o *ProviderGoogleUserOut) SetConfigured(v bool) {
o.Configured = &v
}
// GetConnected returns the Connected field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) SetConnected(v bool) {
o.Connected = &v
}
// GetConnectedAt returns the ConnectedAt field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) SetConnectedAt(v string) {
o.ConnectedAt = &v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGoogleUserOut) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *ProviderGoogleUserOut) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *ProviderGoogleUserOut) SetEmail(v string) {
o.Email = &v
}
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) 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 *ProviderGoogleUserOut) SetExpiresAt(v string) {
o.ExpiresAt = &v
}
// GetSend returns the Send field value if set, zero value otherwise.
func (o *ProviderGoogleUserOut) GetSend() bool {
if o == nil || IsNil(o.Send) {
var ret bool
return ret
}
return *o.Send
}
// GetSendOk returns a tuple with the Send field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGoogleUserOut) GetSendOk() (*bool, bool) {
if o == nil || IsNil(o.Send) {
return nil, false
}
return o.Send, true
}
// HasSend returns a boolean if a field has been set.
func (o *ProviderGoogleUserOut) HasSend() bool {
if o != nil && !IsNil(o.Send) {
return true
}
return false
}
// SetSend gets a reference to the given bool and assigns it to the Send field.
func (o *ProviderGoogleUserOut) SetSend(v bool) {
o.Send = &v
}
func (o ProviderGoogleUserOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGoogleUserOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Configured) {
toSerialize["configured"] = o.Configured
}
if !IsNil(o.Connected) {
toSerialize["connected"] = o.Connected
}
if !IsNil(o.ConnectedAt) {
toSerialize["connectedAt"] = o.ConnectedAt
}
if !IsNil(o.Email) {
toSerialize["email"] = o.Email
}
if !IsNil(o.ExpiresAt) {
toSerialize["expiresAt"] = o.ExpiresAt
}
if !IsNil(o.Send) {
toSerialize["send"] = o.Send
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGoogleUserOut) UnmarshalJSON(data []byte) (err error) {
varProviderGoogleUserOut := _ProviderGoogleUserOut{}
err = json.Unmarshal(data, &varProviderGoogleUserOut)
if err != nil {
return err
}
*o = ProviderGoogleUserOut(varProviderGoogleUserOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "configured")
delete(additionalProperties, "connected")
delete(additionalProperties, "connectedAt")
delete(additionalProperties, "email")
delete(additionalProperties, "expiresAt")
delete(additionalProperties, "send")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGoogleUserOut struct {
value *ProviderGoogleUserOut
isSet bool
}
func (v NullableProviderGoogleUserOut) Get() *ProviderGoogleUserOut {
return v.value
}
func (v *NullableProviderGoogleUserOut) Set(val *ProviderGoogleUserOut) {
v.value = val
v.isSet = true
}
func (v NullableProviderGoogleUserOut) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGoogleUserOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGoogleUserOut(val *ProviderGoogleUserOut) *NullableProviderGoogleUserOut {
return &NullableProviderGoogleUserOut{value: val, isSet: true}
}
func (v NullableProviderGoogleUserOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGoogleUserOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}