Files
sdk/model_git_workflow_run.go

535 lines
14 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 GitWorkflowRun type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitWorkflowRun{}
// GitWorkflowRun struct for GitWorkflowRun
type GitWorkflowRun struct {
// Actor is who caused it.
Actor *string `json:"actor,omitempty"`
// Commit is the commit being run, in full.
Commit *string `json:"commit,omitempty"`
// CreatedAt is when the run was opened, in unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Event is what caused the run, e.g. \"push\".
Event *string `json:"event,omitempty"`
// ID addresses this run.
Id *string `json:"id,omitempty"`
// Number is the run's position in its repository, counting from 1 — the handle a person uses (\"#4\").
Number *int64 `json:"number,omitempty"`
// Ref is the full ref, e.g. \"refs/heads/main\".
Ref *string `json:"ref,omitempty"`
// Repo is the repository the run is for.
Repo *string `json:"repo,omitempty"`
// Status is waiting, running, success, failure, cancelled or skipped.
Status *string `json:"status,omitempty"`
// UpdatedAt is when its status last changed, in unix seconds.
UpdatedAt *int64 `json:"updatedAt,omitempty"`
// Workflow is the path of the document being run, e.g. \".hanzo/workflows/ci.yml\".
Workflow *string `json:"workflow,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitWorkflowRun GitWorkflowRun
// NewGitWorkflowRun instantiates a new GitWorkflowRun 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 NewGitWorkflowRun() *GitWorkflowRun {
this := GitWorkflowRun{}
return &this
}
// NewGitWorkflowRunWithDefaults instantiates a new GitWorkflowRun 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 NewGitWorkflowRunWithDefaults() *GitWorkflowRun {
this := GitWorkflowRun{}
return &this
}
// GetActor returns the Actor field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetActor(v string) {
o.Actor = &v
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *GitWorkflowRun) GetCommit() string {
if o == nil || IsNil(o.Commit) {
var ret string
return ret
}
return *o.Commit
}
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitWorkflowRun) GetCommitOk() (*string, bool) {
if o == nil || IsNil(o.Commit) {
return nil, false
}
return o.Commit, true
}
// HasCommit returns a boolean if a field has been set.
func (o *GitWorkflowRun) HasCommit() bool {
if o != nil && !IsNil(o.Commit) {
return true
}
return false
}
// SetCommit gets a reference to the given string and assigns it to the Commit field.
func (o *GitWorkflowRun) SetCommit(v string) {
o.Commit = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetEvent(v string) {
o.Event = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *GitWorkflowRun) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
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 *GitWorkflowRun) GetIdOk() (*string, 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 *GitWorkflowRun) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *GitWorkflowRun) SetId(v string) {
o.Id = &v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetNumber(v int64) {
o.Number = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetRef(v string) {
o.Ref = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetRepo(v string) {
o.Repo = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *GitWorkflowRun) GetUpdatedAt() int64 {
if o == nil || IsNil(o.UpdatedAt) {
var ret int64
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitWorkflowRun) GetUpdatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *GitWorkflowRun) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
func (o *GitWorkflowRun) SetUpdatedAt(v int64) {
o.UpdatedAt = &v
}
// GetWorkflow returns the Workflow field value if set, zero value otherwise.
func (o *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) 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 *GitWorkflowRun) SetWorkflow(v string) {
o.Workflow = &v
}
func (o GitWorkflowRun) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitWorkflowRun) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actor) {
toSerialize["actor"] = o.Actor
}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
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.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if !IsNil(o.Workflow) {
toSerialize["workflow"] = o.Workflow
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitWorkflowRun) UnmarshalJSON(data []byte) (err error) {
varGitWorkflowRun := _GitWorkflowRun{}
err = json.Unmarshal(data, &varGitWorkflowRun)
if err != nil {
return err
}
*o = GitWorkflowRun(varGitWorkflowRun)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actor")
delete(additionalProperties, "commit")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "event")
delete(additionalProperties, "id")
delete(additionalProperties, "number")
delete(additionalProperties, "ref")
delete(additionalProperties, "repo")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "workflow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitWorkflowRun struct {
value *GitWorkflowRun
isSet bool
}
func (v NullableGitWorkflowRun) Get() *GitWorkflowRun {
return v.value
}
func (v *NullableGitWorkflowRun) Set(val *GitWorkflowRun) {
v.value = val
v.isSet = true
}
func (v NullableGitWorkflowRun) IsSet() bool {
return v.isSet
}
func (v *NullableGitWorkflowRun) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitWorkflowRun(val *GitWorkflowRun) *NullableGitWorkflowRun {
return &NullableGitWorkflowRun{value: val, isSet: true}
}
func (v NullableGitWorkflowRun) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitWorkflowRun) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}