Files
sdk/model_platform_preview_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 PlatformPreviewReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformPreviewReq{}
// PlatformPreviewReq struct for PlatformPreviewReq
type PlatformPreviewReq struct {
// App is the parent application's slug, from the path.
App *string `json:"app,omitempty"`
// Branch is the branch to preview; defaults to the parent app's branch.
Branch *string `json:"branch,omitempty"`
// Image is the already-built image ref to deploy. Required — a preview never builds.
Image *string `json:"image,omitempty"`
// Project is the project the parent application lives under, from the path.
Project *string `json:"project,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformPreviewReq PlatformPreviewReq
// NewPlatformPreviewReq instantiates a new PlatformPreviewReq 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 NewPlatformPreviewReq() *PlatformPreviewReq {
this := PlatformPreviewReq{}
return &this
}
// NewPlatformPreviewReqWithDefaults instantiates a new PlatformPreviewReq 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 NewPlatformPreviewReqWithDefaults() *PlatformPreviewReq {
this := PlatformPreviewReq{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) SetApp(v string) {
o.App = &v
}
// GetBranch returns the Branch field value if set, zero value otherwise.
func (o *PlatformPreviewReq) GetBranch() string {
if o == nil || IsNil(o.Branch) {
var ret string
return ret
}
return *o.Branch
}
// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformPreviewReq) GetBranchOk() (*string, bool) {
if o == nil || IsNil(o.Branch) {
return nil, false
}
return o.Branch, true
}
// HasBranch returns a boolean if a field has been set.
func (o *PlatformPreviewReq) HasBranch() bool {
if o != nil && !IsNil(o.Branch) {
return true
}
return false
}
// SetBranch gets a reference to the given string and assigns it to the Branch field.
func (o *PlatformPreviewReq) SetBranch(v string) {
o.Branch = &v
}
// GetImage returns the Image field value if set, zero value otherwise.
func (o *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) SetImage(v string) {
o.Image = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) 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 *PlatformPreviewReq) SetProject(v string) {
o.Project = &v
}
func (o PlatformPreviewReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformPreviewReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.App) {
toSerialize["app"] = o.App
}
if !IsNil(o.Branch) {
toSerialize["branch"] = o.Branch
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformPreviewReq) UnmarshalJSON(data []byte) (err error) {
varPlatformPreviewReq := _PlatformPreviewReq{}
err = json.Unmarshal(data, &varPlatformPreviewReq)
if err != nil {
return err
}
*o = PlatformPreviewReq(varPlatformPreviewReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "branch")
delete(additionalProperties, "image")
delete(additionalProperties, "project")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformPreviewReq struct {
value *PlatformPreviewReq
isSet bool
}
func (v NullablePlatformPreviewReq) Get() *PlatformPreviewReq {
return v.value
}
func (v *NullablePlatformPreviewReq) Set(val *PlatformPreviewReq) {
v.value = val
v.isSet = true
}
func (v NullablePlatformPreviewReq) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformPreviewReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformPreviewReq(val *PlatformPreviewReq) *NullablePlatformPreviewReq {
return &NullablePlatformPreviewReq{value: val, isSet: true}
}
func (v NullablePlatformPreviewReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformPreviewReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}