mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.1 KiB
Go
269 lines
7.1 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 PlatformPromoteReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformPromoteReq{}
|
|
|
|
// PlatformPromoteReq struct for PlatformPromoteReq
|
|
type PlatformPromoteReq struct {
|
|
// App is the application's slug, from the path.
|
|
App *string `json:"app,omitempty"`
|
|
// DeploymentID promotes that deployment's exact built image. One of this and Tag is required.
|
|
DeploymentId *string `json:"deploymentId,omitempty"`
|
|
// Project is the project the application lives under, from the path.
|
|
Project *string `json:"project,omitempty"`
|
|
// Tag promotes an image tag, resolved the same way a deploy resolves one.
|
|
Tag *string `json:"tag,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformPromoteReq PlatformPromoteReq
|
|
|
|
// NewPlatformPromoteReq instantiates a new PlatformPromoteReq 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 NewPlatformPromoteReq() *PlatformPromoteReq {
|
|
this := PlatformPromoteReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformPromoteReqWithDefaults instantiates a new PlatformPromoteReq 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 NewPlatformPromoteReqWithDefaults() *PlatformPromoteReq {
|
|
this := PlatformPromoteReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetApp returns the App field value if set, zero value otherwise.
|
|
func (o *PlatformPromoteReq) GetApp() string {
|
|
if o == nil || IsNil(o.App) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.App
|
|
}
|
|
|
|
// GetAppOk returns a tuple with the App field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformPromoteReq) GetAppOk() (*string, bool) {
|
|
if o == nil || IsNil(o.App) {
|
|
return nil, false
|
|
}
|
|
return o.App, true
|
|
}
|
|
|
|
// HasApp returns a boolean if a field has been set.
|
|
func (o *PlatformPromoteReq) HasApp() bool {
|
|
if o != nil && !IsNil(o.App) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetApp gets a reference to the given string and assigns it to the App field.
|
|
func (o *PlatformPromoteReq) SetApp(v string) {
|
|
o.App = &v
|
|
}
|
|
|
|
// GetDeploymentId returns the DeploymentId field value if set, zero value otherwise.
|
|
func (o *PlatformPromoteReq) GetDeploymentId() string {
|
|
if o == nil || IsNil(o.DeploymentId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.DeploymentId
|
|
}
|
|
|
|
// GetDeploymentIdOk returns a tuple with the DeploymentId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformPromoteReq) GetDeploymentIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.DeploymentId) {
|
|
return nil, false
|
|
}
|
|
return o.DeploymentId, true
|
|
}
|
|
|
|
// HasDeploymentId returns a boolean if a field has been set.
|
|
func (o *PlatformPromoteReq) HasDeploymentId() bool {
|
|
if o != nil && !IsNil(o.DeploymentId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDeploymentId gets a reference to the given string and assigns it to the DeploymentId field.
|
|
func (o *PlatformPromoteReq) SetDeploymentId(v string) {
|
|
o.DeploymentId = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *PlatformPromoteReq) GetProject() string {
|
|
if o == nil || IsNil(o.Project) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Project
|
|
}
|
|
|
|
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformPromoteReq) GetProjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Project) {
|
|
return nil, false
|
|
}
|
|
return o.Project, true
|
|
}
|
|
|
|
// HasProject returns a boolean if a field has been set.
|
|
func (o *PlatformPromoteReq) HasProject() bool {
|
|
if o != nil && !IsNil(o.Project) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProject gets a reference to the given string and assigns it to the Project field.
|
|
func (o *PlatformPromoteReq) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetTag returns the Tag field value if set, zero value otherwise.
|
|
func (o *PlatformPromoteReq) GetTag() string {
|
|
if o == nil || IsNil(o.Tag) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Tag
|
|
}
|
|
|
|
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformPromoteReq) GetTagOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Tag) {
|
|
return nil, false
|
|
}
|
|
return o.Tag, true
|
|
}
|
|
|
|
// HasTag returns a boolean if a field has been set.
|
|
func (o *PlatformPromoteReq) HasTag() bool {
|
|
if o != nil && !IsNil(o.Tag) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTag gets a reference to the given string and assigns it to the Tag field.
|
|
func (o *PlatformPromoteReq) SetTag(v string) {
|
|
o.Tag = &v
|
|
}
|
|
|
|
func (o PlatformPromoteReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformPromoteReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.App) {
|
|
toSerialize["app"] = o.App
|
|
}
|
|
if !IsNil(o.DeploymentId) {
|
|
toSerialize["deploymentId"] = o.DeploymentId
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
if !IsNil(o.Tag) {
|
|
toSerialize["tag"] = o.Tag
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformPromoteReq) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformPromoteReq := _PlatformPromoteReq{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformPromoteReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformPromoteReq(varPlatformPromoteReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "app")
|
|
delete(additionalProperties, "deploymentId")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "tag")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformPromoteReq struct {
|
|
value *PlatformPromoteReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformPromoteReq) Get() *PlatformPromoteReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformPromoteReq) Set(val *PlatformPromoteReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformPromoteReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformPromoteReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformPromoteReq(val *PlatformPromoteReq) *NullablePlatformPromoteReq {
|
|
return &NullablePlatformPromoteReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformPromoteReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformPromoteReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|