mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.5 KiB
Go
269 lines
7.5 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 ShareEnableResp type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ShareEnableResp{}
|
|
|
|
// ShareEnableResp struct for ShareEnableResp
|
|
type ShareEnableResp struct {
|
|
// AccountToken is the caller's tunnel-account credential: their org's, or in a held org their own. Treat it as a secret: it is what the CLI enables an environment with.
|
|
AccountToken *string `json:"accountToken,omitempty"`
|
|
// Controller is the public controller endpoint the CLI enables against.
|
|
Controller *string `json:"controller,omitempty"`
|
|
// Namespace is the public frontend a share is published into, when the deployment names one.
|
|
Namespace *string `json:"namespace,omitempty"`
|
|
// URLTemplate is the shape a share token expands to, so the CLI can print the resulting URL without asking again.
|
|
UrlTemplate *string `json:"urlTemplate,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ShareEnableResp ShareEnableResp
|
|
|
|
// NewShareEnableResp instantiates a new ShareEnableResp 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 NewShareEnableResp() *ShareEnableResp {
|
|
this := ShareEnableResp{}
|
|
return &this
|
|
}
|
|
|
|
// NewShareEnableRespWithDefaults instantiates a new ShareEnableResp 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 NewShareEnableRespWithDefaults() *ShareEnableResp {
|
|
this := ShareEnableResp{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccountToken returns the AccountToken field value if set, zero value otherwise.
|
|
func (o *ShareEnableResp) GetAccountToken() string {
|
|
if o == nil || IsNil(o.AccountToken) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.AccountToken
|
|
}
|
|
|
|
// GetAccountTokenOk returns a tuple with the AccountToken field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ShareEnableResp) GetAccountTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.AccountToken) {
|
|
return nil, false
|
|
}
|
|
return o.AccountToken, true
|
|
}
|
|
|
|
// HasAccountToken returns a boolean if a field has been set.
|
|
func (o *ShareEnableResp) HasAccountToken() bool {
|
|
if o != nil && !IsNil(o.AccountToken) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccountToken gets a reference to the given string and assigns it to the AccountToken field.
|
|
func (o *ShareEnableResp) SetAccountToken(v string) {
|
|
o.AccountToken = &v
|
|
}
|
|
|
|
// GetController returns the Controller field value if set, zero value otherwise.
|
|
func (o *ShareEnableResp) GetController() string {
|
|
if o == nil || IsNil(o.Controller) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Controller
|
|
}
|
|
|
|
// GetControllerOk returns a tuple with the Controller field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ShareEnableResp) GetControllerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Controller) {
|
|
return nil, false
|
|
}
|
|
return o.Controller, true
|
|
}
|
|
|
|
// HasController returns a boolean if a field has been set.
|
|
func (o *ShareEnableResp) HasController() bool {
|
|
if o != nil && !IsNil(o.Controller) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetController gets a reference to the given string and assigns it to the Controller field.
|
|
func (o *ShareEnableResp) SetController(v string) {
|
|
o.Controller = &v
|
|
}
|
|
|
|
// GetNamespace returns the Namespace field value if set, zero value otherwise.
|
|
func (o *ShareEnableResp) GetNamespace() string {
|
|
if o == nil || IsNil(o.Namespace) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Namespace
|
|
}
|
|
|
|
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ShareEnableResp) GetNamespaceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Namespace) {
|
|
return nil, false
|
|
}
|
|
return o.Namespace, true
|
|
}
|
|
|
|
// HasNamespace returns a boolean if a field has been set.
|
|
func (o *ShareEnableResp) HasNamespace() bool {
|
|
if o != nil && !IsNil(o.Namespace) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
|
|
func (o *ShareEnableResp) SetNamespace(v string) {
|
|
o.Namespace = &v
|
|
}
|
|
|
|
// GetUrlTemplate returns the UrlTemplate field value if set, zero value otherwise.
|
|
func (o *ShareEnableResp) GetUrlTemplate() string {
|
|
if o == nil || IsNil(o.UrlTemplate) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UrlTemplate
|
|
}
|
|
|
|
// GetUrlTemplateOk returns a tuple with the UrlTemplate field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ShareEnableResp) GetUrlTemplateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UrlTemplate) {
|
|
return nil, false
|
|
}
|
|
return o.UrlTemplate, true
|
|
}
|
|
|
|
// HasUrlTemplate returns a boolean if a field has been set.
|
|
func (o *ShareEnableResp) HasUrlTemplate() bool {
|
|
if o != nil && !IsNil(o.UrlTemplate) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUrlTemplate gets a reference to the given string and assigns it to the UrlTemplate field.
|
|
func (o *ShareEnableResp) SetUrlTemplate(v string) {
|
|
o.UrlTemplate = &v
|
|
}
|
|
|
|
func (o ShareEnableResp) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ShareEnableResp) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AccountToken) {
|
|
toSerialize["accountToken"] = o.AccountToken
|
|
}
|
|
if !IsNil(o.Controller) {
|
|
toSerialize["controller"] = o.Controller
|
|
}
|
|
if !IsNil(o.Namespace) {
|
|
toSerialize["namespace"] = o.Namespace
|
|
}
|
|
if !IsNil(o.UrlTemplate) {
|
|
toSerialize["urlTemplate"] = o.UrlTemplate
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ShareEnableResp) UnmarshalJSON(data []byte) (err error) {
|
|
varShareEnableResp := _ShareEnableResp{}
|
|
|
|
err = json.Unmarshal(data, &varShareEnableResp)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ShareEnableResp(varShareEnableResp)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "accountToken")
|
|
delete(additionalProperties, "controller")
|
|
delete(additionalProperties, "namespace")
|
|
delete(additionalProperties, "urlTemplate")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableShareEnableResp struct {
|
|
value *ShareEnableResp
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableShareEnableResp) Get() *ShareEnableResp {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableShareEnableResp) Set(val *ShareEnableResp) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableShareEnableResp) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableShareEnableResp) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableShareEnableResp(val *ShareEnableResp) *NullableShareEnableResp {
|
|
return &NullableShareEnableResp{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableShareEnableResp) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableShareEnableResp) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|