Files
sdk/model_share_share_view.go

307 lines
8.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 ShareShareView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ShareShareView{}
// ShareShareView struct for ShareShareView
type ShareShareView struct {
// Backend is the local endpoint the share proxies to.
Backend *string `json:"backend,omitempty"`
// BackendMode is how the tunnel serves the backend, e.g. proxy or web.
BackendMode *string `json:"backendMode,omitempty"`
// CreatedAt is when the share was opened, unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Token is the share's own identifier, the leaf of its public URL.
Token *string `json:"token,omitempty"`
// URL is the share's public address, rendered from the deployment's URL template.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ShareShareView ShareShareView
// NewShareShareView instantiates a new ShareShareView 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 NewShareShareView() *ShareShareView {
this := ShareShareView{}
return &this
}
// NewShareShareViewWithDefaults instantiates a new ShareShareView 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 NewShareShareViewWithDefaults() *ShareShareView {
this := ShareShareView{}
return &this
}
// GetBackend returns the Backend field value if set, zero value otherwise.
func (o *ShareShareView) GetBackend() string {
if o == nil || IsNil(o.Backend) {
var ret string
return ret
}
return *o.Backend
}
// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareShareView) GetBackendOk() (*string, bool) {
if o == nil || IsNil(o.Backend) {
return nil, false
}
return o.Backend, true
}
// HasBackend returns a boolean if a field has been set.
func (o *ShareShareView) HasBackend() bool {
if o != nil && !IsNil(o.Backend) {
return true
}
return false
}
// SetBackend gets a reference to the given string and assigns it to the Backend field.
func (o *ShareShareView) SetBackend(v string) {
o.Backend = &v
}
// GetBackendMode returns the BackendMode field value if set, zero value otherwise.
func (o *ShareShareView) GetBackendMode() string {
if o == nil || IsNil(o.BackendMode) {
var ret string
return ret
}
return *o.BackendMode
}
// GetBackendModeOk returns a tuple with the BackendMode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareShareView) GetBackendModeOk() (*string, bool) {
if o == nil || IsNil(o.BackendMode) {
return nil, false
}
return o.BackendMode, true
}
// HasBackendMode returns a boolean if a field has been set.
func (o *ShareShareView) HasBackendMode() bool {
if o != nil && !IsNil(o.BackendMode) {
return true
}
return false
}
// SetBackendMode gets a reference to the given string and assigns it to the BackendMode field.
func (o *ShareShareView) SetBackendMode(v string) {
o.BackendMode = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *ShareShareView) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareShareView) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *ShareShareView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *ShareShareView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetToken returns the Token field value if set, zero value otherwise.
func (o *ShareShareView) GetToken() string {
if o == nil || IsNil(o.Token) {
var ret string
return ret
}
return *o.Token
}
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareShareView) GetTokenOk() (*string, bool) {
if o == nil || IsNil(o.Token) {
return nil, false
}
return o.Token, true
}
// HasToken returns a boolean if a field has been set.
func (o *ShareShareView) HasToken() bool {
if o != nil && !IsNil(o.Token) {
return true
}
return false
}
// SetToken gets a reference to the given string and assigns it to the Token field.
func (o *ShareShareView) SetToken(v string) {
o.Token = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ShareShareView) 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 *ShareShareView) 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 *ShareShareView) 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 *ShareShareView) SetUrl(v string) {
o.Url = &v
}
func (o ShareShareView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ShareShareView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Backend) {
toSerialize["backend"] = o.Backend
}
if !IsNil(o.BackendMode) {
toSerialize["backendMode"] = o.BackendMode
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Token) {
toSerialize["token"] = o.Token
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ShareShareView) UnmarshalJSON(data []byte) (err error) {
varShareShareView := _ShareShareView{}
err = json.Unmarshal(data, &varShareShareView)
if err != nil {
return err
}
*o = ShareShareView(varShareShareView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "backend")
delete(additionalProperties, "backendMode")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "token")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableShareShareView struct {
value *ShareShareView
isSet bool
}
func (v NullableShareShareView) Get() *ShareShareView {
return v.value
}
func (v *NullableShareShareView) Set(val *ShareShareView) {
v.value = val
v.isSet = true
}
func (v NullableShareShareView) IsSet() bool {
return v.isSet
}
func (v *NullableShareShareView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableShareShareView(val *ShareShareView) *NullableShareShareView {
return &NullableShareShareView{value: val, isSet: true}
}
func (v NullableShareShareView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableShareShareView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}