Files
sdk/model_git_pool_view.go

269 lines
6.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 GitPoolView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitPoolView{}
// GitPoolView struct for GitPoolView
type GitPoolView struct {
// CreatedAt is when the pool was declared, in unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Labels are what a workflow's `runs-on:` selects this pool by.
Labels []string `json:"labels,omitempty"`
// Name is the pool's handle in this org.
Name *string `json:"name,omitempty"`
// Runners is how many daemons have entered the pool. Zero means the capacity is declared and nothing has turned up to provide it.
Runners *int64 `json:"runners,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitPoolView GitPoolView
// NewGitPoolView instantiates a new GitPoolView 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 NewGitPoolView() *GitPoolView {
this := GitPoolView{}
return &this
}
// NewGitPoolViewWithDefaults instantiates a new GitPoolView 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 NewGitPoolViewWithDefaults() *GitPoolView {
this := GitPoolView{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *GitPoolView) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPoolView) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *GitPoolView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *GitPoolView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *GitPoolView) GetLabels() []string {
if o == nil || IsNil(o.Labels) {
var ret []string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPoolView) GetLabelsOk() ([]string, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *GitPoolView) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *GitPoolView) SetLabels(v []string) {
o.Labels = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *GitPoolView) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPoolView) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *GitPoolView) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *GitPoolView) SetName(v string) {
o.Name = &v
}
// GetRunners returns the Runners field value if set, zero value otherwise.
func (o *GitPoolView) GetRunners() int64 {
if o == nil || IsNil(o.Runners) {
var ret int64
return ret
}
return *o.Runners
}
// GetRunnersOk returns a tuple with the Runners field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPoolView) GetRunnersOk() (*int64, bool) {
if o == nil || IsNil(o.Runners) {
return nil, false
}
return o.Runners, true
}
// HasRunners returns a boolean if a field has been set.
func (o *GitPoolView) HasRunners() bool {
if o != nil && !IsNil(o.Runners) {
return true
}
return false
}
// SetRunners gets a reference to the given int64 and assigns it to the Runners field.
func (o *GitPoolView) SetRunners(v int64) {
o.Runners = &v
}
func (o GitPoolView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitPoolView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Runners) {
toSerialize["runners"] = o.Runners
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitPoolView) UnmarshalJSON(data []byte) (err error) {
varGitPoolView := _GitPoolView{}
err = json.Unmarshal(data, &varGitPoolView)
if err != nil {
return err
}
*o = GitPoolView(varGitPoolView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdAt")
delete(additionalProperties, "labels")
delete(additionalProperties, "name")
delete(additionalProperties, "runners")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitPoolView struct {
value *GitPoolView
isSet bool
}
func (v NullableGitPoolView) Get() *GitPoolView {
return v.value
}
func (v *NullableGitPoolView) Set(val *GitPoolView) {
v.value = val
v.isSet = true
}
func (v NullableGitPoolView) IsSet() bool {
return v.isSet
}
func (v *NullableGitPoolView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitPoolView(val *GitPoolView) *NullableGitPoolView {
return &NullableGitPoolView{value: val, isSet: true}
}
func (v NullableGitPoolView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitPoolView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}