Files
sdk/model_ci_run.go

650 lines
16 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 CiRun type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CiRun{}
// CiRun struct for CiRun
type CiRun struct {
// Attempt counts re-runs of this run, starting at 1.
Attempt *int64 `json:"attempt,omitempty"`
// Conclusion is how it ended — success, failure, cancelled or skipped — and is empty until Status is completed. Read both: completed alone does not say whether it passed.
Conclusion *string `json:"conclusion,omitempty"`
// EndedAt is when it finished; absent until it has.
EndedAt *time.Time `json:"endedAt,omitempty"`
// Event is what started the run: push, pull_request, workflow_dispatch, schedule.
Event *string `json:"event,omitempty"`
// ID is the run's id on the forge.
Id *int64 `json:"id,omitempty"`
// Jobs are the run's jobs in the order the forge created them.
Jobs []CiJob `json:"jobs,omitempty"`
// Number is the run's number within the repository, as the forge's page shows it.
Number *int64 `json:"number,omitempty"`
// Ref is the branch or tag that started the run. A tag and the branch it was cut from share a commit, so one answer can hold a run for each.
Ref *string `json:"ref,omitempty"`
// SHA is the commit the run checked out.
Sha *string `json:"sha,omitempty"`
// StartedAt is when the run started; absent until it has.
StartedAt *time.Time `json:"startedAt,omitempty"`
// Status is whether the run is over: queued, waiting, in_progress or completed.
Status *string `json:"status,omitempty"`
// Title is the run's display title, usually the commit's subject.
Title *string `json:"title,omitempty"`
// URL is the run's page on the forge.
Url *string `json:"url,omitempty"`
// Workflow is the workflow file that ran, such as cicd.yml.
Workflow *string `json:"workflow,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CiRun CiRun
// NewCiRun instantiates a new CiRun 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 NewCiRun() *CiRun {
this := CiRun{}
return &this
}
// NewCiRunWithDefaults instantiates a new CiRun 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 NewCiRunWithDefaults() *CiRun {
this := CiRun{}
return &this
}
// GetAttempt returns the Attempt field value if set, zero value otherwise.
func (o *CiRun) GetAttempt() int64 {
if o == nil || IsNil(o.Attempt) {
var ret int64
return ret
}
return *o.Attempt
}
// GetAttemptOk returns a tuple with the Attempt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetAttemptOk() (*int64, bool) {
if o == nil || IsNil(o.Attempt) {
return nil, false
}
return o.Attempt, true
}
// HasAttempt returns a boolean if a field has been set.
func (o *CiRun) HasAttempt() bool {
if o != nil && !IsNil(o.Attempt) {
return true
}
return false
}
// SetAttempt gets a reference to the given int64 and assigns it to the Attempt field.
func (o *CiRun) SetAttempt(v int64) {
o.Attempt = &v
}
// GetConclusion returns the Conclusion field value if set, zero value otherwise.
func (o *CiRun) GetConclusion() string {
if o == nil || IsNil(o.Conclusion) {
var ret string
return ret
}
return *o.Conclusion
}
// GetConclusionOk returns a tuple with the Conclusion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetConclusionOk() (*string, bool) {
if o == nil || IsNil(o.Conclusion) {
return nil, false
}
return o.Conclusion, true
}
// HasConclusion returns a boolean if a field has been set.
func (o *CiRun) HasConclusion() bool {
if o != nil && !IsNil(o.Conclusion) {
return true
}
return false
}
// SetConclusion gets a reference to the given string and assigns it to the Conclusion field.
func (o *CiRun) SetConclusion(v string) {
o.Conclusion = &v
}
// GetEndedAt returns the EndedAt field value if set, zero value otherwise.
func (o *CiRun) GetEndedAt() time.Time {
if o == nil || IsNil(o.EndedAt) {
var ret time.Time
return ret
}
return *o.EndedAt
}
// GetEndedAtOk returns a tuple with the EndedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetEndedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.EndedAt) {
return nil, false
}
return o.EndedAt, true
}
// HasEndedAt returns a boolean if a field has been set.
func (o *CiRun) HasEndedAt() bool {
if o != nil && !IsNil(o.EndedAt) {
return true
}
return false
}
// SetEndedAt gets a reference to the given time.Time and assigns it to the EndedAt field.
func (o *CiRun) SetEndedAt(v time.Time) {
o.EndedAt = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *CiRun) GetEvent() string {
if o == nil || IsNil(o.Event) {
var ret string
return ret
}
return *o.Event
}
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetEventOk() (*string, bool) {
if o == nil || IsNil(o.Event) {
return nil, false
}
return o.Event, true
}
// HasEvent returns a boolean if a field has been set.
func (o *CiRun) HasEvent() bool {
if o != nil && !IsNil(o.Event) {
return true
}
return false
}
// SetEvent gets a reference to the given string and assigns it to the Event field.
func (o *CiRun) SetEvent(v string) {
o.Event = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CiRun) GetId() int64 {
if o == nil || IsNil(o.Id) {
var ret int64
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetIdOk() (*int64, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *CiRun) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int64 and assigns it to the Id field.
func (o *CiRun) SetId(v int64) {
o.Id = &v
}
// GetJobs returns the Jobs field value if set, zero value otherwise.
func (o *CiRun) GetJobs() []CiJob {
if o == nil || IsNil(o.Jobs) {
var ret []CiJob
return ret
}
return o.Jobs
}
// GetJobsOk returns a tuple with the Jobs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetJobsOk() ([]CiJob, bool) {
if o == nil || IsNil(o.Jobs) {
return nil, false
}
return o.Jobs, true
}
// HasJobs returns a boolean if a field has been set.
func (o *CiRun) HasJobs() bool {
if o != nil && !IsNil(o.Jobs) {
return true
}
return false
}
// SetJobs gets a reference to the given []CiJob and assigns it to the Jobs field.
func (o *CiRun) SetJobs(v []CiJob) {
o.Jobs = v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *CiRun) GetNumber() int64 {
if o == nil || IsNil(o.Number) {
var ret int64
return ret
}
return *o.Number
}
// GetNumberOk returns a tuple with the Number field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetNumberOk() (*int64, bool) {
if o == nil || IsNil(o.Number) {
return nil, false
}
return o.Number, true
}
// HasNumber returns a boolean if a field has been set.
func (o *CiRun) HasNumber() bool {
if o != nil && !IsNil(o.Number) {
return true
}
return false
}
// SetNumber gets a reference to the given int64 and assigns it to the Number field.
func (o *CiRun) SetNumber(v int64) {
o.Number = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *CiRun) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *CiRun) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *CiRun) SetRef(v string) {
o.Ref = &v
}
// GetSha returns the Sha field value if set, zero value otherwise.
func (o *CiRun) GetSha() string {
if o == nil || IsNil(o.Sha) {
var ret string
return ret
}
return *o.Sha
}
// GetShaOk returns a tuple with the Sha field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetShaOk() (*string, bool) {
if o == nil || IsNil(o.Sha) {
return nil, false
}
return o.Sha, true
}
// HasSha returns a boolean if a field has been set.
func (o *CiRun) HasSha() bool {
if o != nil && !IsNil(o.Sha) {
return true
}
return false
}
// SetSha gets a reference to the given string and assigns it to the Sha field.
func (o *CiRun) SetSha(v string) {
o.Sha = &v
}
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
func (o *CiRun) GetStartedAt() time.Time {
if o == nil || IsNil(o.StartedAt) {
var ret time.Time
return ret
}
return *o.StartedAt
}
// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetStartedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.StartedAt) {
return nil, false
}
return o.StartedAt, true
}
// HasStartedAt returns a boolean if a field has been set.
func (o *CiRun) HasStartedAt() bool {
if o != nil && !IsNil(o.StartedAt) {
return true
}
return false
}
// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field.
func (o *CiRun) SetStartedAt(v time.Time) {
o.StartedAt = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CiRun) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *CiRun) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *CiRun) SetStatus(v string) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *CiRun) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *CiRun) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *CiRun) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *CiRun) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *CiRun) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *CiRun) SetUrl(v string) {
o.Url = &v
}
// GetWorkflow returns the Workflow field value if set, zero value otherwise.
func (o *CiRun) GetWorkflow() string {
if o == nil || IsNil(o.Workflow) {
var ret string
return ret
}
return *o.Workflow
}
// GetWorkflowOk returns a tuple with the Workflow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiRun) GetWorkflowOk() (*string, bool) {
if o == nil || IsNil(o.Workflow) {
return nil, false
}
return o.Workflow, true
}
// HasWorkflow returns a boolean if a field has been set.
func (o *CiRun) HasWorkflow() bool {
if o != nil && !IsNil(o.Workflow) {
return true
}
return false
}
// SetWorkflow gets a reference to the given string and assigns it to the Workflow field.
func (o *CiRun) SetWorkflow(v string) {
o.Workflow = &v
}
func (o CiRun) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CiRun) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Attempt) {
toSerialize["attempt"] = o.Attempt
}
if !IsNil(o.Conclusion) {
toSerialize["conclusion"] = o.Conclusion
}
if !IsNil(o.EndedAt) {
toSerialize["endedAt"] = o.EndedAt
}
if !IsNil(o.Event) {
toSerialize["event"] = o.Event
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Jobs) {
toSerialize["jobs"] = o.Jobs
}
if !IsNil(o.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Sha) {
toSerialize["sha"] = o.Sha
}
if !IsNil(o.StartedAt) {
toSerialize["startedAt"] = o.StartedAt
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
if !IsNil(o.Workflow) {
toSerialize["workflow"] = o.Workflow
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CiRun) UnmarshalJSON(data []byte) (err error) {
varCiRun := _CiRun{}
err = json.Unmarshal(data, &varCiRun)
if err != nil {
return err
}
*o = CiRun(varCiRun)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "attempt")
delete(additionalProperties, "conclusion")
delete(additionalProperties, "endedAt")
delete(additionalProperties, "event")
delete(additionalProperties, "id")
delete(additionalProperties, "jobs")
delete(additionalProperties, "number")
delete(additionalProperties, "ref")
delete(additionalProperties, "sha")
delete(additionalProperties, "startedAt")
delete(additionalProperties, "status")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
delete(additionalProperties, "workflow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCiRun struct {
value *CiRun
isSet bool
}
func (v NullableCiRun) Get() *CiRun {
return v.value
}
func (v *NullableCiRun) Set(val *CiRun) {
v.value = val
v.isSet = true
}
func (v NullableCiRun) IsSet() bool {
return v.isSet
}
func (v *NullableCiRun) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCiRun(val *CiRun) *NullableCiRun {
return &NullableCiRun{value: val, isSet: true}
}
func (v NullableCiRun) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCiRun) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}