Files
sdk/model_provider_gitlab_projects_out.go

193 lines
5.7 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 ProviderGitlabProjectsOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGitlabProjectsOut{}
// ProviderGitlabProjectsOut struct for ProviderGitlabProjectsOut
type ProviderGitlabProjectsOut struct {
// Account is the connected GitLab username, so a client can label the list without a second call. Empty when the connection recorded none.
Account *string `json:"account,omitempty"`
// Projects is every project the token reaches, newest activity first. Never null; [] when the account has none.
Projects []ProviderGitlabProjectView `json:"projects,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGitlabProjectsOut ProviderGitlabProjectsOut
// NewProviderGitlabProjectsOut instantiates a new ProviderGitlabProjectsOut 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 NewProviderGitlabProjectsOut() *ProviderGitlabProjectsOut {
this := ProviderGitlabProjectsOut{}
return &this
}
// NewProviderGitlabProjectsOutWithDefaults instantiates a new ProviderGitlabProjectsOut 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 NewProviderGitlabProjectsOutWithDefaults() *ProviderGitlabProjectsOut {
this := ProviderGitlabProjectsOut{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *ProviderGitlabProjectsOut) 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 *ProviderGitlabProjectsOut) 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 *ProviderGitlabProjectsOut) 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 *ProviderGitlabProjectsOut) SetAccount(v string) {
o.Account = &v
}
// GetProjects returns the Projects field value if set, zero value otherwise.
func (o *ProviderGitlabProjectsOut) GetProjects() []ProviderGitlabProjectView {
if o == nil || IsNil(o.Projects) {
var ret []ProviderGitlabProjectView
return ret
}
return o.Projects
}
// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGitlabProjectsOut) GetProjectsOk() ([]ProviderGitlabProjectView, bool) {
if o == nil || IsNil(o.Projects) {
return nil, false
}
return o.Projects, true
}
// HasProjects returns a boolean if a field has been set.
func (o *ProviderGitlabProjectsOut) HasProjects() bool {
if o != nil && !IsNil(o.Projects) {
return true
}
return false
}
// SetProjects gets a reference to the given []ProviderGitlabProjectView and assigns it to the Projects field.
func (o *ProviderGitlabProjectsOut) SetProjects(v []ProviderGitlabProjectView) {
o.Projects = v
}
func (o ProviderGitlabProjectsOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGitlabProjectsOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Projects) {
toSerialize["projects"] = o.Projects
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGitlabProjectsOut) UnmarshalJSON(data []byte) (err error) {
varProviderGitlabProjectsOut := _ProviderGitlabProjectsOut{}
err = json.Unmarshal(data, &varProviderGitlabProjectsOut)
if err != nil {
return err
}
*o = ProviderGitlabProjectsOut(varProviderGitlabProjectsOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "projects")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGitlabProjectsOut struct {
value *ProviderGitlabProjectsOut
isSet bool
}
func (v NullableProviderGitlabProjectsOut) Get() *ProviderGitlabProjectsOut {
return v.value
}
func (v *NullableProviderGitlabProjectsOut) Set(val *ProviderGitlabProjectsOut) {
v.value = val
v.isSet = true
}
func (v NullableProviderGitlabProjectsOut) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGitlabProjectsOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGitlabProjectsOut(val *ProviderGitlabProjectsOut) *NullableProviderGitlabProjectsOut {
return &NullableProviderGitlabProjectsOut{value: val, isSet: true}
}
func (v NullableProviderGitlabProjectsOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGitlabProjectsOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}