Files
sdk/model_ci_execution.go

674 lines
17 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 CiExecution type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CiExecution{}
// CiExecution struct for CiExecution
type CiExecution struct {
Actor *string `json:"actor,omitempty"`
Branch *string `json:"branch,omitempty"`
Conclusion *string `json:"conclusion,omitempty"`
EndedAt *time.Time `json:"endedAt,omitempty"`
Event *string `json:"event,omitempty"`
Id *int64 `json:"id,omitempty"`
Number *int64 `json:"number,omitempty"`
Org *string `json:"org,omitempty"`
Repo *string `json:"repo,omitempty"`
Sha *string `json:"sha,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
// Status and Conclusion are BOTH required to know how a run went, and reading only one is wrong in a way that looks fine. Status answers \"is it over\" (queued | in_progress | completed); Conclusion answers \"how did it end\" and is empty until it is over. A view that buckets on Status alone sees `completed` and cannot tell a pass from a failure, so it draws every finished run — successes and cancellations included — the same way.
Status *string `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
Url *string `json:"url,omitempty"`
Workflow *string `json:"workflow,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CiExecution CiExecution
// NewCiExecution instantiates a new CiExecution 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 NewCiExecution() *CiExecution {
this := CiExecution{}
return &this
}
// NewCiExecutionWithDefaults instantiates a new CiExecution 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 NewCiExecutionWithDefaults() *CiExecution {
this := CiExecution{}
return &this
}
// GetActor returns the Actor field value if set, zero value otherwise.
func (o *CiExecution) GetActor() string {
if o == nil || IsNil(o.Actor) {
var ret string
return ret
}
return *o.Actor
}
// GetActorOk returns a tuple with the Actor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecution) GetActorOk() (*string, bool) {
if o == nil || IsNil(o.Actor) {
return nil, false
}
return o.Actor, true
}
// HasActor returns a boolean if a field has been set.
func (o *CiExecution) HasActor() bool {
if o != nil && !IsNil(o.Actor) {
return true
}
return false
}
// SetActor gets a reference to the given string and assigns it to the Actor field.
func (o *CiExecution) SetActor(v string) {
o.Actor = &v
}
// GetBranch returns the Branch field value if set, zero value otherwise.
func (o *CiExecution) GetBranch() string {
if o == nil || IsNil(o.Branch) {
var ret string
return ret
}
return *o.Branch
}
// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecution) GetBranchOk() (*string, bool) {
if o == nil || IsNil(o.Branch) {
return nil, false
}
return o.Branch, true
}
// HasBranch returns a boolean if a field has been set.
func (o *CiExecution) HasBranch() bool {
if o != nil && !IsNil(o.Branch) {
return true
}
return false
}
// SetBranch gets a reference to the given string and assigns it to the Branch field.
func (o *CiExecution) SetBranch(v string) {
o.Branch = &v
}
// GetConclusion returns the Conclusion field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetConclusion(v string) {
o.Conclusion = &v
}
// GetEndedAt returns the EndedAt field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetEndedAt(v time.Time) {
o.EndedAt = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetEvent(v string) {
o.Event = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetId(v int64) {
o.Id = &v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetNumber(v int64) {
o.Number = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *CiExecution) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecution) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *CiExecution) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *CiExecution) SetOrg(v string) {
o.Org = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *CiExecution) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CiExecution) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *CiExecution) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *CiExecution) SetRepo(v string) {
o.Repo = &v
}
// GetSha returns the Sha field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetSha(v string) {
o.Sha = &v
}
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetStartedAt(v time.Time) {
o.StartedAt = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetStatus(v string) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetUrl(v string) {
o.Url = &v
}
// GetWorkflow returns the Workflow field value if set, zero value otherwise.
func (o *CiExecution) 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 *CiExecution) 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 *CiExecution) 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 *CiExecution) SetWorkflow(v string) {
o.Workflow = &v
}
func (o CiExecution) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CiExecution) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actor) {
toSerialize["actor"] = o.Actor
}
if !IsNil(o.Branch) {
toSerialize["branch"] = o.Branch
}
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.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
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 *CiExecution) UnmarshalJSON(data []byte) (err error) {
varCiExecution := _CiExecution{}
err = json.Unmarshal(data, &varCiExecution)
if err != nil {
return err
}
*o = CiExecution(varCiExecution)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actor")
delete(additionalProperties, "branch")
delete(additionalProperties, "conclusion")
delete(additionalProperties, "endedAt")
delete(additionalProperties, "event")
delete(additionalProperties, "id")
delete(additionalProperties, "number")
delete(additionalProperties, "org")
delete(additionalProperties, "repo")
delete(additionalProperties, "sha")
delete(additionalProperties, "startedAt")
delete(additionalProperties, "status")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
delete(additionalProperties, "workflow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCiExecution struct {
value *CiExecution
isSet bool
}
func (v NullableCiExecution) Get() *CiExecution {
return v.value
}
func (v *NullableCiExecution) Set(val *CiExecution) {
v.value = val
v.isSet = true
}
func (v NullableCiExecution) IsSet() bool {
return v.isSet
}
func (v *NullableCiExecution) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCiExecution(val *CiExecution) *NullableCiExecution {
return &NullableCiExecution{value: val, isSet: true}
}
func (v NullableCiExecution) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCiExecution) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}