diff --git a/api/openapi.yaml b/api/openapi.yaml index 75765d6508..a995bf63b9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -102497,7 +102497,6 @@ components: - id - name - url - - virtualmachine_count ClusterGroup: type: object description: Adds support for custom fields and tags. @@ -105609,13 +105608,11 @@ components: format: int64 readOnly: true required: - - device_count - display - id - name - slug - url - - virtualmachine_count DeviceRoleRequest: type: object description: Adds support for custom fields and tags. @@ -105685,7 +105682,6 @@ components: format: int64 readOnly: true required: - - device_count - display - id - manufacturer @@ -113955,7 +113951,6 @@ components: format: int64 readOnly: true required: - - devicetype_count - display - id - name @@ -126667,13 +126662,11 @@ components: format: int64 readOnly: true required: - - device_count - display - id - name - slug - url - - virtualmachine_count PlatformRequest: type: object description: Adds support for custom fields and tags. @@ -129230,7 +129223,6 @@ components: format: int64 readOnly: true required: - - device_count - display - id - name diff --git a/docs/Cluster.md b/docs/Cluster.md index 53f6ac8f25..00443ca407 100644 --- a/docs/Cluster.md +++ b/docs/Cluster.md @@ -9,13 +9,13 @@ Name | Type | Description | Notes **Display** | **string** | | [readonly] **Name** | **string** | | **Description** | Pointer to **string** | | [optional] -**VirtualmachineCount** | **int64** | | [readonly] +**VirtualmachineCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewCluster -`func NewCluster(id int32, url string, display string, name string, virtualmachineCount int64, ) *Cluster` +`func NewCluster(id int32, url string, display string, name string, ) *Cluster` NewCluster instantiates a new Cluster object This constructor will assign default values to properties that have it defined, @@ -154,6 +154,11 @@ and a boolean to check if the value has been set. SetVirtualmachineCount sets VirtualmachineCount field to given value. +### HasVirtualmachineCount + +`func (o *Cluster) HasVirtualmachineCount() bool` + +HasVirtualmachineCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeviceRole.md b/docs/DeviceRole.md index 69757a60f2..99ecb82bcc 100644 --- a/docs/DeviceRole.md +++ b/docs/DeviceRole.md @@ -10,14 +10,14 @@ Name | Type | Description | Notes **Name** | **string** | | **Slug** | **string** | | **Description** | Pointer to **string** | | [optional] -**DeviceCount** | **int64** | | [readonly] -**VirtualmachineCount** | **int64** | | [readonly] +**DeviceCount** | Pointer to **int64** | | [optional] [readonly] +**VirtualmachineCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewDeviceRole -`func NewDeviceRole(id int32, url string, display string, name string, slug string, deviceCount int64, virtualmachineCount int64, ) *DeviceRole` +`func NewDeviceRole(id int32, url string, display string, name string, slug string, ) *DeviceRole` NewDeviceRole instantiates a new DeviceRole object This constructor will assign default values to properties that have it defined, @@ -176,6 +176,11 @@ and a boolean to check if the value has been set. SetDeviceCount sets DeviceCount field to given value. +### HasDeviceCount + +`func (o *DeviceRole) HasDeviceCount() bool` + +HasDeviceCount returns a boolean if a field has been set. ### GetVirtualmachineCount @@ -196,6 +201,11 @@ and a boolean to check if the value has been set. SetVirtualmachineCount sets VirtualmachineCount field to given value. +### HasVirtualmachineCount + +`func (o *DeviceRole) HasVirtualmachineCount() bool` + +HasVirtualmachineCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeviceType.md b/docs/DeviceType.md index 0fd8ee2280..9d02d28e7f 100644 --- a/docs/DeviceType.md +++ b/docs/DeviceType.md @@ -11,13 +11,13 @@ Name | Type | Description | Notes **Model** | **string** | | **Slug** | **string** | | **Description** | Pointer to **string** | | [optional] -**DeviceCount** | **int64** | | [readonly] +**DeviceCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewDeviceType -`func NewDeviceType(id int32, url string, display string, manufacturer Manufacturer, model string, slug string, deviceCount int64, ) *DeviceType` +`func NewDeviceType(id int32, url string, display string, manufacturer Manufacturer, model string, slug string, ) *DeviceType` NewDeviceType instantiates a new DeviceType object This constructor will assign default values to properties that have it defined, @@ -196,6 +196,11 @@ and a boolean to check if the value has been set. SetDeviceCount sets DeviceCount field to given value. +### HasDeviceCount + +`func (o *DeviceType) HasDeviceCount() bool` + +HasDeviceCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Manufacturer.md b/docs/Manufacturer.md index c4c2211adc..753c72fe61 100644 --- a/docs/Manufacturer.md +++ b/docs/Manufacturer.md @@ -10,13 +10,13 @@ Name | Type | Description | Notes **Name** | **string** | | **Slug** | **string** | | **Description** | Pointer to **string** | | [optional] -**DevicetypeCount** | **int64** | | [readonly] +**DevicetypeCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewManufacturer -`func NewManufacturer(id int32, url string, display string, name string, slug string, devicetypeCount int64, ) *Manufacturer` +`func NewManufacturer(id int32, url string, display string, name string, slug string, ) *Manufacturer` NewManufacturer instantiates a new Manufacturer object This constructor will assign default values to properties that have it defined, @@ -175,6 +175,11 @@ and a boolean to check if the value has been set. SetDevicetypeCount sets DevicetypeCount field to given value. +### HasDevicetypeCount + +`func (o *Manufacturer) HasDevicetypeCount() bool` + +HasDevicetypeCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Platform.md b/docs/Platform.md index abceb730ab..d4c3b9c569 100644 --- a/docs/Platform.md +++ b/docs/Platform.md @@ -10,14 +10,14 @@ Name | Type | Description | Notes **Name** | **string** | | **Slug** | **string** | | **Description** | Pointer to **string** | | [optional] -**DeviceCount** | **int64** | | [readonly] -**VirtualmachineCount** | **int64** | | [readonly] +**DeviceCount** | Pointer to **int64** | | [optional] [readonly] +**VirtualmachineCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewPlatform -`func NewPlatform(id int32, url string, display string, name string, slug string, deviceCount int64, virtualmachineCount int64, ) *Platform` +`func NewPlatform(id int32, url string, display string, name string, slug string, ) *Platform` NewPlatform instantiates a new Platform object This constructor will assign default values to properties that have it defined, @@ -176,6 +176,11 @@ and a boolean to check if the value has been set. SetDeviceCount sets DeviceCount field to given value. +### HasDeviceCount + +`func (o *Platform) HasDeviceCount() bool` + +HasDeviceCount returns a boolean if a field has been set. ### GetVirtualmachineCount @@ -196,6 +201,11 @@ and a boolean to check if the value has been set. SetVirtualmachineCount sets VirtualmachineCount field to given value. +### HasVirtualmachineCount + +`func (o *Platform) HasVirtualmachineCount() bool` + +HasVirtualmachineCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Rack.md b/docs/Rack.md index 5628a5efc9..20e4a6cb29 100644 --- a/docs/Rack.md +++ b/docs/Rack.md @@ -9,13 +9,13 @@ Name | Type | Description | Notes **Display** | **string** | | [readonly] **Name** | **string** | | **Description** | Pointer to **string** | | [optional] -**DeviceCount** | **int64** | | [readonly] +**DeviceCount** | Pointer to **int64** | | [optional] [readonly] ## Methods ### NewRack -`func NewRack(id int32, url string, display string, name string, deviceCount int64, ) *Rack` +`func NewRack(id int32, url string, display string, name string, ) *Rack` NewRack instantiates a new Rack object This constructor will assign default values to properties that have it defined, @@ -154,6 +154,11 @@ and a boolean to check if the value has been set. SetDeviceCount sets DeviceCount field to given value. +### HasDeviceCount + +`func (o *Rack) HasDeviceCount() bool` + +HasDeviceCount returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/model_cluster.go b/model_cluster.go index ac931d63f5..64f264c1cd 100644 --- a/model_cluster.go +++ b/model_cluster.go @@ -25,7 +25,7 @@ type Cluster struct { Display string `json:"display"` Name string `json:"name"` Description *string `json:"description,omitempty"` - VirtualmachineCount int64 `json:"virtualmachine_count"` + VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -35,13 +35,12 @@ type _Cluster Cluster // 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 NewCluster(id int32, url string, display string, name string, virtualmachineCount int64) *Cluster { +func NewCluster(id int32, url string, display string, name string) *Cluster { this := Cluster{} this.Id = id this.Url = url this.Display = display this.Name = name - this.VirtualmachineCount = virtualmachineCount return &this } @@ -181,28 +180,36 @@ func (o *Cluster) SetDescription(v string) { o.Description = &v } -// GetVirtualmachineCount returns the VirtualmachineCount field value +// GetVirtualmachineCount returns the VirtualmachineCount field value if set, zero value otherwise. func (o *Cluster) GetVirtualmachineCount() int64 { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { var ret int64 return ret } - - return o.VirtualmachineCount + return *o.VirtualmachineCount } -// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Cluster) GetVirtualmachineCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { return nil, false } - return &o.VirtualmachineCount, true + return o.VirtualmachineCount, true +} + +// HasVirtualmachineCount returns a boolean if a field has been set. +func (o *Cluster) HasVirtualmachineCount() bool { + if o != nil && !IsNil(o.VirtualmachineCount) { + return true + } + + return false } -// SetVirtualmachineCount sets field value +// SetVirtualmachineCount gets a reference to the given int64 and assigns it to the VirtualmachineCount field. func (o *Cluster) SetVirtualmachineCount(v int64) { - o.VirtualmachineCount = v + o.VirtualmachineCount = &v } func (o Cluster) MarshalJSON() ([]byte, error) { @@ -222,7 +229,9 @@ func (o Cluster) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["virtualmachine_count"] = o.VirtualmachineCount + if !IsNil(o.VirtualmachineCount) { + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -240,7 +249,6 @@ func (o *Cluster) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "virtualmachine_count", } allProperties := make(map[string]interface{}) diff --git a/model_device_role.go b/model_device_role.go index 1c2cf2a0c6..bcd70a8fe3 100644 --- a/model_device_role.go +++ b/model_device_role.go @@ -26,8 +26,8 @@ type DeviceRole struct { Name string `json:"name"` Slug string `json:"slug"` Description *string `json:"description,omitempty"` - DeviceCount int64 `json:"device_count"` - VirtualmachineCount int64 `json:"virtualmachine_count"` + DeviceCount *int64 `json:"device_count,omitempty"` + VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -37,15 +37,13 @@ type _DeviceRole DeviceRole // 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 NewDeviceRole(id int32, url string, display string, name string, slug string, deviceCount int64, virtualmachineCount int64) *DeviceRole { +func NewDeviceRole(id int32, url string, display string, name string, slug string) *DeviceRole { this := DeviceRole{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.DeviceCount = deviceCount - this.VirtualmachineCount = virtualmachineCount return &this } @@ -209,52 +207,68 @@ func (o *DeviceRole) SetDescription(v string) { o.Description = &v } -// GetDeviceCount returns the DeviceCount field value +// GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *DeviceRole) GetDeviceCount() int64 { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { var ret int64 return ret } - - return o.DeviceCount + return *o.DeviceCount } -// GetDeviceCountOk returns a tuple with the DeviceCount field value +// GetDeviceCountOk returns a tuple with the DeviceCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DeviceRole) GetDeviceCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { return nil, false } - return &o.DeviceCount, true + return o.DeviceCount, true +} + +// HasDeviceCount returns a boolean if a field has been set. +func (o *DeviceRole) HasDeviceCount() bool { + if o != nil && !IsNil(o.DeviceCount) { + return true + } + + return false } -// SetDeviceCount sets field value +// SetDeviceCount gets a reference to the given int64 and assigns it to the DeviceCount field. func (o *DeviceRole) SetDeviceCount(v int64) { - o.DeviceCount = v + o.DeviceCount = &v } -// GetVirtualmachineCount returns the VirtualmachineCount field value +// GetVirtualmachineCount returns the VirtualmachineCount field value if set, zero value otherwise. func (o *DeviceRole) GetVirtualmachineCount() int64 { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { var ret int64 return ret } - - return o.VirtualmachineCount + return *o.VirtualmachineCount } -// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DeviceRole) GetVirtualmachineCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { return nil, false } - return &o.VirtualmachineCount, true + return o.VirtualmachineCount, true +} + +// HasVirtualmachineCount returns a boolean if a field has been set. +func (o *DeviceRole) HasVirtualmachineCount() bool { + if o != nil && !IsNil(o.VirtualmachineCount) { + return true + } + + return false } -// SetVirtualmachineCount sets field value +// SetVirtualmachineCount gets a reference to the given int64 and assigns it to the VirtualmachineCount field. func (o *DeviceRole) SetVirtualmachineCount(v int64) { - o.VirtualmachineCount = v + o.VirtualmachineCount = &v } func (o DeviceRole) MarshalJSON() ([]byte, error) { @@ -275,8 +289,12 @@ func (o DeviceRole) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["device_count"] = o.DeviceCount - toSerialize["virtualmachine_count"] = o.VirtualmachineCount + if !IsNil(o.DeviceCount) { + toSerialize["device_count"] = o.DeviceCount + } + if !IsNil(o.VirtualmachineCount) { + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -295,8 +313,6 @@ func (o *DeviceRole) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "device_count", - "virtualmachine_count", } allProperties := make(map[string]interface{}) diff --git a/model_device_type.go b/model_device_type.go index 6b71ca2b42..491bcc1772 100644 --- a/model_device_type.go +++ b/model_device_type.go @@ -27,7 +27,7 @@ type DeviceType struct { Model string `json:"model"` Slug string `json:"slug"` Description *string `json:"description,omitempty"` - DeviceCount int64 `json:"device_count"` + DeviceCount *int64 `json:"device_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _DeviceType DeviceType // 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 NewDeviceType(id int32, url string, display string, manufacturer Manufacturer, model string, slug string, deviceCount int64) *DeviceType { +func NewDeviceType(id int32, url string, display string, manufacturer Manufacturer, model string, slug string) *DeviceType { this := DeviceType{} this.Id = id this.Url = url @@ -45,7 +45,6 @@ func NewDeviceType(id int32, url string, display string, manufacturer Manufactur this.Manufacturer = manufacturer this.Model = model this.Slug = slug - this.DeviceCount = deviceCount return &this } @@ -233,28 +232,36 @@ func (o *DeviceType) SetDescription(v string) { o.Description = &v } -// GetDeviceCount returns the DeviceCount field value +// GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *DeviceType) GetDeviceCount() int64 { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { var ret int64 return ret } - - return o.DeviceCount + return *o.DeviceCount } -// GetDeviceCountOk returns a tuple with the DeviceCount field value +// GetDeviceCountOk returns a tuple with the DeviceCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DeviceType) GetDeviceCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { return nil, false } - return &o.DeviceCount, true + return o.DeviceCount, true +} + +// HasDeviceCount returns a boolean if a field has been set. +func (o *DeviceType) HasDeviceCount() bool { + if o != nil && !IsNil(o.DeviceCount) { + return true + } + + return false } -// SetDeviceCount sets field value +// SetDeviceCount gets a reference to the given int64 and assigns it to the DeviceCount field. func (o *DeviceType) SetDeviceCount(v int64) { - o.DeviceCount = v + o.DeviceCount = &v } func (o DeviceType) MarshalJSON() ([]byte, error) { @@ -276,7 +283,9 @@ func (o DeviceType) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["device_count"] = o.DeviceCount + if !IsNil(o.DeviceCount) { + toSerialize["device_count"] = o.DeviceCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -296,7 +305,6 @@ func (o *DeviceType) UnmarshalJSON(data []byte) (err error) { "manufacturer", "model", "slug", - "device_count", } allProperties := make(map[string]interface{}) diff --git a/model_manufacturer.go b/model_manufacturer.go index 6b8dcd9090..5be331410c 100644 --- a/model_manufacturer.go +++ b/model_manufacturer.go @@ -26,7 +26,7 @@ type Manufacturer struct { Name string `json:"name"` Slug string `json:"slug"` Description *string `json:"description,omitempty"` - DevicetypeCount int64 `json:"devicetype_count"` + DevicetypeCount *int64 `json:"devicetype_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -36,14 +36,13 @@ type _Manufacturer Manufacturer // 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 NewManufacturer(id int32, url string, display string, name string, slug string, devicetypeCount int64) *Manufacturer { +func NewManufacturer(id int32, url string, display string, name string, slug string) *Manufacturer { this := Manufacturer{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.DevicetypeCount = devicetypeCount return &this } @@ -207,28 +206,36 @@ func (o *Manufacturer) SetDescription(v string) { o.Description = &v } -// GetDevicetypeCount returns the DevicetypeCount field value +// GetDevicetypeCount returns the DevicetypeCount field value if set, zero value otherwise. func (o *Manufacturer) GetDevicetypeCount() int64 { - if o == nil { + if o == nil || IsNil(o.DevicetypeCount) { var ret int64 return ret } - - return o.DevicetypeCount + return *o.DevicetypeCount } -// GetDevicetypeCountOk returns a tuple with the DevicetypeCount field value +// GetDevicetypeCountOk returns a tuple with the DevicetypeCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Manufacturer) GetDevicetypeCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.DevicetypeCount) { return nil, false } - return &o.DevicetypeCount, true + return o.DevicetypeCount, true +} + +// HasDevicetypeCount returns a boolean if a field has been set. +func (o *Manufacturer) HasDevicetypeCount() bool { + if o != nil && !IsNil(o.DevicetypeCount) { + return true + } + + return false } -// SetDevicetypeCount sets field value +// SetDevicetypeCount gets a reference to the given int64 and assigns it to the DevicetypeCount field. func (o *Manufacturer) SetDevicetypeCount(v int64) { - o.DevicetypeCount = v + o.DevicetypeCount = &v } func (o Manufacturer) MarshalJSON() ([]byte, error) { @@ -249,7 +256,9 @@ func (o Manufacturer) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["devicetype_count"] = o.DevicetypeCount + if !IsNil(o.DevicetypeCount) { + toSerialize["devicetype_count"] = o.DevicetypeCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -268,7 +277,6 @@ func (o *Manufacturer) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "devicetype_count", } allProperties := make(map[string]interface{}) diff --git a/model_platform.go b/model_platform.go index 5ab96ce266..95143bd8e3 100644 --- a/model_platform.go +++ b/model_platform.go @@ -26,8 +26,8 @@ type Platform struct { Name string `json:"name"` Slug string `json:"slug"` Description *string `json:"description,omitempty"` - DeviceCount int64 `json:"device_count"` - VirtualmachineCount int64 `json:"virtualmachine_count"` + DeviceCount *int64 `json:"device_count,omitempty"` + VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -37,15 +37,13 @@ type _Platform Platform // 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 NewPlatform(id int32, url string, display string, name string, slug string, deviceCount int64, virtualmachineCount int64) *Platform { +func NewPlatform(id int32, url string, display string, name string, slug string) *Platform { this := Platform{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.DeviceCount = deviceCount - this.VirtualmachineCount = virtualmachineCount return &this } @@ -209,52 +207,68 @@ func (o *Platform) SetDescription(v string) { o.Description = &v } -// GetDeviceCount returns the DeviceCount field value +// GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *Platform) GetDeviceCount() int64 { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { var ret int64 return ret } - - return o.DeviceCount + return *o.DeviceCount } -// GetDeviceCountOk returns a tuple with the DeviceCount field value +// GetDeviceCountOk returns a tuple with the DeviceCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Platform) GetDeviceCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { return nil, false } - return &o.DeviceCount, true + return o.DeviceCount, true +} + +// HasDeviceCount returns a boolean if a field has been set. +func (o *Platform) HasDeviceCount() bool { + if o != nil && !IsNil(o.DeviceCount) { + return true + } + + return false } -// SetDeviceCount sets field value +// SetDeviceCount gets a reference to the given int64 and assigns it to the DeviceCount field. func (o *Platform) SetDeviceCount(v int64) { - o.DeviceCount = v + o.DeviceCount = &v } -// GetVirtualmachineCount returns the VirtualmachineCount field value +// GetVirtualmachineCount returns the VirtualmachineCount field value if set, zero value otherwise. func (o *Platform) GetVirtualmachineCount() int64 { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { var ret int64 return ret } - - return o.VirtualmachineCount + return *o.VirtualmachineCount } -// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Platform) GetVirtualmachineCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.VirtualmachineCount) { return nil, false } - return &o.VirtualmachineCount, true + return o.VirtualmachineCount, true +} + +// HasVirtualmachineCount returns a boolean if a field has been set. +func (o *Platform) HasVirtualmachineCount() bool { + if o != nil && !IsNil(o.VirtualmachineCount) { + return true + } + + return false } -// SetVirtualmachineCount sets field value +// SetVirtualmachineCount gets a reference to the given int64 and assigns it to the VirtualmachineCount field. func (o *Platform) SetVirtualmachineCount(v int64) { - o.VirtualmachineCount = v + o.VirtualmachineCount = &v } func (o Platform) MarshalJSON() ([]byte, error) { @@ -275,8 +289,12 @@ func (o Platform) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["device_count"] = o.DeviceCount - toSerialize["virtualmachine_count"] = o.VirtualmachineCount + if !IsNil(o.DeviceCount) { + toSerialize["device_count"] = o.DeviceCount + } + if !IsNil(o.VirtualmachineCount) { + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -295,8 +313,6 @@ func (o *Platform) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "device_count", - "virtualmachine_count", } allProperties := make(map[string]interface{}) diff --git a/model_rack.go b/model_rack.go index 471e264e13..95c82770b0 100644 --- a/model_rack.go +++ b/model_rack.go @@ -25,7 +25,7 @@ type Rack struct { Display string `json:"display"` Name string `json:"name"` Description *string `json:"description,omitempty"` - DeviceCount int64 `json:"device_count"` + DeviceCount *int64 `json:"device_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -35,13 +35,12 @@ type _Rack Rack // 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 NewRack(id int32, url string, display string, name string, deviceCount int64) *Rack { +func NewRack(id int32, url string, display string, name string) *Rack { this := Rack{} this.Id = id this.Url = url this.Display = display this.Name = name - this.DeviceCount = deviceCount return &this } @@ -181,28 +180,36 @@ func (o *Rack) SetDescription(v string) { o.Description = &v } -// GetDeviceCount returns the DeviceCount field value +// GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *Rack) GetDeviceCount() int64 { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { var ret int64 return ret } - - return o.DeviceCount + return *o.DeviceCount } -// GetDeviceCountOk returns a tuple with the DeviceCount field value +// GetDeviceCountOk returns a tuple with the DeviceCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Rack) GetDeviceCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.DeviceCount) { return nil, false } - return &o.DeviceCount, true + return o.DeviceCount, true +} + +// HasDeviceCount returns a boolean if a field has been set. +func (o *Rack) HasDeviceCount() bool { + if o != nil && !IsNil(o.DeviceCount) { + return true + } + + return false } -// SetDeviceCount sets field value +// SetDeviceCount gets a reference to the given int64 and assigns it to the DeviceCount field. func (o *Rack) SetDeviceCount(v int64) { - o.DeviceCount = v + o.DeviceCount = &v } func (o Rack) MarshalJSON() ([]byte, error) { @@ -222,7 +229,9 @@ func (o Rack) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["device_count"] = o.DeviceCount + if !IsNil(o.DeviceCount) { + toSerialize["device_count"] = o.DeviceCount + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -240,7 +249,6 @@ func (o *Rack) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "device_count", } allProperties := make(map[string]interface{}) diff --git a/scripts/fix-spec.py b/scripts/fix-spec.py index fac390124a..e63690bef0 100755 --- a/scripts/fix-spec.py +++ b/scripts/fix-spec.py @@ -39,7 +39,16 @@ for ntype in non_nullable_types: if ntype in schema['properties']: if schema['properties'][ntype]['format'] == 'binary': - schema['properties'][ntype].pop('nullable') + schema['properties'][ntype].pop('nullable', None) + + if 'required' in schema: + non_required_props = [ + 'devicetype_count', + 'device_count', + 'virtualmachine_count', + ] + + schema['required'] = [prop for prop in schema['required'] if prop not in non_required_props] # Save the spec file with open(SPEC_PATH, 'w') as file: