mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
8.6 KiB
Go
269 lines
8.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 CloudflarePagesProjectCreate type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CloudflarePagesProjectCreate{}
|
|
|
|
// CloudflarePagesProjectCreate struct for CloudflarePagesProjectCreate
|
|
type CloudflarePagesProjectCreate struct {
|
|
// BuildConfig says how to build the site. Omitted means no build step.
|
|
BuildConfig *CloudflarePagesBuildConfig `json:"build_config,omitempty"`
|
|
// DeploymentConfigs carries the preview and production runtime configs — the bindings and variables the built site's functions run with.
|
|
DeploymentConfigs *CloudflarePagesDeploymentConfigs `json:"deployment_configs,omitempty"`
|
|
// Name is the project name, and it is also the address: the site answers at <name>.pages.dev. Cloudflare will not rename a project afterwards.
|
|
Name *string `json:"name,omitempty"`
|
|
// ProductionBranch is which git branch builds to production; every other branch builds a preview. Omitted leaves Cloudflare's own default.
|
|
ProductionBranch *string `json:"production_branch,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CloudflarePagesProjectCreate CloudflarePagesProjectCreate
|
|
|
|
// NewCloudflarePagesProjectCreate instantiates a new CloudflarePagesProjectCreate 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 NewCloudflarePagesProjectCreate() *CloudflarePagesProjectCreate {
|
|
this := CloudflarePagesProjectCreate{}
|
|
return &this
|
|
}
|
|
|
|
// NewCloudflarePagesProjectCreateWithDefaults instantiates a new CloudflarePagesProjectCreate 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 NewCloudflarePagesProjectCreateWithDefaults() *CloudflarePagesProjectCreate {
|
|
this := CloudflarePagesProjectCreate{}
|
|
return &this
|
|
}
|
|
|
|
// GetBuildConfig returns the BuildConfig field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesProjectCreate) GetBuildConfig() CloudflarePagesBuildConfig {
|
|
if o == nil || IsNil(o.BuildConfig) {
|
|
var ret CloudflarePagesBuildConfig
|
|
return ret
|
|
}
|
|
return *o.BuildConfig
|
|
}
|
|
|
|
// GetBuildConfigOk returns a tuple with the BuildConfig field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesProjectCreate) GetBuildConfigOk() (*CloudflarePagesBuildConfig, bool) {
|
|
if o == nil || IsNil(o.BuildConfig) {
|
|
return nil, false
|
|
}
|
|
return o.BuildConfig, true
|
|
}
|
|
|
|
// HasBuildConfig returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesProjectCreate) HasBuildConfig() bool {
|
|
if o != nil && !IsNil(o.BuildConfig) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBuildConfig gets a reference to the given CloudflarePagesBuildConfig and assigns it to the BuildConfig field.
|
|
func (o *CloudflarePagesProjectCreate) SetBuildConfig(v CloudflarePagesBuildConfig) {
|
|
o.BuildConfig = &v
|
|
}
|
|
|
|
// GetDeploymentConfigs returns the DeploymentConfigs field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesProjectCreate) GetDeploymentConfigs() CloudflarePagesDeploymentConfigs {
|
|
if o == nil || IsNil(o.DeploymentConfigs) {
|
|
var ret CloudflarePagesDeploymentConfigs
|
|
return ret
|
|
}
|
|
return *o.DeploymentConfigs
|
|
}
|
|
|
|
// GetDeploymentConfigsOk returns a tuple with the DeploymentConfigs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesProjectCreate) GetDeploymentConfigsOk() (*CloudflarePagesDeploymentConfigs, bool) {
|
|
if o == nil || IsNil(o.DeploymentConfigs) {
|
|
return nil, false
|
|
}
|
|
return o.DeploymentConfigs, true
|
|
}
|
|
|
|
// HasDeploymentConfigs returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesProjectCreate) HasDeploymentConfigs() bool {
|
|
if o != nil && !IsNil(o.DeploymentConfigs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDeploymentConfigs gets a reference to the given CloudflarePagesDeploymentConfigs and assigns it to the DeploymentConfigs field.
|
|
func (o *CloudflarePagesProjectCreate) SetDeploymentConfigs(v CloudflarePagesDeploymentConfigs) {
|
|
o.DeploymentConfigs = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesProjectCreate) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesProjectCreate) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesProjectCreate) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *CloudflarePagesProjectCreate) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetProductionBranch returns the ProductionBranch field value if set, zero value otherwise.
|
|
func (o *CloudflarePagesProjectCreate) GetProductionBranch() string {
|
|
if o == nil || IsNil(o.ProductionBranch) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ProductionBranch
|
|
}
|
|
|
|
// GetProductionBranchOk returns a tuple with the ProductionBranch field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflarePagesProjectCreate) GetProductionBranchOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ProductionBranch) {
|
|
return nil, false
|
|
}
|
|
return o.ProductionBranch, true
|
|
}
|
|
|
|
// HasProductionBranch returns a boolean if a field has been set.
|
|
func (o *CloudflarePagesProjectCreate) HasProductionBranch() bool {
|
|
if o != nil && !IsNil(o.ProductionBranch) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProductionBranch gets a reference to the given string and assigns it to the ProductionBranch field.
|
|
func (o *CloudflarePagesProjectCreate) SetProductionBranch(v string) {
|
|
o.ProductionBranch = &v
|
|
}
|
|
|
|
func (o CloudflarePagesProjectCreate) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CloudflarePagesProjectCreate) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.BuildConfig) {
|
|
toSerialize["build_config"] = o.BuildConfig
|
|
}
|
|
if !IsNil(o.DeploymentConfigs) {
|
|
toSerialize["deployment_configs"] = o.DeploymentConfigs
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.ProductionBranch) {
|
|
toSerialize["production_branch"] = o.ProductionBranch
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CloudflarePagesProjectCreate) UnmarshalJSON(data []byte) (err error) {
|
|
varCloudflarePagesProjectCreate := _CloudflarePagesProjectCreate{}
|
|
|
|
err = json.Unmarshal(data, &varCloudflarePagesProjectCreate)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CloudflarePagesProjectCreate(varCloudflarePagesProjectCreate)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "build_config")
|
|
delete(additionalProperties, "deployment_configs")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "production_branch")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCloudflarePagesProjectCreate struct {
|
|
value *CloudflarePagesProjectCreate
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCloudflarePagesProjectCreate) Get() *CloudflarePagesProjectCreate {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesProjectCreate) Set(val *CloudflarePagesProjectCreate) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCloudflarePagesProjectCreate) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesProjectCreate) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCloudflarePagesProjectCreate(val *CloudflarePagesProjectCreate) *NullableCloudflarePagesProjectCreate {
|
|
return &NullableCloudflarePagesProjectCreate{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCloudflarePagesProjectCreate) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCloudflarePagesProjectCreate) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|