Files
sdk/model_cloudflare_route_create_in.go

231 lines
6.4 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 CloudflareRouteCreateIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CloudflareRouteCreateIn{}
// CloudflareRouteCreateIn struct for CloudflareRouteCreateIn
type CloudflareRouteCreateIn struct {
// Pattern is the URL pattern to bind, e.g. \"acme.com/api/_*\".
Pattern *string `json:"pattern,omitempty"`
// Script is the Worker script to dispatch to. Omit it to leave the pattern bound to no script, which is how Cloudflare expresses \"bypass the Worker here\".
Script *string `json:"script,omitempty"`
// Zone is the 32-hex Cloudflare zone id, from the path.
Zone *string `json:"zone,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CloudflareRouteCreateIn CloudflareRouteCreateIn
// NewCloudflareRouteCreateIn instantiates a new CloudflareRouteCreateIn 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 NewCloudflareRouteCreateIn() *CloudflareRouteCreateIn {
this := CloudflareRouteCreateIn{}
return &this
}
// NewCloudflareRouteCreateInWithDefaults instantiates a new CloudflareRouteCreateIn 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 NewCloudflareRouteCreateInWithDefaults() *CloudflareRouteCreateIn {
this := CloudflareRouteCreateIn{}
return &this
}
// GetPattern returns the Pattern field value if set, zero value otherwise.
func (o *CloudflareRouteCreateIn) GetPattern() string {
if o == nil || IsNil(o.Pattern) {
var ret string
return ret
}
return *o.Pattern
}
// GetPatternOk returns a tuple with the Pattern field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudflareRouteCreateIn) GetPatternOk() (*string, bool) {
if o == nil || IsNil(o.Pattern) {
return nil, false
}
return o.Pattern, true
}
// HasPattern returns a boolean if a field has been set.
func (o *CloudflareRouteCreateIn) HasPattern() bool {
if o != nil && !IsNil(o.Pattern) {
return true
}
return false
}
// SetPattern gets a reference to the given string and assigns it to the Pattern field.
func (o *CloudflareRouteCreateIn) SetPattern(v string) {
o.Pattern = &v
}
// GetScript returns the Script field value if set, zero value otherwise.
func (o *CloudflareRouteCreateIn) GetScript() string {
if o == nil || IsNil(o.Script) {
var ret string
return ret
}
return *o.Script
}
// GetScriptOk returns a tuple with the Script field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudflareRouteCreateIn) GetScriptOk() (*string, bool) {
if o == nil || IsNil(o.Script) {
return nil, false
}
return o.Script, true
}
// HasScript returns a boolean if a field has been set.
func (o *CloudflareRouteCreateIn) HasScript() bool {
if o != nil && !IsNil(o.Script) {
return true
}
return false
}
// SetScript gets a reference to the given string and assigns it to the Script field.
func (o *CloudflareRouteCreateIn) SetScript(v string) {
o.Script = &v
}
// GetZone returns the Zone field value if set, zero value otherwise.
func (o *CloudflareRouteCreateIn) GetZone() string {
if o == nil || IsNil(o.Zone) {
var ret string
return ret
}
return *o.Zone
}
// GetZoneOk returns a tuple with the Zone field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudflareRouteCreateIn) GetZoneOk() (*string, bool) {
if o == nil || IsNil(o.Zone) {
return nil, false
}
return o.Zone, true
}
// HasZone returns a boolean if a field has been set.
func (o *CloudflareRouteCreateIn) HasZone() bool {
if o != nil && !IsNil(o.Zone) {
return true
}
return false
}
// SetZone gets a reference to the given string and assigns it to the Zone field.
func (o *CloudflareRouteCreateIn) SetZone(v string) {
o.Zone = &v
}
func (o CloudflareRouteCreateIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CloudflareRouteCreateIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Pattern) {
toSerialize["pattern"] = o.Pattern
}
if !IsNil(o.Script) {
toSerialize["script"] = o.Script
}
if !IsNil(o.Zone) {
toSerialize["zone"] = o.Zone
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CloudflareRouteCreateIn) UnmarshalJSON(data []byte) (err error) {
varCloudflareRouteCreateIn := _CloudflareRouteCreateIn{}
err = json.Unmarshal(data, &varCloudflareRouteCreateIn)
if err != nil {
return err
}
*o = CloudflareRouteCreateIn(varCloudflareRouteCreateIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "pattern")
delete(additionalProperties, "script")
delete(additionalProperties, "zone")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCloudflareRouteCreateIn struct {
value *CloudflareRouteCreateIn
isSet bool
}
func (v NullableCloudflareRouteCreateIn) Get() *CloudflareRouteCreateIn {
return v.value
}
func (v *NullableCloudflareRouteCreateIn) Set(val *CloudflareRouteCreateIn) {
v.value = val
v.isSet = true
}
func (v NullableCloudflareRouteCreateIn) IsSet() bool {
return v.isSet
}
func (v *NullableCloudflareRouteCreateIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCloudflareRouteCreateIn(val *CloudflareRouteCreateIn) *NullableCloudflareRouteCreateIn {
return &NullableCloudflareRouteCreateIn{value: val, isSet: true}
}
func (v NullableCloudflareRouteCreateIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCloudflareRouteCreateIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}