init
This commit is contained in:
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
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 GroupResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GroupResponse{}
|
||||
|
||||
// GroupResponse struct for GroupResponse
|
||||
type GroupResponse struct {
|
||||
Name string `json:"name"`
|
||||
Id int32 `json:"id"`
|
||||
Cards []Card `json:"cards"`
|
||||
Accessauths []AccessAuthorizationDB `json:"accessauths"`
|
||||
}
|
||||
|
||||
type _GroupResponse GroupResponse
|
||||
|
||||
// NewGroupResponse instantiates a new GroupResponse 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 NewGroupResponse(name string, id int32, cards []Card, accessauths []AccessAuthorizationDB) *GroupResponse {
|
||||
this := GroupResponse{}
|
||||
this.Name = name
|
||||
this.Id = id
|
||||
this.Cards = cards
|
||||
this.Accessauths = accessauths
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGroupResponseWithDefaults instantiates a new GroupResponse 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 NewGroupResponseWithDefaults() *GroupResponse {
|
||||
this := GroupResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *GroupResponse) 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 *GroupResponse) GetNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Name, true
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *GroupResponse) SetName(v string) {
|
||||
o.Name = v
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *GroupResponse) GetId() int32 {
|
||||
if o == nil {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GroupResponse) GetIdOk() (*int32, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Id, true
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *GroupResponse) SetId(v int32) {
|
||||
o.Id = v
|
||||
}
|
||||
|
||||
// GetCards returns the Cards field value
|
||||
// If the value is explicit nil, the zero value for []Card will be returned
|
||||
func (o *GroupResponse) GetCards() []Card {
|
||||
if o == nil {
|
||||
var ret []Card
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Cards
|
||||
}
|
||||
|
||||
// GetCardsOk returns a tuple with the Cards field value
|
||||
// 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 *GroupResponse) GetCardsOk() ([]Card, bool) {
|
||||
if o == nil || IsNil(o.Cards) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Cards, true
|
||||
}
|
||||
|
||||
// SetCards sets field value
|
||||
func (o *GroupResponse) SetCards(v []Card) {
|
||||
o.Cards = v
|
||||
}
|
||||
|
||||
// GetAccessauths returns the Accessauths field value
|
||||
// If the value is explicit nil, the zero value for []AccessAuthorizationDB will be returned
|
||||
func (o *GroupResponse) GetAccessauths() []AccessAuthorizationDB {
|
||||
if o == nil {
|
||||
var ret []AccessAuthorizationDB
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Accessauths
|
||||
}
|
||||
|
||||
// GetAccessauthsOk returns a tuple with the Accessauths field value
|
||||
// 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 *GroupResponse) GetAccessauthsOk() ([]AccessAuthorizationDB, bool) {
|
||||
if o == nil || IsNil(o.Accessauths) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Accessauths, true
|
||||
}
|
||||
|
||||
// SetAccessauths sets field value
|
||||
func (o *GroupResponse) SetAccessauths(v []AccessAuthorizationDB) {
|
||||
o.Accessauths = v
|
||||
}
|
||||
|
||||
func (o GroupResponse) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o GroupResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["name"] = o.Name
|
||||
toSerialize["id"] = o.Id
|
||||
if o.Cards != nil {
|
||||
toSerialize["cards"] = o.Cards
|
||||
}
|
||||
if o.Accessauths != nil {
|
||||
toSerialize["accessauths"] = o.Accessauths
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *GroupResponse) 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",
|
||||
"id",
|
||||
"cards",
|
||||
"accessauths",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varGroupResponse := _GroupResponse{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varGroupResponse)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = GroupResponse(varGroupResponse)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableGroupResponse struct {
|
||||
value *GroupResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGroupResponse) Get() *GroupResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGroupResponse) Set(val *GroupResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGroupResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGroupResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGroupResponse(val *GroupResponse) *NullableGroupResponse {
|
||||
return &NullableGroupResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGroupResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGroupResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user