Files
sdk/model_ci_executions.go

340 lines
8.5 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"
"time"
)
// checks if the CiExecutions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CiExecutions{}
// CiExecutions struct for CiExecutions
type CiExecutions struct {
FetchedAt *time.Time `json:"fetchedAt,omitempty"`
Orgs []string `json:"orgs,omitempty"`
Repos *int64 `json:"repos,omitempty"`
Runs []CiExecution `json:"runs,omitempty"`
SourceErr *string `json:"sourceErr,omitempty"`
Stale *bool `json:"stale,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CiExecutions CiExecutions
// NewCiExecutions instantiates a new CiExecutions 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 NewCiExecutions() *CiExecutions {
this := CiExecutions{}
return &this
}
// NewCiExecutionsWithDefaults instantiates a new CiExecutions 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 NewCiExecutionsWithDefaults() *CiExecutions {
this := CiExecutions{}
return &this
}
// GetFetchedAt returns the FetchedAt field value if set, zero value otherwise.
func (o *CiExecutions) GetFetchedAt() time.Time {
if o == nil || IsNil(o.FetchedAt) {
var ret time.Time
return ret
}
return *o.FetchedAt
}
// GetFetchedAtOk returns a tuple with the FetchedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetFetchedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.FetchedAt) {
return nil, false
}
return o.FetchedAt, true
}
// HasFetchedAt returns a boolean if a field has been set.
func (o *CiExecutions) HasFetchedAt() bool {
if o != nil && !IsNil(o.FetchedAt) {
return true
}
return false
}
// SetFetchedAt gets a reference to the given time.Time and assigns it to the FetchedAt field.
func (o *CiExecutions) SetFetchedAt(v time.Time) {
o.FetchedAt = &v
}
// GetOrgs returns the Orgs field value if set, zero value otherwise.
func (o *CiExecutions) GetOrgs() []string {
if o == nil || IsNil(o.Orgs) {
var ret []string
return ret
}
return o.Orgs
}
// GetOrgsOk returns a tuple with the Orgs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetOrgsOk() ([]string, bool) {
if o == nil || IsNil(o.Orgs) {
return nil, false
}
return o.Orgs, true
}
// HasOrgs returns a boolean if a field has been set.
func (o *CiExecutions) HasOrgs() bool {
if o != nil && !IsNil(o.Orgs) {
return true
}
return false
}
// SetOrgs gets a reference to the given []string and assigns it to the Orgs field.
func (o *CiExecutions) SetOrgs(v []string) {
o.Orgs = v
}
// GetRepos returns the Repos field value if set, zero value otherwise.
func (o *CiExecutions) GetRepos() int64 {
if o == nil || IsNil(o.Repos) {
var ret int64
return ret
}
return *o.Repos
}
// GetReposOk returns a tuple with the Repos field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetReposOk() (*int64, bool) {
if o == nil || IsNil(o.Repos) {
return nil, false
}
return o.Repos, true
}
// HasRepos returns a boolean if a field has been set.
func (o *CiExecutions) HasRepos() bool {
if o != nil && !IsNil(o.Repos) {
return true
}
return false
}
// SetRepos gets a reference to the given int64 and assigns it to the Repos field.
func (o *CiExecutions) SetRepos(v int64) {
o.Repos = &v
}
// GetRuns returns the Runs field value if set, zero value otherwise.
func (o *CiExecutions) GetRuns() []CiExecution {
if o == nil || IsNil(o.Runs) {
var ret []CiExecution
return ret
}
return o.Runs
}
// GetRunsOk returns a tuple with the Runs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetRunsOk() ([]CiExecution, bool) {
if o == nil || IsNil(o.Runs) {
return nil, false
}
return o.Runs, true
}
// HasRuns returns a boolean if a field has been set.
func (o *CiExecutions) HasRuns() bool {
if o != nil && !IsNil(o.Runs) {
return true
}
return false
}
// SetRuns gets a reference to the given []CiExecution and assigns it to the Runs field.
func (o *CiExecutions) SetRuns(v []CiExecution) {
o.Runs = v
}
// GetSourceErr returns the SourceErr field value if set, zero value otherwise.
func (o *CiExecutions) GetSourceErr() string {
if o == nil || IsNil(o.SourceErr) {
var ret string
return ret
}
return *o.SourceErr
}
// GetSourceErrOk returns a tuple with the SourceErr field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetSourceErrOk() (*string, bool) {
if o == nil || IsNil(o.SourceErr) {
return nil, false
}
return o.SourceErr, true
}
// HasSourceErr returns a boolean if a field has been set.
func (o *CiExecutions) HasSourceErr() bool {
if o != nil && !IsNil(o.SourceErr) {
return true
}
return false
}
// SetSourceErr gets a reference to the given string and assigns it to the SourceErr field.
func (o *CiExecutions) SetSourceErr(v string) {
o.SourceErr = &v
}
// GetStale returns the Stale field value if set, zero value otherwise.
func (o *CiExecutions) GetStale() bool {
if o == nil || IsNil(o.Stale) {
var ret bool
return ret
}
return *o.Stale
}
// GetStaleOk returns a tuple with the Stale field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecutions) GetStaleOk() (*bool, bool) {
if o == nil || IsNil(o.Stale) {
return nil, false
}
return o.Stale, true
}
// HasStale returns a boolean if a field has been set.
func (o *CiExecutions) HasStale() bool {
if o != nil && !IsNil(o.Stale) {
return true
}
return false
}
// SetStale gets a reference to the given bool and assigns it to the Stale field.
func (o *CiExecutions) SetStale(v bool) {
o.Stale = &v
}
func (o CiExecutions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CiExecutions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.FetchedAt) {
toSerialize["fetchedAt"] = o.FetchedAt
}
if !IsNil(o.Orgs) {
toSerialize["orgs"] = o.Orgs
}
if !IsNil(o.Repos) {
toSerialize["repos"] = o.Repos
}
if !IsNil(o.Runs) {
toSerialize["runs"] = o.Runs
}
if !IsNil(o.SourceErr) {
toSerialize["sourceErr"] = o.SourceErr
}
if !IsNil(o.Stale) {
toSerialize["stale"] = o.Stale
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CiExecutions) UnmarshalJSON(data []byte) (err error) {
varCiExecutions := _CiExecutions{}
err = json.Unmarshal(data, &varCiExecutions)
if err != nil {
return err
}
*o = CiExecutions(varCiExecutions)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "fetchedAt")
delete(additionalProperties, "orgs")
delete(additionalProperties, "repos")
delete(additionalProperties, "runs")
delete(additionalProperties, "sourceErr")
delete(additionalProperties, "stale")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCiExecutions struct {
value *CiExecutions
isSet bool
}
func (v NullableCiExecutions) Get() *CiExecutions {
return v.value
}
func (v *NullableCiExecutions) Set(val *CiExecutions) {
v.value = val
v.isSet = true
}
func (v NullableCiExecutions) IsSet() bool {
return v.isSet
}
func (v *NullableCiExecutions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCiExecutions(val *CiExecutions) *NullableCiExecutions {
return &NullableCiExecutions{value: val, isSet: true}
}
func (v NullableCiExecutions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCiExecutions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}