Files
sdk/model_graph_qlin.go

229 lines
5.8 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 GraphQLIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphQLIn{}
// GraphQLIn struct for GraphQLIn
type GraphQLIn struct {
OperationName *string `json:"operationName,omitempty"`
Query *string `json:"query,omitempty"`
Variables interface{} `json:"variables,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphQLIn GraphQLIn
// NewGraphQLIn instantiates a new GraphQLIn 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 NewGraphQLIn() *GraphQLIn {
this := GraphQLIn{}
return &this
}
// NewGraphQLInWithDefaults instantiates a new GraphQLIn 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 NewGraphQLInWithDefaults() *GraphQLIn {
this := GraphQLIn{}
return &this
}
// GetOperationName returns the OperationName field value if set, zero value otherwise.
func (o *GraphQLIn) GetOperationName() string {
if o == nil || IsNil(o.OperationName) {
var ret string
return ret
}
return *o.OperationName
}
// GetOperationNameOk returns a tuple with the OperationName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphQLIn) GetOperationNameOk() (*string, bool) {
if o == nil || IsNil(o.OperationName) {
return nil, false
}
return o.OperationName, true
}
// HasOperationName returns a boolean if a field has been set.
func (o *GraphQLIn) HasOperationName() bool {
if o != nil && !IsNil(o.OperationName) {
return true
}
return false
}
// SetOperationName gets a reference to the given string and assigns it to the OperationName field.
func (o *GraphQLIn) SetOperationName(v string) {
o.OperationName = &v
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *GraphQLIn) GetQuery() string {
if o == nil || IsNil(o.Query) {
var ret string
return ret
}
return *o.Query
}
// GetQueryOk returns a tuple with the Query field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphQLIn) GetQueryOk() (*string, bool) {
if o == nil || IsNil(o.Query) {
return nil, false
}
return o.Query, true
}
// HasQuery returns a boolean if a field has been set.
func (o *GraphQLIn) HasQuery() bool {
if o != nil && !IsNil(o.Query) {
return true
}
return false
}
// SetQuery gets a reference to the given string and assigns it to the Query field.
func (o *GraphQLIn) SetQuery(v string) {
o.Query = &v
}
// GetVariables returns the Variables field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *GraphQLIn) GetVariables() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Variables
}
// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *GraphQLIn) GetVariablesOk() (*interface{}, bool) {
if o == nil || IsNil(o.Variables) {
return nil, false
}
return &o.Variables, true
}
// HasVariables returns a boolean if a field has been set.
func (o *GraphQLIn) HasVariables() bool {
if o != nil && !IsNil(o.Variables) {
return true
}
return false
}
// SetVariables gets a reference to the given interface{} and assigns it to the Variables field.
func (o *GraphQLIn) SetVariables(v interface{}) {
o.Variables = v
}
func (o GraphQLIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphQLIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OperationName) {
toSerialize["operationName"] = o.OperationName
}
if !IsNil(o.Query) {
toSerialize["query"] = o.Query
}
if o.Variables != nil {
toSerialize["variables"] = o.Variables
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphQLIn) UnmarshalJSON(data []byte) (err error) {
varGraphQLIn := _GraphQLIn{}
err = json.Unmarshal(data, &varGraphQLIn)
if err != nil {
return err
}
*o = GraphQLIn(varGraphQLIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "operationName")
delete(additionalProperties, "query")
delete(additionalProperties, "variables")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphQLIn struct {
value *GraphQLIn
isSet bool
}
func (v NullableGraphQLIn) Get() *GraphQLIn {
return v.value
}
func (v *NullableGraphQLIn) Set(val *GraphQLIn) {
v.value = val
v.isSet = true
}
func (v NullableGraphQLIn) IsSet() bool {
return v.isSet
}
func (v *NullableGraphQLIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphQLIn(val *GraphQLIn) *NullableGraphQLIn {
return &NullableGraphQLIn{value: val, isSet: true}
}
func (v NullableGraphQLIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphQLIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}