mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
8.9 KiB
Go
345 lines
8.9 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 PlatformBuildRow type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformBuildRow{}
|
|
|
|
// PlatformBuildRow struct for PlatformBuildRow
|
|
type PlatformBuildRow struct {
|
|
// Commit is the short git ref the build pinned.
|
|
Commit *string `json:"commit,omitempty"`
|
|
// Duration is the wall time of a TERMINAL build; empty while it still runs.
|
|
Duration *string `json:"duration,omitempty"`
|
|
// ID is the build record's id.
|
|
Id *string `json:"id,omitempty"`
|
|
// Repo is the repo the build built, or the image it produced.
|
|
Repo *string `json:"repo,omitempty"`
|
|
// StartedAt is when the build was recorded, RFC3339 UTC.
|
|
StartedAt *string `json:"startedAt,omitempty"`
|
|
// Status is the build's real state: queued, building, succeeded or failed.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformBuildRow PlatformBuildRow
|
|
|
|
// NewPlatformBuildRow instantiates a new PlatformBuildRow 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 NewPlatformBuildRow() *PlatformBuildRow {
|
|
this := PlatformBuildRow{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformBuildRowWithDefaults instantiates a new PlatformBuildRow 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 NewPlatformBuildRowWithDefaults() *PlatformBuildRow {
|
|
this := PlatformBuildRow{}
|
|
return &this
|
|
}
|
|
|
|
// GetCommit returns the Commit field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) SetCommit(v string) {
|
|
o.Commit = &v
|
|
}
|
|
|
|
// GetDuration returns the Duration field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) GetDuration() string {
|
|
if o == nil || IsNil(o.Duration) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Duration
|
|
}
|
|
|
|
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBuildRow) GetDurationOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Duration) {
|
|
return nil, false
|
|
}
|
|
return o.Duration, true
|
|
}
|
|
|
|
// HasDuration returns a boolean if a field has been set.
|
|
func (o *PlatformBuildRow) HasDuration() bool {
|
|
if o != nil && !IsNil(o.Duration) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDuration gets a reference to the given string and assigns it to the Duration field.
|
|
func (o *PlatformBuildRow) SetDuration(v string) {
|
|
o.Duration = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) GetStartedAt() string {
|
|
if o == nil || IsNil(o.StartedAt) {
|
|
var ret string
|
|
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 *PlatformBuildRow) GetStartedAtOk() (*string, 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 *PlatformBuildRow) HasStartedAt() bool {
|
|
if o != nil && !IsNil(o.StartedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStartedAt gets a reference to the given string and assigns it to the StartedAt field.
|
|
func (o *PlatformBuildRow) SetStartedAt(v string) {
|
|
o.StartedAt = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) 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 *PlatformBuildRow) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o PlatformBuildRow) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformBuildRow) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Commit) {
|
|
toSerialize["commit"] = o.Commit
|
|
}
|
|
if !IsNil(o.Duration) {
|
|
toSerialize["duration"] = o.Duration
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
if !IsNil(o.StartedAt) {
|
|
toSerialize["startedAt"] = o.StartedAt
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformBuildRow) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformBuildRow := _PlatformBuildRow{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformBuildRow)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformBuildRow(varPlatformBuildRow)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "commit")
|
|
delete(additionalProperties, "duration")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "startedAt")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformBuildRow struct {
|
|
value *PlatformBuildRow
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformBuildRow) Get() *PlatformBuildRow {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformBuildRow) Set(val *PlatformBuildRow) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformBuildRow) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformBuildRow) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformBuildRow(val *PlatformBuildRow) *NullablePlatformBuildRow {
|
|
return &NullablePlatformBuildRow{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformBuildRow) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformBuildRow) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|