Files
sdk/model_author_connect_request.go

231 lines
6.4 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 AuthorConnectRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuthorConnectRequest{}
// AuthorConnectRequest struct for AuthorConnectRequest
type AuthorConnectRequest struct {
// GithubLogin is the account to link. Used only when IAM holds no linked account for the provider — a linked account is stronger proof and always wins.
GithubLogin *string `json:"githubLogin,omitempty"`
// Login is the provider-neutral alias for GithubLogin, preferred when both are sent.
Login *string `json:"login,omitempty"`
// Provider is the forge to enrol with: github (the default) or gitlab.
Provider *string `json:"provider,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AuthorConnectRequest AuthorConnectRequest
// NewAuthorConnectRequest instantiates a new AuthorConnectRequest 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 NewAuthorConnectRequest() *AuthorConnectRequest {
this := AuthorConnectRequest{}
return &this
}
// NewAuthorConnectRequestWithDefaults instantiates a new AuthorConnectRequest 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 NewAuthorConnectRequestWithDefaults() *AuthorConnectRequest {
this := AuthorConnectRequest{}
return &this
}
// GetGithubLogin returns the GithubLogin field value if set, zero value otherwise.
func (o *AuthorConnectRequest) GetGithubLogin() string {
if o == nil || IsNil(o.GithubLogin) {
var ret string
return ret
}
return *o.GithubLogin
}
// GetGithubLoginOk returns a tuple with the GithubLogin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorConnectRequest) GetGithubLoginOk() (*string, bool) {
if o == nil || IsNil(o.GithubLogin) {
return nil, false
}
return o.GithubLogin, true
}
// HasGithubLogin returns a boolean if a field has been set.
func (o *AuthorConnectRequest) HasGithubLogin() bool {
if o != nil && !IsNil(o.GithubLogin) {
return true
}
return false
}
// SetGithubLogin gets a reference to the given string and assigns it to the GithubLogin field.
func (o *AuthorConnectRequest) SetGithubLogin(v string) {
o.GithubLogin = &v
}
// GetLogin returns the Login field value if set, zero value otherwise.
func (o *AuthorConnectRequest) 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 *AuthorConnectRequest) 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 *AuthorConnectRequest) 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 *AuthorConnectRequest) SetLogin(v string) {
o.Login = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *AuthorConnectRequest) 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 *AuthorConnectRequest) 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 *AuthorConnectRequest) 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 *AuthorConnectRequest) SetProvider(v string) {
o.Provider = &v
}
func (o AuthorConnectRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthorConnectRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.GithubLogin) {
toSerialize["githubLogin"] = o.GithubLogin
}
if !IsNil(o.Login) {
toSerialize["login"] = o.Login
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AuthorConnectRequest) UnmarshalJSON(data []byte) (err error) {
varAuthorConnectRequest := _AuthorConnectRequest{}
err = json.Unmarshal(data, &varAuthorConnectRequest)
if err != nil {
return err
}
*o = AuthorConnectRequest(varAuthorConnectRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "githubLogin")
delete(additionalProperties, "login")
delete(additionalProperties, "provider")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAuthorConnectRequest struct {
value *AuthorConnectRequest
isSet bool
}
func (v NullableAuthorConnectRequest) Get() *AuthorConnectRequest {
return v.value
}
func (v *NullableAuthorConnectRequest) Set(val *AuthorConnectRequest) {
v.value = val
v.isSet = true
}
func (v NullableAuthorConnectRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAuthorConnectRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthorConnectRequest(val *AuthorConnectRequest) *NullableAuthorConnectRequest {
return &NullableAuthorConnectRequest{value: val, isSet: true}
}
func (v NullableAuthorConnectRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthorConnectRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}