go-redfish/client/model_collection.go
James Gu c442eb5bcb Upgrade openapi generator to v5.1.0
Upgraded openapi generator version to 5.1.0 for the support of nullable
values for optional fields; Added missing "Disabled" enum value to the
BootSourceOverrideEnabled model in the openapi schema.

Signed-off-by: James Gu <james.gu@att.com>
Change-Id: Ia3e0b018be13079d2085ef61ed2e797bcfd25fd7
2021-05-05 10:18:32 -04:00

395 lines
10 KiB
Go

/*
* Redfish OAPI specification
*
* Partial Redfish OAPI specification for a limited client
*
* API version: 0.0.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
)
// Collection A Collection of ComputerSystem resource instances.
type Collection struct {
// context
OdataContext *string `json:"@odata.context,omitempty"`
// etag
OdataEtag *string `json:"@odata.etag,omitempty"`
// id
OdataId string `json:"@odata.id"`
// type
OdataType string `json:"@odata.type"`
// description
Description NullableString `json:"Description,omitempty"`
// Contains the members of this collection.
Members []IdRef `json:"Members"`
// The number of items in a collection.
MembersodataCount *int32 `json:"Members@odata.count,omitempty"`
// The URI to the resource containing the next set of partial members.
MembersodataNextLink *string `json:"Members@odata.nextLink,omitempty"`
// The name of the resource.
Name string `json:"Name"`
}
// NewCollection instantiates a new Collection 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 NewCollection(odataId string, odataType string, members []IdRef, name string) *Collection {
this := Collection{}
this.OdataId = odataId
this.OdataType = odataType
this.Members = members
this.Name = name
return &this
}
// NewCollectionWithDefaults instantiates a new Collection 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 NewCollectionWithDefaults() *Collection {
this := Collection{}
return &this
}
// GetOdataContext returns the OdataContext field value if set, zero value otherwise.
func (o *Collection) GetOdataContext() string {
if o == nil || o.OdataContext == nil {
var ret string
return ret
}
return *o.OdataContext
}
// GetOdataContextOk returns a tuple with the OdataContext field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Collection) GetOdataContextOk() (*string, bool) {
if o == nil || o.OdataContext == nil {
return nil, false
}
return o.OdataContext, true
}
// HasOdataContext returns a boolean if a field has been set.
func (o *Collection) HasOdataContext() bool {
if o != nil && o.OdataContext != nil {
return true
}
return false
}
// SetOdataContext gets a reference to the given string and assigns it to the OdataContext field.
func (o *Collection) SetOdataContext(v string) {
o.OdataContext = &v
}
// GetOdataEtag returns the OdataEtag field value if set, zero value otherwise.
func (o *Collection) GetOdataEtag() string {
if o == nil || o.OdataEtag == nil {
var ret string
return ret
}
return *o.OdataEtag
}
// GetOdataEtagOk returns a tuple with the OdataEtag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Collection) GetOdataEtagOk() (*string, bool) {
if o == nil || o.OdataEtag == nil {
return nil, false
}
return o.OdataEtag, true
}
// HasOdataEtag returns a boolean if a field has been set.
func (o *Collection) HasOdataEtag() bool {
if o != nil && o.OdataEtag != nil {
return true
}
return false
}
// SetOdataEtag gets a reference to the given string and assigns it to the OdataEtag field.
func (o *Collection) SetOdataEtag(v string) {
o.OdataEtag = &v
}
// GetOdataId returns the OdataId field value
func (o *Collection) GetOdataId() string {
if o == nil {
var ret string
return ret
}
return o.OdataId
}
// GetOdataIdOk returns a tuple with the OdataId field value
// and a boolean to check if the value has been set.
func (o *Collection) GetOdataIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OdataId, true
}
// SetOdataId sets field value
func (o *Collection) SetOdataId(v string) {
o.OdataId = v
}
// GetOdataType returns the OdataType field value
func (o *Collection) GetOdataType() string {
if o == nil {
var ret string
return ret
}
return o.OdataType
}
// GetOdataTypeOk returns a tuple with the OdataType field value
// and a boolean to check if the value has been set.
func (o *Collection) GetOdataTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OdataType, true
}
// SetOdataType sets field value
func (o *Collection) SetOdataType(v string) {
o.OdataType = v
}
// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Collection) GetDescription() string {
if o == nil || o.Description.Get() == nil {
var ret string
return ret
}
return *o.Description.Get()
}
// GetDescriptionOk returns a tuple with the Description 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 *Collection) GetDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Description.Get(), o.Description.IsSet()
}
// HasDescription returns a boolean if a field has been set.
func (o *Collection) HasDescription() bool {
if o != nil && o.Description.IsSet() {
return true
}
return false
}
// SetDescription gets a reference to the given NullableString and assigns it to the Description field.
func (o *Collection) SetDescription(v string) {
o.Description.Set(&v)
}
// SetDescriptionNil sets the value for Description to be an explicit nil
func (o *Collection) SetDescriptionNil() {
o.Description.Set(nil)
}
// UnsetDescription ensures that no value is present for Description, not even an explicit nil
func (o *Collection) UnsetDescription() {
o.Description.Unset()
}
// GetMembers returns the Members field value
func (o *Collection) GetMembers() []IdRef {
if o == nil {
var ret []IdRef
return ret
}
return o.Members
}
// GetMembersOk returns a tuple with the Members field value
// and a boolean to check if the value has been set.
func (o *Collection) GetMembersOk() (*[]IdRef, bool) {
if o == nil {
return nil, false
}
return &o.Members, true
}
// SetMembers sets field value
func (o *Collection) SetMembers(v []IdRef) {
o.Members = v
}
// GetMembersodataCount returns the MembersodataCount field value if set, zero value otherwise.
func (o *Collection) GetMembersodataCount() int32 {
if o == nil || o.MembersodataCount == nil {
var ret int32
return ret
}
return *o.MembersodataCount
}
// GetMembersodataCountOk returns a tuple with the MembersodataCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Collection) GetMembersodataCountOk() (*int32, bool) {
if o == nil || o.MembersodataCount == nil {
return nil, false
}
return o.MembersodataCount, true
}
// HasMembersodataCount returns a boolean if a field has been set.
func (o *Collection) HasMembersodataCount() bool {
if o != nil && o.MembersodataCount != nil {
return true
}
return false
}
// SetMembersodataCount gets a reference to the given int32 and assigns it to the MembersodataCount field.
func (o *Collection) SetMembersodataCount(v int32) {
o.MembersodataCount = &v
}
// GetMembersodataNextLink returns the MembersodataNextLink field value if set, zero value otherwise.
func (o *Collection) GetMembersodataNextLink() string {
if o == nil || o.MembersodataNextLink == nil {
var ret string
return ret
}
return *o.MembersodataNextLink
}
// GetMembersodataNextLinkOk returns a tuple with the MembersodataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Collection) GetMembersodataNextLinkOk() (*string, bool) {
if o == nil || o.MembersodataNextLink == nil {
return nil, false
}
return o.MembersodataNextLink, true
}
// HasMembersodataNextLink returns a boolean if a field has been set.
func (o *Collection) HasMembersodataNextLink() bool {
if o != nil && o.MembersodataNextLink != nil {
return true
}
return false
}
// SetMembersodataNextLink gets a reference to the given string and assigns it to the MembersodataNextLink field.
func (o *Collection) SetMembersodataNextLink(v string) {
o.MembersodataNextLink = &v
}
// GetName returns the Name field value
func (o *Collection) 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 *Collection) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Collection) SetName(v string) {
o.Name = v
}
func (o Collection) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataContext != nil {
toSerialize["@odata.context"] = o.OdataContext
}
if o.OdataEtag != nil {
toSerialize["@odata.etag"] = o.OdataEtag
}
if true {
toSerialize["@odata.id"] = o.OdataId
}
if true {
toSerialize["@odata.type"] = o.OdataType
}
if o.Description.IsSet() {
toSerialize["Description"] = o.Description.Get()
}
if true {
toSerialize["Members"] = o.Members
}
if o.MembersodataCount != nil {
toSerialize["Members@odata.count"] = o.MembersodataCount
}
if o.MembersodataNextLink != nil {
toSerialize["Members@odata.nextLink"] = o.MembersodataNextLink
}
if true {
toSerialize["Name"] = o.Name
}
return json.Marshal(toSerialize)
}
type NullableCollection struct {
value *Collection
isSet bool
}
func (v NullableCollection) Get() *Collection {
return v.value
}
func (v *NullableCollection) Set(val *Collection) {
v.value = val
v.isSet = true
}
func (v NullableCollection) IsSet() bool {
return v.isSet
}
func (v *NullableCollection) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCollection(val *Collection) *NullableCollection {
return &NullableCollection{value: val, isSet: true}
}
func (v NullableCollection) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCollection) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}