/* FastAPI No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 0.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" "bytes" "fmt" ) // checks if the GroupCreate type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GroupCreate{} // GroupCreate struct for GroupCreate type GroupCreate struct { Name string `json:"name"` } type _GroupCreate GroupCreate // NewGroupCreate instantiates a new GroupCreate 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 NewGroupCreate(name string) *GroupCreate { this := GroupCreate{} this.Name = name return &this } // NewGroupCreateWithDefaults instantiates a new GroupCreate 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 NewGroupCreateWithDefaults() *GroupCreate { this := GroupCreate{} return &this } // GetName returns the Name field value func (o *GroupCreate) GetName() string { if o == nil { var ret string return ret } return o.Name } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *GroupCreate) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *GroupCreate) SetName(v string) { o.Name = v } func (o GroupCreate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GroupCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name return toSerialize, nil } func (o *GroupCreate) 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{ "name", } 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) } } varGroupCreate := _GroupCreate{} decoder := json.NewDecoder(bytes.NewReader(data)) decoder.DisallowUnknownFields() err = decoder.Decode(&varGroupCreate) if err != nil { return err } *o = GroupCreate(varGroupCreate) return err } type NullableGroupCreate struct { value *GroupCreate isSet bool } func (v NullableGroupCreate) Get() *GroupCreate { return v.value } func (v *NullableGroupCreate) Set(val *GroupCreate) { v.value = val v.isSet = true } func (v NullableGroupCreate) IsSet() bool { return v.isSet } func (v *NullableGroupCreate) Unset() { v.value = nil v.isSet = false } func NewNullableGroupCreate(val *GroupCreate) *NullableGroupCreate { return &NullableGroupCreate{value: val, isSet: true} } func (v NullableGroupCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGroupCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }