mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
12 KiB
Go
345 lines
12 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 CloudflarePagesDeploymentConfig type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CloudflarePagesDeploymentConfig{}
|
|
|
|
// CloudflarePagesDeploymentConfig struct for CloudflarePagesDeploymentConfig
|
|
type CloudflarePagesDeploymentConfig struct {
|
|
// CompatibilityDate pins which Workers runtime behaviour the functions run under, as a date (\"2024-01-01\"). It is a pin, not a version: the runtime keeps that date's semantics for code deployed against it.
|
|
CompatibilityDate *string `json:"compatibility_date,omitempty"`
|
|
// CompatibilityFlags turn individual runtime behaviours on or off ahead of, or behind, the date above (\"nodejs_compat\").
|
|
CompatibilityFlags []string `json:"compatibility_flags,omitempty"`
|
|
// D1Databases binds D1 databases in, keyed by binding name.
|
|
D1Databases map[string]CloudflarePagesD1Binding `json:"d1_databases,omitempty"`
|
|
// EnvVars are the environment variables the functions see, KEYED BY VARIABLE NAME. The key is the name; the value carries the value and whether it is a secret.
|
|
EnvVars map[string]CloudflarePagesEnvVar `json:"env_vars,omitempty"`
|
|
// KVNamespaces binds KV namespaces into the functions, KEYED BY THE BINDING NAME the code reads (`env.SESSIONS`). Same shape for the two below.
|
|
KvNamespaces map[string]CloudflarePagesKVBinding `json:"kv_namespaces,omitempty"`
|
|
// R2Buckets binds R2 buckets in, keyed by binding name.
|
|
R2Buckets map[string]CloudflarePagesR2Binding `json:"r2_buckets,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CloudflarePagesDeploymentConfig CloudflarePagesDeploymentConfig
|
|
|
|
// NewCloudflarePagesDeploymentConfig instantiates a new CloudflarePagesDeploymentConfig 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 NewCloudflarePagesDeploymentConfig() *CloudflarePagesDeploymentConfig {
|
|
this := CloudflarePagesDeploymentConfig{}
|
|
return &this
|
|
}
|
|
|
|
// NewCloudflarePagesDeploymentConfigWithDefaults instantiates a new CloudflarePagesDeploymentConfig 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 NewCloudflarePagesDeploymentConfigWithDefaults() *CloudflarePagesDeploymentConfig {
|
|
this := CloudflarePagesDeploymentConfig{}
|
|
return &this
|
|
}
|
|
|
|
// GetCompatibilityDate returns the CompatibilityDate field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetCompatibilityDate() string {
|
|
if o == nil || IsNil(o.CompatibilityDate) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CompatibilityDate
|
|
}
|
|
|
|
// GetCompatibilityDateOk returns a tuple with the CompatibilityDate field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetCompatibilityDateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CompatibilityDate) {
|
|
return nil, false
|
|
}
|
|
return o.CompatibilityDate, true
|
|
}
|
|
|
|
// HasCompatibilityDate returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasCompatibilityDate() bool {
|
|
if o != nil && !IsNil(o.CompatibilityDate) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCompatibilityDate gets a reference to the given string and assigns it to the CompatibilityDate field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetCompatibilityDate(v string) {
|
|
o.CompatibilityDate = &v
|
|
}
|
|
|
|
// GetCompatibilityFlags returns the CompatibilityFlags field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetCompatibilityFlags() []string {
|
|
if o == nil || IsNil(o.CompatibilityFlags) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.CompatibilityFlags
|
|
}
|
|
|
|
// GetCompatibilityFlagsOk returns a tuple with the CompatibilityFlags field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetCompatibilityFlagsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.CompatibilityFlags) {
|
|
return nil, false
|
|
}
|
|
return o.CompatibilityFlags, true
|
|
}
|
|
|
|
// HasCompatibilityFlags returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasCompatibilityFlags() bool {
|
|
if o != nil && !IsNil(o.CompatibilityFlags) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCompatibilityFlags gets a reference to the given []string and assigns it to the CompatibilityFlags field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetCompatibilityFlags(v []string) {
|
|
o.CompatibilityFlags = v
|
|
}
|
|
|
|
// GetD1Databases returns the D1Databases field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetD1Databases() map[string]CloudflarePagesD1Binding {
|
|
if o == nil || IsNil(o.D1Databases) {
|
|
var ret map[string]CloudflarePagesD1Binding
|
|
return ret
|
|
}
|
|
return o.D1Databases
|
|
}
|
|
|
|
// GetD1DatabasesOk returns a tuple with the D1Databases field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetD1DatabasesOk() (map[string]CloudflarePagesD1Binding, bool) {
|
|
if o == nil || IsNil(o.D1Databases) {
|
|
return map[string]CloudflarePagesD1Binding{}, false
|
|
}
|
|
return o.D1Databases, true
|
|
}
|
|
|
|
// HasD1Databases returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasD1Databases() bool {
|
|
if o != nil && !IsNil(o.D1Databases) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetD1Databases gets a reference to the given map[string]CloudflarePagesD1Binding and assigns it to the D1Databases field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetD1Databases(v map[string]CloudflarePagesD1Binding) {
|
|
o.D1Databases = v
|
|
}
|
|
|
|
// GetEnvVars returns the EnvVars field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetEnvVars() map[string]CloudflarePagesEnvVar {
|
|
if o == nil || IsNil(o.EnvVars) {
|
|
var ret map[string]CloudflarePagesEnvVar
|
|
return ret
|
|
}
|
|
return o.EnvVars
|
|
}
|
|
|
|
// GetEnvVarsOk returns a tuple with the EnvVars field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetEnvVarsOk() (map[string]CloudflarePagesEnvVar, bool) {
|
|
if o == nil || IsNil(o.EnvVars) {
|
|
return map[string]CloudflarePagesEnvVar{}, false
|
|
}
|
|
return o.EnvVars, true
|
|
}
|
|
|
|
// HasEnvVars returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasEnvVars() bool {
|
|
if o != nil && !IsNil(o.EnvVars) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnvVars gets a reference to the given map[string]CloudflarePagesEnvVar and assigns it to the EnvVars field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetEnvVars(v map[string]CloudflarePagesEnvVar) {
|
|
o.EnvVars = v
|
|
}
|
|
|
|
// GetKvNamespaces returns the KvNamespaces field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetKvNamespaces() map[string]CloudflarePagesKVBinding {
|
|
if o == nil || IsNil(o.KvNamespaces) {
|
|
var ret map[string]CloudflarePagesKVBinding
|
|
return ret
|
|
}
|
|
return o.KvNamespaces
|
|
}
|
|
|
|
// GetKvNamespacesOk returns a tuple with the KvNamespaces field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetKvNamespacesOk() (map[string]CloudflarePagesKVBinding, bool) {
|
|
if o == nil || IsNil(o.KvNamespaces) {
|
|
return map[string]CloudflarePagesKVBinding{}, false
|
|
}
|
|
return o.KvNamespaces, true
|
|
}
|
|
|
|
// HasKvNamespaces returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasKvNamespaces() bool {
|
|
if o != nil && !IsNil(o.KvNamespaces) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKvNamespaces gets a reference to the given map[string]CloudflarePagesKVBinding and assigns it to the KvNamespaces field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetKvNamespaces(v map[string]CloudflarePagesKVBinding) {
|
|
o.KvNamespaces = v
|
|
}
|
|
|
|
// GetR2Buckets returns the R2Buckets field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesDeploymentConfig) GetR2Buckets() map[string]CloudflarePagesR2Binding {
|
|
if o == nil || IsNil(o.R2Buckets) {
|
|
var ret map[string]CloudflarePagesR2Binding
|
|
return ret
|
|
}
|
|
return o.R2Buckets
|
|
}
|
|
|
|
// GetR2BucketsOk returns a tuple with the R2Buckets field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) GetR2BucketsOk() (map[string]CloudflarePagesR2Binding, bool) {
|
|
if o == nil || IsNil(o.R2Buckets) {
|
|
return map[string]CloudflarePagesR2Binding{}, false
|
|
}
|
|
return o.R2Buckets, true
|
|
}
|
|
|
|
// HasR2Buckets returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesDeploymentConfig) HasR2Buckets() bool {
|
|
if o != nil && !IsNil(o.R2Buckets) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetR2Buckets gets a reference to the given map[string]CloudflarePagesR2Binding and assigns it to the R2Buckets field.
|
|
func (o *CloudflarePagesDeploymentConfig) SetR2Buckets(v map[string]CloudflarePagesR2Binding) {
|
|
o.R2Buckets = v
|
|
}
|
|
|
|
func (o CloudflarePagesDeploymentConfig) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CloudflarePagesDeploymentConfig) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CompatibilityDate) {
|
|
toSerialize["compatibility_date"] = o.CompatibilityDate
|
|
}
|
|
if !IsNil(o.CompatibilityFlags) {
|
|
toSerialize["compatibility_flags"] = o.CompatibilityFlags
|
|
}
|
|
if !IsNil(o.D1Databases) {
|
|
toSerialize["d1_databases"] = o.D1Databases
|
|
}
|
|
if !IsNil(o.EnvVars) {
|
|
toSerialize["env_vars"] = o.EnvVars
|
|
}
|
|
if !IsNil(o.KvNamespaces) {
|
|
toSerialize["kv_namespaces"] = o.KvNamespaces
|
|
}
|
|
if !IsNil(o.R2Buckets) {
|
|
toSerialize["r2_buckets"] = o.R2Buckets
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CloudflarePagesDeploymentConfig) UnmarshalJSON(data []byte) (err error) {
|
|
varCloudflarePagesDeploymentConfig := _CloudflarePagesDeploymentConfig{}
|
|
|
|
err = json.Unmarshal(data, &varCloudflarePagesDeploymentConfig)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CloudflarePagesDeploymentConfig(varCloudflarePagesDeploymentConfig)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "compatibility_date")
|
|
delete(additionalProperties, "compatibility_flags")
|
|
delete(additionalProperties, "d1_databases")
|
|
delete(additionalProperties, "env_vars")
|
|
delete(additionalProperties, "kv_namespaces")
|
|
delete(additionalProperties, "r2_buckets")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCloudflarePagesDeploymentConfig struct {
|
|
value *CloudflarePagesDeploymentConfig
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCloudflarePagesDeploymentConfig) Get() *CloudflarePagesDeploymentConfig {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesDeploymentConfig) Set(val *CloudflarePagesDeploymentConfig) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCloudflarePagesDeploymentConfig) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesDeploymentConfig) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCloudflarePagesDeploymentConfig(val *CloudflarePagesDeploymentConfig) *NullableCloudflarePagesDeploymentConfig {
|
|
return &NullableCloudflarePagesDeploymentConfig{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCloudflarePagesDeploymentConfig) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesDeploymentConfig) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|