Files
sdk/model_sandbox_preview_grant.go

269 lines
7.2 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 SandboxPreviewGrant type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SandboxPreviewGrant{}
// SandboxPreviewGrant struct for SandboxPreviewGrant
type SandboxPreviewGrant struct {
// ExpiresIn is how long the ticket in URL is good for, in seconds.
ExpiresIn *int64 `json:"expiresIn,omitempty"`
// Host is the preview's origin host, the same for every ticket for this port of this sandbox, before and after the sandbox is parked and resumed.
Host *string `json:"host,omitempty"`
// Port is the port the preview serves.
Port *int64 `json:"port,omitempty"`
// URL opens the preview: its own origin, with a single-use ticket that sets the preview's cookie and redirects to its root. Open it in a frame or a tab within ExpiresIn seconds, and mint another to reopen.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SandboxPreviewGrant SandboxPreviewGrant
// NewSandboxPreviewGrant instantiates a new SandboxPreviewGrant 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 NewSandboxPreviewGrant() *SandboxPreviewGrant {
this := SandboxPreviewGrant{}
return &this
}
// NewSandboxPreviewGrantWithDefaults instantiates a new SandboxPreviewGrant 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 NewSandboxPreviewGrantWithDefaults() *SandboxPreviewGrant {
this := SandboxPreviewGrant{}
return &this
}
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
func (o *SandboxPreviewGrant) GetExpiresIn() int64 {
if o == nil || IsNil(o.ExpiresIn) {
var ret int64
return ret
}
return *o.ExpiresIn
}
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxPreviewGrant) GetExpiresInOk() (*int64, bool) {
if o == nil || IsNil(o.ExpiresIn) {
return nil, false
}
return o.ExpiresIn, true
}
// HasExpiresIn returns a boolean if a field has been set.
func (o *SandboxPreviewGrant) HasExpiresIn() bool {
if o != nil && !IsNil(o.ExpiresIn) {
return true
}
return false
}
// SetExpiresIn gets a reference to the given int64 and assigns it to the ExpiresIn field.
func (o *SandboxPreviewGrant) SetExpiresIn(v int64) {
o.ExpiresIn = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *SandboxPreviewGrant) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxPreviewGrant) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *SandboxPreviewGrant) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *SandboxPreviewGrant) SetHost(v string) {
o.Host = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *SandboxPreviewGrant) GetPort() int64 {
if o == nil || IsNil(o.Port) {
var ret int64
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxPreviewGrant) GetPortOk() (*int64, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *SandboxPreviewGrant) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int64 and assigns it to the Port field.
func (o *SandboxPreviewGrant) SetPort(v int64) {
o.Port = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *SandboxPreviewGrant) 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 *SandboxPreviewGrant) 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 *SandboxPreviewGrant) 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 *SandboxPreviewGrant) SetUrl(v string) {
o.Url = &v
}
func (o SandboxPreviewGrant) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SandboxPreviewGrant) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresIn) {
toSerialize["expiresIn"] = o.ExpiresIn
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SandboxPreviewGrant) UnmarshalJSON(data []byte) (err error) {
varSandboxPreviewGrant := _SandboxPreviewGrant{}
err = json.Unmarshal(data, &varSandboxPreviewGrant)
if err != nil {
return err
}
*o = SandboxPreviewGrant(varSandboxPreviewGrant)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expiresIn")
delete(additionalProperties, "host")
delete(additionalProperties, "port")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSandboxPreviewGrant struct {
value *SandboxPreviewGrant
isSet bool
}
func (v NullableSandboxPreviewGrant) Get() *SandboxPreviewGrant {
return v.value
}
func (v *NullableSandboxPreviewGrant) Set(val *SandboxPreviewGrant) {
v.value = val
v.isSet = true
}
func (v NullableSandboxPreviewGrant) IsSet() bool {
return v.isSet
}
func (v *NullableSandboxPreviewGrant) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSandboxPreviewGrant(val *SandboxPreviewGrant) *NullableSandboxPreviewGrant {
return &NullableSandboxPreviewGrant{value: val, isSet: true}
}
func (v NullableSandboxPreviewGrant) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSandboxPreviewGrant) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}