Files
sdk/model_brief.go

426 lines
10 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"
"fmt"
)
// checks if the Brief type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Brief{}
// Brief struct for Brief
type Brief struct {
Batch []string `json:"batch,omitempty"`
Format *string `json:"format,omitempty"`
Glossary map[string]string `json:"glossary,omitempty"`
Model *string `json:"model,omitempty"`
Source *string `json:"source,omitempty"`
Target string `json:"target"`
Text *string `json:"text,omitempty"`
Tier *string `json:"tier,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Brief Brief
// NewBrief instantiates a new Brief 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 NewBrief(target string) *Brief {
this := Brief{}
this.Target = target
return &this
}
// NewBriefWithDefaults instantiates a new Brief 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 NewBriefWithDefaults() *Brief {
this := Brief{}
return &this
}
// GetBatch returns the Batch field value if set, zero value otherwise.
func (o *Brief) GetBatch() []string {
if o == nil || IsNil(o.Batch) {
var ret []string
return ret
}
return o.Batch
}
// GetBatchOk returns a tuple with the Batch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetBatchOk() ([]string, bool) {
if o == nil || IsNil(o.Batch) {
return nil, false
}
return o.Batch, true
}
// HasBatch returns a boolean if a field has been set.
func (o *Brief) HasBatch() bool {
if o != nil && !IsNil(o.Batch) {
return true
}
return false
}
// SetBatch gets a reference to the given []string and assigns it to the Batch field.
func (o *Brief) SetBatch(v []string) {
o.Batch = v
}
// GetFormat returns the Format field value if set, zero value otherwise.
func (o *Brief) GetFormat() string {
if o == nil || IsNil(o.Format) {
var ret string
return ret
}
return *o.Format
}
// GetFormatOk returns a tuple with the Format field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetFormatOk() (*string, bool) {
if o == nil || IsNil(o.Format) {
return nil, false
}
return o.Format, true
}
// HasFormat returns a boolean if a field has been set.
func (o *Brief) HasFormat() bool {
if o != nil && !IsNil(o.Format) {
return true
}
return false
}
// SetFormat gets a reference to the given string and assigns it to the Format field.
func (o *Brief) SetFormat(v string) {
o.Format = &v
}
// GetGlossary returns the Glossary field value if set, zero value otherwise.
func (o *Brief) GetGlossary() map[string]string {
if o == nil || IsNil(o.Glossary) {
var ret map[string]string
return ret
}
return o.Glossary
}
// GetGlossaryOk returns a tuple with the Glossary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetGlossaryOk() (map[string]string, bool) {
if o == nil || IsNil(o.Glossary) {
return map[string]string{}, false
}
return o.Glossary, true
}
// HasGlossary returns a boolean if a field has been set.
func (o *Brief) HasGlossary() bool {
if o != nil && !IsNil(o.Glossary) {
return true
}
return false
}
// SetGlossary gets a reference to the given map[string]string and assigns it to the Glossary field.
func (o *Brief) SetGlossary(v map[string]string) {
o.Glossary = v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *Brief) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *Brief) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *Brief) SetModel(v string) {
o.Model = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *Brief) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *Brief) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *Brief) SetSource(v string) {
o.Source = &v
}
// GetTarget returns the Target field value
func (o *Brief) GetTarget() string {
if o == nil {
var ret string
return ret
}
return o.Target
}
// GetTargetOk returns a tuple with the Target field value
// and a boolean to check if the value has been set.
func (o *Brief) GetTargetOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Target, true
}
// SetTarget sets field value
func (o *Brief) SetTarget(v string) {
o.Target = v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Brief) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *Brief) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *Brief) SetText(v string) {
o.Text = &v
}
// GetTier returns the Tier field value if set, zero value otherwise.
func (o *Brief) GetTier() string {
if o == nil || IsNil(o.Tier) {
var ret string
return ret
}
return *o.Tier
}
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Brief) GetTierOk() (*string, bool) {
if o == nil || IsNil(o.Tier) {
return nil, false
}
return o.Tier, true
}
// HasTier returns a boolean if a field has been set.
func (o *Brief) HasTier() bool {
if o != nil && !IsNil(o.Tier) {
return true
}
return false
}
// SetTier gets a reference to the given string and assigns it to the Tier field.
func (o *Brief) SetTier(v string) {
o.Tier = &v
}
func (o Brief) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Brief) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Batch) {
toSerialize["batch"] = o.Batch
}
if !IsNil(o.Format) {
toSerialize["format"] = o.Format
}
if !IsNil(o.Glossary) {
toSerialize["glossary"] = o.Glossary
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
toSerialize["target"] = o.Target
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Tier) {
toSerialize["tier"] = o.Tier
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Brief) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"target",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBrief := _Brief{}
err = json.Unmarshal(data, &varBrief)
if err != nil {
return err
}
*o = Brief(varBrief)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "batch")
delete(additionalProperties, "format")
delete(additionalProperties, "glossary")
delete(additionalProperties, "model")
delete(additionalProperties, "source")
delete(additionalProperties, "target")
delete(additionalProperties, "text")
delete(additionalProperties, "tier")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBrief struct {
value *Brief
isSet bool
}
func (v NullableBrief) Get() *Brief {
return v.value
}
func (v *NullableBrief) Set(val *Brief) {
v.value = val
v.isSet = true
}
func (v NullableBrief) IsSet() bool {
return v.isSet
}
func (v *NullableBrief) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBrief(val *Brief) *NullableBrief {
return &NullableBrief{value: val, isSet: true}
}
func (v NullableBrief) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBrief) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}