Files
sdk/model_code_ask_post_in.go

193 lines
4.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 CodeAskPostIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CodeAskPostIn{}
// CodeAskPostIn struct for CodeAskPostIn
type CodeAskPostIn struct {
// Query is the question, from the BODY. Takes precedence over `?q=`.
Query *string `json:"query,omitempty"`
// Repo is the repository narrowing, from the BODY. Takes precedence over `?repo=`.
Repo *string `json:"repo,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CodeAskPostIn CodeAskPostIn
// NewCodeAskPostIn instantiates a new CodeAskPostIn 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 NewCodeAskPostIn() *CodeAskPostIn {
this := CodeAskPostIn{}
return &this
}
// NewCodeAskPostInWithDefaults instantiates a new CodeAskPostIn 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 NewCodeAskPostInWithDefaults() *CodeAskPostIn {
this := CodeAskPostIn{}
return &this
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *CodeAskPostIn) 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 *CodeAskPostIn) 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 *CodeAskPostIn) 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 *CodeAskPostIn) SetQuery(v string) {
o.Query = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *CodeAskPostIn) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeAskPostIn) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *CodeAskPostIn) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *CodeAskPostIn) SetRepo(v string) {
o.Repo = &v
}
func (o CodeAskPostIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CodeAskPostIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Query) {
toSerialize["query"] = o.Query
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CodeAskPostIn) UnmarshalJSON(data []byte) (err error) {
varCodeAskPostIn := _CodeAskPostIn{}
err = json.Unmarshal(data, &varCodeAskPostIn)
if err != nil {
return err
}
*o = CodeAskPostIn(varCodeAskPostIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "query")
delete(additionalProperties, "repo")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCodeAskPostIn struct {
value *CodeAskPostIn
isSet bool
}
func (v NullableCodeAskPostIn) Get() *CodeAskPostIn {
return v.value
}
func (v *NullableCodeAskPostIn) Set(val *CodeAskPostIn) {
v.value = val
v.isSet = true
}
func (v NullableCodeAskPostIn) IsSet() bool {
return v.isSet
}
func (v *NullableCodeAskPostIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCodeAskPostIn(val *CodeAskPostIn) *NullableCodeAskPostIn {
return &NullableCodeAskPostIn{value: val, isSet: true}
}
func (v NullableCodeAskPostIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCodeAskPostIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}