mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
155 lines
4.6 KiB
Go
155 lines
4.6 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 CloudflarePagesKVBinding type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CloudflarePagesKVBinding{}
|
|
|
|
// CloudflarePagesKVBinding struct for CloudflarePagesKVBinding
|
|
type CloudflarePagesKVBinding struct {
|
|
// NamespaceID is the KV namespace this binding points at, by Cloudflare's id rather than its title. The BINDING NAME — what the Worker code reads it as — is the map key this value sits under, not a field here.
|
|
NamespaceId *string `json:"namespace_id,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CloudflarePagesKVBinding CloudflarePagesKVBinding
|
|
|
|
// NewCloudflarePagesKVBinding instantiates a new CloudflarePagesKVBinding 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 NewCloudflarePagesKVBinding() *CloudflarePagesKVBinding {
|
|
this := CloudflarePagesKVBinding{}
|
|
return &this
|
|
}
|
|
|
|
// NewCloudflarePagesKVBindingWithDefaults instantiates a new CloudflarePagesKVBinding 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 NewCloudflarePagesKVBindingWithDefaults() *CloudflarePagesKVBinding {
|
|
this := CloudflarePagesKVBinding{}
|
|
return &this
|
|
}
|
|
|
|
// GetNamespaceId returns the NamespaceId field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesKVBinding) GetNamespaceId() string {
|
|
if o == nil || IsNil(o.NamespaceId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.NamespaceId
|
|
}
|
|
|
|
// GetNamespaceIdOk returns a tuple with the NamespaceId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesKVBinding) GetNamespaceIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.NamespaceId) {
|
|
return nil, false
|
|
}
|
|
return o.NamespaceId, true
|
|
}
|
|
|
|
// HasNamespaceId returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesKVBinding) HasNamespaceId() bool {
|
|
if o != nil && !IsNil(o.NamespaceId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNamespaceId gets a reference to the given string and assigns it to the NamespaceId field.
|
|
func (o *CloudflarePagesKVBinding) SetNamespaceId(v string) {
|
|
o.NamespaceId = &v
|
|
}
|
|
|
|
func (o CloudflarePagesKVBinding) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CloudflarePagesKVBinding) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.NamespaceId) {
|
|
toSerialize["namespace_id"] = o.NamespaceId
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CloudflarePagesKVBinding) UnmarshalJSON(data []byte) (err error) {
|
|
varCloudflarePagesKVBinding := _CloudflarePagesKVBinding{}
|
|
|
|
err = json.Unmarshal(data, &varCloudflarePagesKVBinding)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CloudflarePagesKVBinding(varCloudflarePagesKVBinding)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "namespace_id")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCloudflarePagesKVBinding struct {
|
|
value *CloudflarePagesKVBinding
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCloudflarePagesKVBinding) Get() *CloudflarePagesKVBinding {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesKVBinding) Set(val *CloudflarePagesKVBinding) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCloudflarePagesKVBinding) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesKVBinding) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCloudflarePagesKVBinding(val *CloudflarePagesKVBinding) *NullableCloudflarePagesKVBinding {
|
|
return &NullableCloudflarePagesKVBinding{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCloudflarePagesKVBinding) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesKVBinding) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|