Files
sdk/model_forge_job.go

228 lines
5.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 ForgeJob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ForgeJob{}
// ForgeJob struct for ForgeJob
type ForgeJob struct {
Action *string `json:"action,omitempty"`
Repository *ForgeJobRepository `json:"repository,omitempty"`
WorkflowJob *ForgeJobWorkflowJob `json:"workflow_job,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ForgeJob ForgeJob
// NewForgeJob instantiates a new ForgeJob 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 NewForgeJob() *ForgeJob {
this := ForgeJob{}
return &this
}
// NewForgeJobWithDefaults instantiates a new ForgeJob 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 NewForgeJobWithDefaults() *ForgeJob {
this := ForgeJob{}
return &this
}
// GetAction returns the Action field value if set, zero value otherwise.
func (o *ForgeJob) GetAction() string {
if o == nil || IsNil(o.Action) {
var ret string
return ret
}
return *o.Action
}
// GetActionOk returns a tuple with the Action field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ForgeJob) GetActionOk() (*string, bool) {
if o == nil || IsNil(o.Action) {
return nil, false
}
return o.Action, true
}
// HasAction returns a boolean if a field has been set.
func (o *ForgeJob) HasAction() bool {
if o != nil && !IsNil(o.Action) {
return true
}
return false
}
// SetAction gets a reference to the given string and assigns it to the Action field.
func (o *ForgeJob) SetAction(v string) {
o.Action = &v
}
// GetRepository returns the Repository field value if set, zero value otherwise.
func (o *ForgeJob) GetRepository() ForgeJobRepository {
if o == nil || IsNil(o.Repository) {
var ret ForgeJobRepository
return ret
}
return *o.Repository
}
// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ForgeJob) GetRepositoryOk() (*ForgeJobRepository, bool) {
if o == nil || IsNil(o.Repository) {
return nil, false
}
return o.Repository, true
}
// HasRepository returns a boolean if a field has been set.
func (o *ForgeJob) HasRepository() bool {
if o != nil && !IsNil(o.Repository) {
return true
}
return false
}
// SetRepository gets a reference to the given ForgeJobRepository and assigns it to the Repository field.
func (o *ForgeJob) SetRepository(v ForgeJobRepository) {
o.Repository = &v
}
// GetWorkflowJob returns the WorkflowJob field value if set, zero value otherwise.
func (o *ForgeJob) GetWorkflowJob() ForgeJobWorkflowJob {
if o == nil || IsNil(o.WorkflowJob) {
var ret ForgeJobWorkflowJob
return ret
}
return *o.WorkflowJob
}
// GetWorkflowJobOk returns a tuple with the WorkflowJob field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ForgeJob) GetWorkflowJobOk() (*ForgeJobWorkflowJob, bool) {
if o == nil || IsNil(o.WorkflowJob) {
return nil, false
}
return o.WorkflowJob, true
}
// HasWorkflowJob returns a boolean if a field has been set.
func (o *ForgeJob) HasWorkflowJob() bool {
if o != nil && !IsNil(o.WorkflowJob) {
return true
}
return false
}
// SetWorkflowJob gets a reference to the given ForgeJobWorkflowJob and assigns it to the WorkflowJob field.
func (o *ForgeJob) SetWorkflowJob(v ForgeJobWorkflowJob) {
o.WorkflowJob = &v
}
func (o ForgeJob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ForgeJob) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Action) {
toSerialize["action"] = o.Action
}
if !IsNil(o.Repository) {
toSerialize["repository"] = o.Repository
}
if !IsNil(o.WorkflowJob) {
toSerialize["workflow_job"] = o.WorkflowJob
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ForgeJob) UnmarshalJSON(data []byte) (err error) {
varForgeJob := _ForgeJob{}
err = json.Unmarshal(data, &varForgeJob)
if err != nil {
return err
}
*o = ForgeJob(varForgeJob)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "repository")
delete(additionalProperties, "workflow_job")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableForgeJob struct {
value *ForgeJob
isSet bool
}
func (v NullableForgeJob) Get() *ForgeJob {
return v.value
}
func (v *NullableForgeJob) Set(val *ForgeJob) {
v.value = val
v.isSet = true
}
func (v NullableForgeJob) IsSet() bool {
return v.isSet
}
func (v *NullableForgeJob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableForgeJob(val *ForgeJob) *NullableForgeJob {
return &NullableForgeJob{value: val, isSet: true}
}
func (v NullableForgeJob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableForgeJob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}