mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
380 lines
9.8 KiB
Go
380 lines
9.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"
|
|
"time"
|
|
)
|
|
|
|
// checks if the CiCheck type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CiCheck{}
|
|
|
|
// CiCheck struct for CiCheck
|
|
type CiCheck struct {
|
|
At *time.Time `json:"at,omitempty"`
|
|
// Job is the job that decided State. A run reports one conclusion for however many jobs it holds, and the jobs are not interchangeable: the pipeline fails at `gate` before it builds anything and at `receipt` after it has already built, pinned and proved the release live. Both read `failure` on the run, and only the first one means nothing shipped.
|
|
Job *string `json:"job,omitempty"`
|
|
Number *int64 `json:"number,omitempty"`
|
|
// State is success | failure | running | absent. `absent` is not a kind of failure and is kept apart from one: a failing run is a build that ran and said no, while an absent run is Hanzo Git never having constructed a run for the commit at all — a workflow it cannot parse or a reference it cannot resolve. There is no log to open for the second, so a page that draws them the same sends you looking for one that does not exist.
|
|
State *string `json:"state,omitempty"`
|
|
// Tested reports that the run's tests executed; Verdict reports that the run said anything about tests at all. They are separate because the interesting case is a run that passed while its test step was skipped — a green build that proved nothing — and that is invisible if the two are one flag.
|
|
Tested *bool `json:"tested,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
Verdict *bool `json:"verdict,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CiCheck CiCheck
|
|
|
|
// NewCiCheck instantiates a new CiCheck 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 NewCiCheck() *CiCheck {
|
|
this := CiCheck{}
|
|
return &this
|
|
}
|
|
|
|
// NewCiCheckWithDefaults instantiates a new CiCheck 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 NewCiCheckWithDefaults() *CiCheck {
|
|
this := CiCheck{}
|
|
return &this
|
|
}
|
|
|
|
// GetAt returns the At field value if set, zero value otherwise.
|
|
func (o *CiCheck) GetAt() time.Time {
|
|
if o == nil || IsNil(o.At) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.At
|
|
}
|
|
|
|
// GetAtOk returns a tuple with the At field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CiCheck) GetAtOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.At) {
|
|
return nil, false
|
|
}
|
|
return o.At, true
|
|
}
|
|
|
|
// HasAt returns a boolean if a field has been set.
|
|
func (o *CiCheck) HasAt() bool {
|
|
if o != nil && !IsNil(o.At) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAt gets a reference to the given time.Time and assigns it to the At field.
|
|
func (o *CiCheck) SetAt(v time.Time) {
|
|
o.At = &v
|
|
}
|
|
|
|
// GetJob returns the Job field value if set, zero value otherwise.
|
|
func (o *CiCheck) GetJob() string {
|
|
if o == nil || IsNil(o.Job) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Job
|
|
}
|
|
|
|
// GetJobOk returns a tuple with the Job field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CiCheck) GetJobOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Job) {
|
|
return nil, false
|
|
}
|
|
return o.Job, true
|
|
}
|
|
|
|
// HasJob returns a boolean if a field has been set.
|
|
func (o *CiCheck) HasJob() bool {
|
|
if o != nil && !IsNil(o.Job) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetJob gets a reference to the given string and assigns it to the Job field.
|
|
func (o *CiCheck) SetJob(v string) {
|
|
o.Job = &v
|
|
}
|
|
|
|
// GetNumber returns the Number field value if set, zero value otherwise.
|
|
func (o *CiCheck) 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 *CiCheck) 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 *CiCheck) 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 *CiCheck) SetNumber(v int64) {
|
|
o.Number = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *CiCheck) GetState() string {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CiCheck) GetStateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *CiCheck) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given string and assigns it to the State field.
|
|
func (o *CiCheck) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetTested returns the Tested field value if set, zero value otherwise.
|
|
func (o *CiCheck) GetTested() bool {
|
|
if o == nil || IsNil(o.Tested) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Tested
|
|
}
|
|
|
|
// GetTestedOk returns a tuple with the Tested field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CiCheck) GetTestedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Tested) {
|
|
return nil, false
|
|
}
|
|
return o.Tested, true
|
|
}
|
|
|
|
// HasTested returns a boolean if a field has been set.
|
|
func (o *CiCheck) HasTested() bool {
|
|
if o != nil && !IsNil(o.Tested) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTested gets a reference to the given bool and assigns it to the Tested field.
|
|
func (o *CiCheck) SetTested(v bool) {
|
|
o.Tested = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *CiCheck) 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 *CiCheck) 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 *CiCheck) 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 *CiCheck) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
// GetVerdict returns the Verdict field value if set, zero value otherwise.
|
|
func (o *CiCheck) GetVerdict() bool {
|
|
if o == nil || IsNil(o.Verdict) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Verdict
|
|
}
|
|
|
|
// GetVerdictOk returns a tuple with the Verdict field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CiCheck) GetVerdictOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Verdict) {
|
|
return nil, false
|
|
}
|
|
return o.Verdict, true
|
|
}
|
|
|
|
// HasVerdict returns a boolean if a field has been set.
|
|
func (o *CiCheck) HasVerdict() bool {
|
|
if o != nil && !IsNil(o.Verdict) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVerdict gets a reference to the given bool and assigns it to the Verdict field.
|
|
func (o *CiCheck) SetVerdict(v bool) {
|
|
o.Verdict = &v
|
|
}
|
|
|
|
func (o CiCheck) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CiCheck) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.At) {
|
|
toSerialize["at"] = o.At
|
|
}
|
|
if !IsNil(o.Job) {
|
|
toSerialize["job"] = o.Job
|
|
}
|
|
if !IsNil(o.Number) {
|
|
toSerialize["number"] = o.Number
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Tested) {
|
|
toSerialize["tested"] = o.Tested
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
if !IsNil(o.Verdict) {
|
|
toSerialize["verdict"] = o.Verdict
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CiCheck) UnmarshalJSON(data []byte) (err error) {
|
|
varCiCheck := _CiCheck{}
|
|
|
|
err = json.Unmarshal(data, &varCiCheck)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CiCheck(varCiCheck)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "at")
|
|
delete(additionalProperties, "job")
|
|
delete(additionalProperties, "number")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "tested")
|
|
delete(additionalProperties, "url")
|
|
delete(additionalProperties, "verdict")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCiCheck struct {
|
|
value *CiCheck
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCiCheck) Get() *CiCheck {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCiCheck) Set(val *CiCheck) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCiCheck) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCiCheck) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCiCheck(val *CiCheck) *NullableCiCheck {
|
|
return &NullableCiCheck{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCiCheck) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCiCheck) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|