Files
sdk/model_agent_report_run_in.go

421 lines
11 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 AgentReportRunIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentReportRunIn{}
// AgentReportRunIn struct for AgentReportRunIn
type AgentReportRunIn struct {
// Branch, CommitSha and Diffstat describe what the run produced; Error is the failure when OK is false. Each is clamped, never rejected.
Branch *string `json:"branch,omitempty"`
// Changed says whether the run produced any commit. It is INDEPENDENT of OK: a run can succeed and change nothing (there was nothing to do), and a run can fail after committing some of its work. Two questions, two booleans.
Changed *bool `json:"changed,omitempty"`
// CommitSha is the tip the run pushed, clamped to 128 characters. Empty when it pushed nothing, which is the same case Changed reports false for.
CommitSha *string `json:"commitSha,omitempty"`
// Diffstat is the run's own summary of what it changed, as text, clamped to 64 KiB. Free-form: it is shown, never parsed.
Diffstat *string `json:"diffstat,omitempty"`
// Error is why the run failed, clamped to 64 KiB. It is CLAMPED rather than refused — a truncated reason is worth more than a rejected report, because a rejected report leaves the durable workflow waiting forever.
Error *string `json:"error,omitempty"`
// ID is the machine reporting, from the path.
Id *string `json:"id,omitempty"`
// OK is whether the run succeeded; Changed whether it produced any commit.
Ok *bool `json:"ok,omitempty"`
// RunID is the routed run being completed, from the path.
RunId *string `json:"runId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentReportRunIn AgentReportRunIn
// NewAgentReportRunIn instantiates a new AgentReportRunIn 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 NewAgentReportRunIn() *AgentReportRunIn {
this := AgentReportRunIn{}
return &this
}
// NewAgentReportRunInWithDefaults instantiates a new AgentReportRunIn 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 NewAgentReportRunInWithDefaults() *AgentReportRunIn {
this := AgentReportRunIn{}
return &this
}
// GetBranch returns the Branch field value if set, zero value otherwise.
func (o *AgentReportRunIn) 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 *AgentReportRunIn) 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 *AgentReportRunIn) 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 *AgentReportRunIn) SetBranch(v string) {
o.Branch = &v
}
// GetChanged returns the Changed field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetChanged() bool {
if o == nil || IsNil(o.Changed) {
var ret bool
return ret
}
return *o.Changed
}
// GetChangedOk returns a tuple with the Changed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetChangedOk() (*bool, bool) {
if o == nil || IsNil(o.Changed) {
return nil, false
}
return o.Changed, true
}
// HasChanged returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasChanged() bool {
if o != nil && !IsNil(o.Changed) {
return true
}
return false
}
// SetChanged gets a reference to the given bool and assigns it to the Changed field.
func (o *AgentReportRunIn) SetChanged(v bool) {
o.Changed = &v
}
// GetCommitSha returns the CommitSha field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetCommitSha() string {
if o == nil || IsNil(o.CommitSha) {
var ret string
return ret
}
return *o.CommitSha
}
// GetCommitShaOk returns a tuple with the CommitSha field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetCommitShaOk() (*string, bool) {
if o == nil || IsNil(o.CommitSha) {
return nil, false
}
return o.CommitSha, true
}
// HasCommitSha returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasCommitSha() bool {
if o != nil && !IsNil(o.CommitSha) {
return true
}
return false
}
// SetCommitSha gets a reference to the given string and assigns it to the CommitSha field.
func (o *AgentReportRunIn) SetCommitSha(v string) {
o.CommitSha = &v
}
// GetDiffstat returns the Diffstat field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetDiffstat() string {
if o == nil || IsNil(o.Diffstat) {
var ret string
return ret
}
return *o.Diffstat
}
// GetDiffstatOk returns a tuple with the Diffstat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetDiffstatOk() (*string, bool) {
if o == nil || IsNil(o.Diffstat) {
return nil, false
}
return o.Diffstat, true
}
// HasDiffstat returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasDiffstat() bool {
if o != nil && !IsNil(o.Diffstat) {
return true
}
return false
}
// SetDiffstat gets a reference to the given string and assigns it to the Diffstat field.
func (o *AgentReportRunIn) SetDiffstat(v string) {
o.Diffstat = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *AgentReportRunIn) SetError(v string) {
o.Error = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AgentReportRunIn) 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 *AgentReportRunIn) 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 *AgentReportRunIn) 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 *AgentReportRunIn) SetId(v string) {
o.Id = &v
}
// GetOk returns the Ok field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetOk() bool {
if o == nil || IsNil(o.Ok) {
var ret bool
return ret
}
return *o.Ok
}
// GetOkOk returns a tuple with the Ok field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetOkOk() (*bool, bool) {
if o == nil || IsNil(o.Ok) {
return nil, false
}
return o.Ok, true
}
// HasOk returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasOk() bool {
if o != nil && !IsNil(o.Ok) {
return true
}
return false
}
// SetOk gets a reference to the given bool and assigns it to the Ok field.
func (o *AgentReportRunIn) SetOk(v bool) {
o.Ok = &v
}
// GetRunId returns the RunId field value if set, zero value otherwise.
func (o *AgentReportRunIn) GetRunId() string {
if o == nil || IsNil(o.RunId) {
var ret string
return ret
}
return *o.RunId
}
// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentReportRunIn) GetRunIdOk() (*string, bool) {
if o == nil || IsNil(o.RunId) {
return nil, false
}
return o.RunId, true
}
// HasRunId returns a boolean if a field has been set.
func (o *AgentReportRunIn) HasRunId() bool {
if o != nil && !IsNil(o.RunId) {
return true
}
return false
}
// SetRunId gets a reference to the given string and assigns it to the RunId field.
func (o *AgentReportRunIn) SetRunId(v string) {
o.RunId = &v
}
func (o AgentReportRunIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentReportRunIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Branch) {
toSerialize["branch"] = o.Branch
}
if !IsNil(o.Changed) {
toSerialize["changed"] = o.Changed
}
if !IsNil(o.CommitSha) {
toSerialize["commitSha"] = o.CommitSha
}
if !IsNil(o.Diffstat) {
toSerialize["diffstat"] = o.Diffstat
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Ok) {
toSerialize["ok"] = o.Ok
}
if !IsNil(o.RunId) {
toSerialize["runId"] = o.RunId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentReportRunIn) UnmarshalJSON(data []byte) (err error) {
varAgentReportRunIn := _AgentReportRunIn{}
err = json.Unmarshal(data, &varAgentReportRunIn)
if err != nil {
return err
}
*o = AgentReportRunIn(varAgentReportRunIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "branch")
delete(additionalProperties, "changed")
delete(additionalProperties, "commitSha")
delete(additionalProperties, "diffstat")
delete(additionalProperties, "error")
delete(additionalProperties, "id")
delete(additionalProperties, "ok")
delete(additionalProperties, "runId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentReportRunIn struct {
value *AgentReportRunIn
isSet bool
}
func (v NullableAgentReportRunIn) Get() *AgentReportRunIn {
return v.value
}
func (v *NullableAgentReportRunIn) Set(val *AgentReportRunIn) {
v.value = val
v.isSet = true
}
func (v NullableAgentReportRunIn) IsSet() bool {
return v.isSet
}
func (v *NullableAgentReportRunIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentReportRunIn(val *AgentReportRunIn) *NullableAgentReportRunIn {
return &NullableAgentReportRunIn{value: val, isSet: true}
}
func (v NullableAgentReportRunIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentReportRunIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}