Files
sdk/model_platform_preview_view.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 PlatformPreviewView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformPreviewView{}
// PlatformPreviewView struct for PlatformPreviewView
type PlatformPreviewView struct {
// App is the preview application's own slug, `<app>-<branch>`.
App *string `json:"app,omitempty"`
// Branch is the branch this preview maps.
Branch *string `json:"branch,omitempty"`
// Deployment is the deployment the preview recorded.
Deployment *PlatformDeploymentView `json:"deployment,omitempty"`
// URL is the preview's live HTTPS address.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformPreviewView PlatformPreviewView
// NewPlatformPreviewView instantiates a new PlatformPreviewView 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 NewPlatformPreviewView() *PlatformPreviewView {
this := PlatformPreviewView{}
return &this
}
// NewPlatformPreviewViewWithDefaults instantiates a new PlatformPreviewView 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 NewPlatformPreviewViewWithDefaults() *PlatformPreviewView {
this := PlatformPreviewView{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PlatformPreviewView) 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 *PlatformPreviewView) 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 *PlatformPreviewView) 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 *PlatformPreviewView) SetApp(v string) {
o.App = &v
}
// GetBranch returns the Branch field value if set, zero value otherwise.
func (o *PlatformPreviewView) 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 *PlatformPreviewView) 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 *PlatformPreviewView) 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 *PlatformPreviewView) SetBranch(v string) {
o.Branch = &v
}
// GetDeployment returns the Deployment field value if set, zero value otherwise.
func (o *PlatformPreviewView) GetDeployment() PlatformDeploymentView {
if o == nil || IsNil(o.Deployment) {
var ret PlatformDeploymentView
return ret
}
return *o.Deployment
}
// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformPreviewView) GetDeploymentOk() (*PlatformDeploymentView, bool) {
if o == nil || IsNil(o.Deployment) {
return nil, false
}
return o.Deployment, true
}
// HasDeployment returns a boolean if a field has been set.
func (o *PlatformPreviewView) HasDeployment() bool {
if o != nil && !IsNil(o.Deployment) {
return true
}
return false
}
// SetDeployment gets a reference to the given PlatformDeploymentView and assigns it to the Deployment field.
func (o *PlatformPreviewView) SetDeployment(v PlatformDeploymentView) {
o.Deployment = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *PlatformPreviewView) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformPreviewView) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *PlatformPreviewView) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *PlatformPreviewView) SetUrl(v string) {
o.Url = &v
}
func (o PlatformPreviewView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformPreviewView) 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.Deployment) {
toSerialize["deployment"] = o.Deployment
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformPreviewView) UnmarshalJSON(data []byte) (err error) {
varPlatformPreviewView := _PlatformPreviewView{}
err = json.Unmarshal(data, &varPlatformPreviewView)
if err != nil {
return err
}
*o = PlatformPreviewView(varPlatformPreviewView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "branch")
delete(additionalProperties, "deployment")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformPreviewView struct {
value *PlatformPreviewView
isSet bool
}
func (v NullablePlatformPreviewView) Get() *PlatformPreviewView {
return v.value
}
func (v *NullablePlatformPreviewView) Set(val *PlatformPreviewView) {
v.value = val
v.isSet = true
}
func (v NullablePlatformPreviewView) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformPreviewView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformPreviewView(val *PlatformPreviewView) *NullablePlatformPreviewView {
return &NullablePlatformPreviewView{value: val, isSet: true}
}
func (v NullablePlatformPreviewView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformPreviewView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}