mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.2 KiB
Go
193 lines
5.2 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 CloudflareD1Query type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CloudflareD1Query{}
|
|
|
|
// CloudflareD1Query struct for CloudflareD1Query
|
|
type CloudflareD1Query struct {
|
|
// Params are the statement's bound values, in the order its `?` placeholders appear — a string, a number, a boolean or null, whatever the column takes. Absent means the statement carries no placeholders; bind values here rather than interpolating them into the statement.
|
|
Params []interface{} `json:"params,omitempty"`
|
|
// SQL is the statement to run. Blank (or absent) is refused before anything reaches D1.
|
|
Sql *string `json:"sql,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CloudflareD1Query CloudflareD1Query
|
|
|
|
// NewCloudflareD1Query instantiates a new CloudflareD1Query 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 NewCloudflareD1Query() *CloudflareD1Query {
|
|
this := CloudflareD1Query{}
|
|
return &this
|
|
}
|
|
|
|
// NewCloudflareD1QueryWithDefaults instantiates a new CloudflareD1Query 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 NewCloudflareD1QueryWithDefaults() *CloudflareD1Query {
|
|
this := CloudflareD1Query{}
|
|
return &this
|
|
}
|
|
|
|
// GetParams returns the Params field value if set, zero value otherwise.
|
|
func (o *CloudflareD1Query) GetParams() []interface{} {
|
|
if o == nil || IsNil(o.Params) {
|
|
var ret []interface{}
|
|
return ret
|
|
}
|
|
return o.Params
|
|
}
|
|
|
|
// GetParamsOk returns a tuple with the Params field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflareD1Query) GetParamsOk() ([]interface{}, bool) {
|
|
if o == nil || IsNil(o.Params) {
|
|
return nil, false
|
|
}
|
|
return o.Params, true
|
|
}
|
|
|
|
// HasParams returns a boolean if a field has been set.
|
|
func (o *CloudflareD1Query) HasParams() bool {
|
|
if o != nil && !IsNil(o.Params) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParams gets a reference to the given []interface{} and assigns it to the Params field.
|
|
func (o *CloudflareD1Query) SetParams(v []interface{}) {
|
|
o.Params = v
|
|
}
|
|
|
|
// GetSql returns the Sql field value if set, zero value otherwise.
|
|
func (o *CloudflareD1Query) GetSql() string {
|
|
if o == nil || IsNil(o.Sql) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Sql
|
|
}
|
|
|
|
// GetSqlOk returns a tuple with the Sql field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CloudflareD1Query) GetSqlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Sql) {
|
|
return nil, false
|
|
}
|
|
return o.Sql, true
|
|
}
|
|
|
|
// HasSql returns a boolean if a field has been set.
|
|
func (o *CloudflareD1Query) HasSql() bool {
|
|
if o != nil && !IsNil(o.Sql) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSql gets a reference to the given string and assigns it to the Sql field.
|
|
func (o *CloudflareD1Query) SetSql(v string) {
|
|
o.Sql = &v
|
|
}
|
|
|
|
func (o CloudflareD1Query) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CloudflareD1Query) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Params) {
|
|
toSerialize["params"] = o.Params
|
|
}
|
|
if !IsNil(o.Sql) {
|
|
toSerialize["sql"] = o.Sql
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CloudflareD1Query) UnmarshalJSON(data []byte) (err error) {
|
|
varCloudflareD1Query := _CloudflareD1Query{}
|
|
|
|
err = json.Unmarshal(data, &varCloudflareD1Query)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CloudflareD1Query(varCloudflareD1Query)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "params")
|
|
delete(additionalProperties, "sql")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCloudflareD1Query struct {
|
|
value *CloudflareD1Query
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCloudflareD1Query) Get() *CloudflareD1Query {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCloudflareD1Query) Set(val *CloudflareD1Query) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCloudflareD1Query) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCloudflareD1Query) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCloudflareD1Query(val *CloudflareD1Query) *NullableCloudflareD1Query {
|
|
return &NullableCloudflareD1Query{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCloudflareD1Query) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCloudflareD1Query) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|