mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
573 lines
16 KiB
Go
573 lines
16 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 PlatformDeploymentView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformDeploymentView{}
|
|
|
|
// PlatformDeploymentView struct for PlatformDeploymentView
|
|
type PlatformDeploymentView struct {
|
|
// ApplicationID is the app this deployed — the app's `id`, not its slug.
|
|
ApplicationId *string `json:"applicationId,omitempty"`
|
|
// BuildID is the build record behind a git deploy, whose logs and status live at /v1/platform/builds. Empty for an image deploy.
|
|
BuildId *string `json:"buildId,omitempty"`
|
|
// Commit is the git ref this built — the commit a deploy or a push named, else the app's branch. Empty for an image deploy, which builds nothing.
|
|
Commit *string `json:"commit,omitempty"`
|
|
// CreatedAt is when the attempt was recorded, unix seconds.
|
|
CreatedAt *int64 `json:"createdAt,omitempty"`
|
|
// ID is the deployment's id (`dep_…`), minted when the attempt is recorded. The app's currentDeploymentId points at one of these.
|
|
Id *string `json:"id,omitempty"`
|
|
// Image is the full `repo:tag` this deployment put in the CR. For a git deploy it is the ref the in-cluster build pushes to, known before the build runs.
|
|
Image *string `json:"image,omitempty"`
|
|
// Message is why this attempt is not live: the failure, or the note that a newer deployment went live before this build finished. Empty while it is fine.
|
|
Message *string `json:"message,omitempty"`
|
|
// Org is the tenant the deployment belongs to, from the validated identity.
|
|
Org *string `json:"org,omitempty"`
|
|
// Source is which lane produced it: `git` (built from the repo) or `image` (an already-built ref deployed as-is, including promote and rollback).
|
|
Source *string `json:"source,omitempty"`
|
|
// Status is where the attempt got to: `building` while its image is being built, `deploying` once its CR reached the cluster — which is the terminal success state, the app's own status is what turns `live` — `error` with the reason in Message, or `superseded` when a newer version went live first.
|
|
Status *string `json:"status,omitempty"`
|
|
// UpdatedAt is its last transition, unix seconds — so for a terminal deployment it is when it reached that state.
|
|
UpdatedAt *int64 `json:"updatedAt,omitempty"`
|
|
// Version counts this app's deployments, from 1 and monotonically. It is what ORDERS them: a deploy only goes live if no higher version already is, so a build that finishes late is superseded instead of overwriting a newer one.
|
|
Version *int64 `json:"version,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformDeploymentView PlatformDeploymentView
|
|
|
|
// NewPlatformDeploymentView instantiates a new PlatformDeploymentView 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 NewPlatformDeploymentView() *PlatformDeploymentView {
|
|
this := PlatformDeploymentView{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformDeploymentViewWithDefaults instantiates a new PlatformDeploymentView 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 NewPlatformDeploymentViewWithDefaults() *PlatformDeploymentView {
|
|
this := PlatformDeploymentView{}
|
|
return &this
|
|
}
|
|
|
|
// GetApplicationId returns the ApplicationId field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetApplicationId() string {
|
|
if o == nil || IsNil(o.ApplicationId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ApplicationId
|
|
}
|
|
|
|
// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetApplicationIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ApplicationId) {
|
|
return nil, false
|
|
}
|
|
return o.ApplicationId, true
|
|
}
|
|
|
|
// HasApplicationId returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasApplicationId() bool {
|
|
if o != nil && !IsNil(o.ApplicationId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field.
|
|
func (o *PlatformDeploymentView) SetApplicationId(v string) {
|
|
o.ApplicationId = &v
|
|
}
|
|
|
|
// GetBuildId returns the BuildId field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetBuildId() string {
|
|
if o == nil || IsNil(o.BuildId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.BuildId
|
|
}
|
|
|
|
// GetBuildIdOk returns a tuple with the BuildId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetBuildIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.BuildId) {
|
|
return nil, false
|
|
}
|
|
return o.BuildId, true
|
|
}
|
|
|
|
// HasBuildId returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasBuildId() bool {
|
|
if o != nil && !IsNil(o.BuildId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBuildId gets a reference to the given string and assigns it to the BuildId field.
|
|
func (o *PlatformDeploymentView) SetBuildId(v string) {
|
|
o.BuildId = &v
|
|
}
|
|
|
|
// GetCommit returns the Commit field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) SetCommit(v string) {
|
|
o.Commit = &v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) SetCreatedAt(v int64) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetImage returns the Image field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetImage() string {
|
|
if o == nil || IsNil(o.Image) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Image
|
|
}
|
|
|
|
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetImageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Image) {
|
|
return nil, false
|
|
}
|
|
return o.Image, true
|
|
}
|
|
|
|
// HasImage returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasImage() bool {
|
|
if o != nil && !IsNil(o.Image) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetImage gets a reference to the given string and assigns it to the Image field.
|
|
func (o *PlatformDeploymentView) SetImage(v string) {
|
|
o.Image = &v
|
|
}
|
|
|
|
// GetMessage returns the Message field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetMessage() string {
|
|
if o == nil || IsNil(o.Message) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Message
|
|
}
|
|
|
|
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetMessageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Message) {
|
|
return nil, false
|
|
}
|
|
return o.Message, true
|
|
}
|
|
|
|
// HasMessage returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasMessage() bool {
|
|
if o != nil && !IsNil(o.Message) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
|
func (o *PlatformDeploymentView) SetMessage(v string) {
|
|
o.Message = &v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetOrg() string {
|
|
if o == nil || IsNil(o.Org) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Org
|
|
}
|
|
|
|
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetOrgOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Org) {
|
|
return nil, false
|
|
}
|
|
return o.Org, true
|
|
}
|
|
|
|
// HasOrg returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasOrg() bool {
|
|
if o != nil && !IsNil(o.Org) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOrg gets a reference to the given string and assigns it to the Org field.
|
|
func (o *PlatformDeploymentView) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *PlatformDeploymentView) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) 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 *PlatformDeploymentView) SetUpdatedAt(v int64) {
|
|
o.UpdatedAt = &v
|
|
}
|
|
|
|
// GetVersion returns the Version field value if set, zero value otherwise.
|
|
func (o *PlatformDeploymentView) GetVersion() int64 {
|
|
if o == nil || IsNil(o.Version) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Version
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformDeploymentView) GetVersionOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Version) {
|
|
return nil, false
|
|
}
|
|
return o.Version, true
|
|
}
|
|
|
|
// HasVersion returns a boolean if a field has been set.
|
|
func (o *PlatformDeploymentView) HasVersion() bool {
|
|
if o != nil && !IsNil(o.Version) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
|
|
func (o *PlatformDeploymentView) SetVersion(v int64) {
|
|
o.Version = &v
|
|
}
|
|
|
|
func (o PlatformDeploymentView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformDeploymentView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ApplicationId) {
|
|
toSerialize["applicationId"] = o.ApplicationId
|
|
}
|
|
if !IsNil(o.BuildId) {
|
|
toSerialize["buildId"] = o.BuildId
|
|
}
|
|
if !IsNil(o.Commit) {
|
|
toSerialize["commit"] = o.Commit
|
|
}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Image) {
|
|
toSerialize["image"] = o.Image
|
|
}
|
|
if !IsNil(o.Message) {
|
|
toSerialize["message"] = o.Message
|
|
}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.UpdatedAt) {
|
|
toSerialize["updatedAt"] = o.UpdatedAt
|
|
}
|
|
if !IsNil(o.Version) {
|
|
toSerialize["version"] = o.Version
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformDeploymentView) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformDeploymentView := _PlatformDeploymentView{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformDeploymentView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformDeploymentView(varPlatformDeploymentView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "applicationId")
|
|
delete(additionalProperties, "buildId")
|
|
delete(additionalProperties, "commit")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "image")
|
|
delete(additionalProperties, "message")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "source")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "updatedAt")
|
|
delete(additionalProperties, "version")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformDeploymentView struct {
|
|
value *PlatformDeploymentView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformDeploymentView) Get() *PlatformDeploymentView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformDeploymentView) Set(val *PlatformDeploymentView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformDeploymentView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformDeploymentView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformDeploymentView(val *PlatformDeploymentView) *NullablePlatformDeploymentView {
|
|
return &NullablePlatformDeploymentView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformDeploymentView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformDeploymentView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|