Files
sdk/model_platform_deploy_req.go

269 lines
7.0 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 PlatformDeployReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformDeployReq{}
// PlatformDeployReq struct for PlatformDeployReq
type PlatformDeployReq struct {
// App is the application's slug, from the path.
App *string `json:"app,omitempty"`
// Commit is the git commit or ref to build, for a git-source app. Defaults to the app's branch.
Commit *string `json:"commit,omitempty"`
// Project is the project the application lives under, from the path.
Project *string `json:"project,omitempty"`
// Tag is the image tag to deploy, for an image-source app. Defaults to the app's tag, then `latest`.
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformDeployReq PlatformDeployReq
// NewPlatformDeployReq instantiates a new PlatformDeployReq 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 NewPlatformDeployReq() *PlatformDeployReq {
this := PlatformDeployReq{}
return &this
}
// NewPlatformDeployReqWithDefaults instantiates a new PlatformDeployReq 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 NewPlatformDeployReqWithDefaults() *PlatformDeployReq {
this := PlatformDeployReq{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) SetApp(v string) {
o.App = &v
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) SetCommit(v string) {
o.Commit = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) SetProject(v string) {
o.Project = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) 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 *PlatformDeployReq) SetTag(v string) {
o.Tag = &v
}
func (o PlatformDeployReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformDeployReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.App) {
toSerialize["app"] = o.App
}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
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 *PlatformDeployReq) UnmarshalJSON(data []byte) (err error) {
varPlatformDeployReq := _PlatformDeployReq{}
err = json.Unmarshal(data, &varPlatformDeployReq)
if err != nil {
return err
}
*o = PlatformDeployReq(varPlatformDeployReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "commit")
delete(additionalProperties, "project")
delete(additionalProperties, "tag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformDeployReq struct {
value *PlatformDeployReq
isSet bool
}
func (v NullablePlatformDeployReq) Get() *PlatformDeployReq {
return v.value
}
func (v *NullablePlatformDeployReq) Set(val *PlatformDeployReq) {
v.value = val
v.isSet = true
}
func (v NullablePlatformDeployReq) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformDeployReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformDeployReq(val *PlatformDeployReq) *NullablePlatformDeployReq {
return &NullablePlatformDeployReq{value: val, isSet: true}
}
func (v NullablePlatformDeployReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformDeployReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}