/* Hindsight HTTP API HTTP API for Hindsight API version: 0.4.21 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package hindsight import ( "encoding/json" ) // checks if the UpdateMentalModelRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateMentalModelRequest{} // UpdateMentalModelRequest Request model for updating a mental model. type UpdateMentalModelRequest struct { Name NullableString `json:"name,omitempty"` SourceQuery NullableString `json:"source_query,omitempty"` MaxTokens NullableInt32 `json:"max_tokens,omitempty"` Tags []string `json:"tags,omitempty"` Trigger NullableMentalModelTriggerInput `json:"trigger,omitempty"` } // NewUpdateMentalModelRequest instantiates a new UpdateMentalModelRequest 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 NewUpdateMentalModelRequest() *UpdateMentalModelRequest { this := UpdateMentalModelRequest{} return &this } // NewUpdateMentalModelRequestWithDefaults instantiates a new UpdateMentalModelRequest 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 NewUpdateMentalModelRequestWithDefaults() *UpdateMentalModelRequest { this := UpdateMentalModelRequest{} return &this } // GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateMentalModelRequest) GetName() string { if o == nil || IsNil(o.Name.Get()) { var ret string return ret } return *o.Name.Get() } // GetNameOk returns a tuple with the Name 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 *UpdateMentalModelRequest) GetNameOk() (*string, bool) { if o == nil { return nil, false } return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *UpdateMentalModelRequest) HasName() bool { if o != nil && o.Name.IsSet() { return true } return false } // SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *UpdateMentalModelRequest) SetName(v string) { o.Name.Set(&v) } // SetNameNil sets the value for Name to be an explicit nil func (o *UpdateMentalModelRequest) SetNameNil() { o.Name.Set(nil) } // UnsetName ensures that no value is present for Name, not even an explicit nil func (o *UpdateMentalModelRequest) UnsetName() { o.Name.Unset() } // GetSourceQuery returns the SourceQuery field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateMentalModelRequest) GetSourceQuery() string { if o == nil || IsNil(o.SourceQuery.Get()) { var ret string return ret } return *o.SourceQuery.Get() } // GetSourceQueryOk returns a tuple with the SourceQuery 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 *UpdateMentalModelRequest) GetSourceQueryOk() (*string, bool) { if o == nil { return nil, false } return o.SourceQuery.Get(), o.SourceQuery.IsSet() } // HasSourceQuery returns a boolean if a field has been set. func (o *UpdateMentalModelRequest) HasSourceQuery() bool { if o != nil && o.SourceQuery.IsSet() { return true } return false } // SetSourceQuery gets a reference to the given NullableString and assigns it to the SourceQuery field. func (o *UpdateMentalModelRequest) SetSourceQuery(v string) { o.SourceQuery.Set(&v) } // SetSourceQueryNil sets the value for SourceQuery to be an explicit nil func (o *UpdateMentalModelRequest) SetSourceQueryNil() { o.SourceQuery.Set(nil) } // UnsetSourceQuery ensures that no value is present for SourceQuery, not even an explicit nil func (o *UpdateMentalModelRequest) UnsetSourceQuery() { o.SourceQuery.Unset() } // GetMaxTokens returns the MaxTokens field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateMentalModelRequest) GetMaxTokens() int32 { if o == nil || IsNil(o.MaxTokens.Get()) { var ret int32 return ret } return *o.MaxTokens.Get() } // GetMaxTokensOk returns a tuple with the MaxTokens 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 *UpdateMentalModelRequest) GetMaxTokensOk() (*int32, bool) { if o == nil { return nil, false } return o.MaxTokens.Get(), o.MaxTokens.IsSet() } // HasMaxTokens returns a boolean if a field has been set. func (o *UpdateMentalModelRequest) HasMaxTokens() bool { if o != nil && o.MaxTokens.IsSet() { return true } return false } // SetMaxTokens gets a reference to the given NullableInt32 and assigns it to the MaxTokens field. func (o *UpdateMentalModelRequest) SetMaxTokens(v int32) { o.MaxTokens.Set(&v) } // SetMaxTokensNil sets the value for MaxTokens to be an explicit nil func (o *UpdateMentalModelRequest) SetMaxTokensNil() { o.MaxTokens.Set(nil) } // UnsetMaxTokens ensures that no value is present for MaxTokens, not even an explicit nil func (o *UpdateMentalModelRequest) UnsetMaxTokens() { o.MaxTokens.Unset() } // GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateMentalModelRequest) GetTags() []string { if o == nil { var ret []string return ret } return o.Tags } // GetTagsOk returns a tuple with the Tags 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 *UpdateMentalModelRequest) GetTagsOk() ([]string, bool) { if o == nil || IsNil(o.Tags) { return nil, false } return o.Tags, true } // HasTags returns a boolean if a field has been set. func (o *UpdateMentalModelRequest) HasTags() bool { if o != nil && !IsNil(o.Tags) { return true } return false } // SetTags gets a reference to the given []string and assigns it to the Tags field. func (o *UpdateMentalModelRequest) SetTags(v []string) { o.Tags = v } // GetTrigger returns the Trigger field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateMentalModelRequest) GetTrigger() MentalModelTriggerInput { if o == nil || IsNil(o.Trigger.Get()) { var ret MentalModelTriggerInput return ret } return *o.Trigger.Get() } // GetTriggerOk returns a tuple with the Trigger 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 *UpdateMentalModelRequest) GetTriggerOk() (*MentalModelTriggerInput, bool) { if o == nil { return nil, false } return o.Trigger.Get(), o.Trigger.IsSet() } // HasTrigger returns a boolean if a field has been set. func (o *UpdateMentalModelRequest) HasTrigger() bool { if o != nil && o.Trigger.IsSet() { return true } return false } // SetTrigger gets a reference to the given NullableMentalModelTriggerInput and assigns it to the Trigger field. func (o *UpdateMentalModelRequest) SetTrigger(v MentalModelTriggerInput) { o.Trigger.Set(&v) } // SetTriggerNil sets the value for Trigger to be an explicit nil func (o *UpdateMentalModelRequest) SetTriggerNil() { o.Trigger.Set(nil) } // UnsetTrigger ensures that no value is present for Trigger, not even an explicit nil func (o *UpdateMentalModelRequest) UnsetTrigger() { o.Trigger.Unset() } func (o UpdateMentalModelRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UpdateMentalModelRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Name.IsSet() { toSerialize["name"] = o.Name.Get() } if o.SourceQuery.IsSet() { toSerialize["source_query"] = o.SourceQuery.Get() } if o.MaxTokens.IsSet() { toSerialize["max_tokens"] = o.MaxTokens.Get() } if o.Tags != nil { toSerialize["tags"] = o.Tags } if o.Trigger.IsSet() { toSerialize["trigger"] = o.Trigger.Get() } return toSerialize, nil } type NullableUpdateMentalModelRequest struct { value *UpdateMentalModelRequest isSet bool } func (v NullableUpdateMentalModelRequest) Get() *UpdateMentalModelRequest { return v.value } func (v *NullableUpdateMentalModelRequest) Set(val *UpdateMentalModelRequest) { v.value = val v.isSet = true } func (v NullableUpdateMentalModelRequest) IsSet() bool { return v.isSet } func (v *NullableUpdateMentalModelRequest) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateMentalModelRequest(val *UpdateMentalModelRequest) *NullableUpdateMentalModelRequest { return &NullableUpdateMentalModelRequest{value: val, isSet: true} } func (v NullableUpdateMentalModelRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateMentalModelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }