init
This commit is contained in:
270
openapi/model_access_authorization_response.go
Normal file
270
openapi/model_access_authorization_response.go
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
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 AccessAuthorizationResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &AccessAuthorizationResponse{}
|
||||
|
||||
// AccessAuthorizationResponse struct for AccessAuthorizationResponse
|
||||
type AccessAuthorizationResponse struct {
|
||||
Name string `json:"name"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Id int32 `json:"id"`
|
||||
Timetables []Timetable `json:"timetables"`
|
||||
Groups []GroupDB `json:"groups"`
|
||||
}
|
||||
|
||||
type _AccessAuthorizationResponse AccessAuthorizationResponse
|
||||
|
||||
// NewAccessAuthorizationResponse instantiates a new AccessAuthorizationResponse 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 NewAccessAuthorizationResponse(name string, isActive bool, id int32, timetables []Timetable, groups []GroupDB) *AccessAuthorizationResponse {
|
||||
this := AccessAuthorizationResponse{}
|
||||
this.Name = name
|
||||
this.IsActive = isActive
|
||||
this.Id = id
|
||||
this.Timetables = timetables
|
||||
this.Groups = groups
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAccessAuthorizationResponseWithDefaults instantiates a new AccessAuthorizationResponse 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 NewAccessAuthorizationResponseWithDefaults() *AccessAuthorizationResponse {
|
||||
this := AccessAuthorizationResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *AccessAuthorizationResponse) 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 *AccessAuthorizationResponse) GetNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Name, true
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *AccessAuthorizationResponse) SetName(v string) {
|
||||
o.Name = v
|
||||
}
|
||||
|
||||
// GetIsActive returns the IsActive field value
|
||||
func (o *AccessAuthorizationResponse) GetIsActive() bool {
|
||||
if o == nil {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.IsActive
|
||||
}
|
||||
|
||||
// GetIsActiveOk returns a tuple with the IsActive field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AccessAuthorizationResponse) GetIsActiveOk() (*bool, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.IsActive, true
|
||||
}
|
||||
|
||||
// SetIsActive sets field value
|
||||
func (o *AccessAuthorizationResponse) SetIsActive(v bool) {
|
||||
o.IsActive = v
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *AccessAuthorizationResponse) 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 *AccessAuthorizationResponse) GetIdOk() (*int32, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Id, true
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *AccessAuthorizationResponse) SetId(v int32) {
|
||||
o.Id = v
|
||||
}
|
||||
|
||||
// GetTimetables returns the Timetables field value
|
||||
func (o *AccessAuthorizationResponse) GetTimetables() []Timetable {
|
||||
if o == nil {
|
||||
var ret []Timetable
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Timetables
|
||||
}
|
||||
|
||||
// GetTimetablesOk returns a tuple with the Timetables field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AccessAuthorizationResponse) GetTimetablesOk() ([]Timetable, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Timetables, true
|
||||
}
|
||||
|
||||
// SetTimetables sets field value
|
||||
func (o *AccessAuthorizationResponse) SetTimetables(v []Timetable) {
|
||||
o.Timetables = v
|
||||
}
|
||||
|
||||
// GetGroups returns the Groups field value
|
||||
func (o *AccessAuthorizationResponse) GetGroups() []GroupDB {
|
||||
if o == nil {
|
||||
var ret []GroupDB
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Groups
|
||||
}
|
||||
|
||||
// GetGroupsOk returns a tuple with the Groups field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AccessAuthorizationResponse) GetGroupsOk() ([]GroupDB, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Groups, true
|
||||
}
|
||||
|
||||
// SetGroups sets field value
|
||||
func (o *AccessAuthorizationResponse) SetGroups(v []GroupDB) {
|
||||
o.Groups = v
|
||||
}
|
||||
|
||||
func (o AccessAuthorizationResponse) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o AccessAuthorizationResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["name"] = o.Name
|
||||
toSerialize["is_active"] = o.IsActive
|
||||
toSerialize["id"] = o.Id
|
||||
toSerialize["timetables"] = o.Timetables
|
||||
toSerialize["groups"] = o.Groups
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *AccessAuthorizationResponse) 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",
|
||||
"is_active",
|
||||
"id",
|
||||
"timetables",
|
||||
"groups",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varAccessAuthorizationResponse := _AccessAuthorizationResponse{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varAccessAuthorizationResponse)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = AccessAuthorizationResponse(varAccessAuthorizationResponse)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableAccessAuthorizationResponse struct {
|
||||
value *AccessAuthorizationResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAccessAuthorizationResponse) Get() *AccessAuthorizationResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAccessAuthorizationResponse) Set(val *AccessAuthorizationResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAccessAuthorizationResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAccessAuthorizationResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAccessAuthorizationResponse(val *AccessAuthorizationResponse) *NullableAccessAuthorizationResponse {
|
||||
return &NullableAccessAuthorizationResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAccessAuthorizationResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAccessAuthorizationResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user