Files
sdk/model_provider_github_user_out.go

307 lines
8.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 ProviderGithubUserOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubUserOut{}
// ProviderGithubUserOut struct for ProviderGithubUserOut
type ProviderGithubUserOut struct {
// Configured is whether this deployment holds the App's 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 GitHub account in this org. False means their repositories come from nowhere: an org admin still sees the org's installations, and everyone else is asked to connect.
Connected *bool `json:"connected,omitempty"`
// ConnectedAt is when the connection was made, RFC 3339 UTC.
ConnectedAt *string `json:"connectedAt,omitempty"`
// ExpiresAt is when the current access token expires, RFC 3339 UTC. It is rotated before it does; absent for a token GitHub does not expire.
ExpiresAt *string `json:"expiresAt,omitempty"`
// Login is the GitHub account they connected. Absent when not connected.
Login *string `json:"login,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubUserOut ProviderGithubUserOut
// NewProviderGithubUserOut instantiates a new ProviderGithubUserOut 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 NewProviderGithubUserOut() *ProviderGithubUserOut {
this := ProviderGithubUserOut{}
return &this
}
// NewProviderGithubUserOutWithDefaults instantiates a new ProviderGithubUserOut 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 NewProviderGithubUserOutWithDefaults() *ProviderGithubUserOut {
this := ProviderGithubUserOut{}
return &this
}
// GetConfigured returns the Configured field value if set, zero value otherwise.
func (o *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) SetConfigured(v bool) {
o.Configured = &v
}
// GetConnected returns the Connected field value if set, zero value otherwise.
func (o *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) SetConnected(v bool) {
o.Connected = &v
}
// GetConnectedAt returns the ConnectedAt field value if set, zero value otherwise.
func (o *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) SetConnectedAt(v string) {
o.ConnectedAt = &v
}
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) 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 *ProviderGithubUserOut) SetExpiresAt(v string) {
o.ExpiresAt = &v
}
// GetLogin returns the Login field value if set, zero value otherwise.
func (o *ProviderGithubUserOut) GetLogin() string {
if o == nil || IsNil(o.Login) {
var ret string
return ret
}
return *o.Login
}
// GetLoginOk returns a tuple with the Login field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubUserOut) GetLoginOk() (*string, bool) {
if o == nil || IsNil(o.Login) {
return nil, false
}
return o.Login, true
}
// HasLogin returns a boolean if a field has been set.
func (o *ProviderGithubUserOut) HasLogin() bool {
if o != nil && !IsNil(o.Login) {
return true
}
return false
}
// SetLogin gets a reference to the given string and assigns it to the Login field.
func (o *ProviderGithubUserOut) SetLogin(v string) {
o.Login = &v
}
func (o ProviderGithubUserOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubUserOut) 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.ExpiresAt) {
toSerialize["expiresAt"] = o.ExpiresAt
}
if !IsNil(o.Login) {
toSerialize["login"] = o.Login
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubUserOut) UnmarshalJSON(data []byte) (err error) {
varProviderGithubUserOut := _ProviderGithubUserOut{}
err = json.Unmarshal(data, &varProviderGithubUserOut)
if err != nil {
return err
}
*o = ProviderGithubUserOut(varProviderGithubUserOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "configured")
delete(additionalProperties, "connected")
delete(additionalProperties, "connectedAt")
delete(additionalProperties, "expiresAt")
delete(additionalProperties, "login")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubUserOut struct {
value *ProviderGithubUserOut
isSet bool
}
func (v NullableProviderGithubUserOut) Get() *ProviderGithubUserOut {
return v.value
}
func (v *NullableProviderGithubUserOut) Set(val *ProviderGithubUserOut) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubUserOut) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubUserOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubUserOut(val *ProviderGithubUserOut) *NullableProviderGithubUserOut {
return &NullableProviderGithubUserOut{value: val, isSet: true}
}
func (v NullableProviderGithubUserOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubUserOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}