From 96f080c89ec442a6b480fff1158720a36453ff0a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 23 Nov 2023 10:04:11 +0100 Subject: [PATCH] switch capacity to int64 --- api/openapi.yaml | 4 ++++ docs/LayoutApi.md | 2 +- docs/NodeClusterInfo.md | 8 +++---- docs/NodeRoleChange.md | 17 +++++--------- docs/NodeRoleRemove.md | 9 ++------ docs/NodeRoleUpdate.md | 17 +++++--------- model_node_cluster_info.go | 12 +++++----- model_node_role_remove.go | 33 +++++++++++----------------- model_node_role_update.go | 45 ++++++++++++++++---------------------- 9 files changed, 61 insertions(+), 86 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index dc71e8c..aab8146 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -885,6 +885,7 @@ components: type: string capacity: example: 4 + format: int64 nullable: true type: integer tags: @@ -914,6 +915,7 @@ components: example: true type: boolean required: + - id - remove type: object NodeRoleUpdate: @@ -926,6 +928,7 @@ components: type: string capacity: example: 150000000000 + format: int64 nullable: true type: integer tags: @@ -937,6 +940,7 @@ components: type: array required: - capacity + - id - tags - zone type: object diff --git a/docs/LayoutApi.md b/docs/LayoutApi.md index 3e7f13d..d396c58 100644 --- a/docs/LayoutApi.md +++ b/docs/LayoutApi.md @@ -32,7 +32,7 @@ import ( ) func main() { - nodeRoleChange := []openapiclient.NodeRoleChange{openapiclient.NodeRoleChange{NodeRoleRemove: openapiclient.NewNodeRoleRemove(true)}} // []NodeRoleChange | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (`zone`, `capacity`, and `tags`). To remove a node, simply pass the `remove: true` field. This logic is represented in OpenAPI with a \"One Of\" object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. + nodeRoleChange := []openapiclient.NodeRoleChange{openapiclient.NodeRoleChange{NodeRoleRemove: openapiclient.NewNodeRoleRemove("6a8e08af2aab1083ebab9b22165ea8b5b9d333b60a39ecd504e85cc1f432c36f", true)}} // []NodeRoleChange | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (`zone`, `capacity`, and `tags`). To remove a node, simply pass the `remove: true` field. This logic is represented in OpenAPI with a \"One Of\" object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/docs/NodeClusterInfo.md b/docs/NodeClusterInfo.md index 1a3b537..aa0aeef 100644 --- a/docs/NodeClusterInfo.md +++ b/docs/NodeClusterInfo.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Zone** | **string** | | -**Capacity** | Pointer to **NullableInt32** | | [optional] +**Capacity** | Pointer to **NullableInt64** | | [optional] **Tags** | **[]string** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage | ## Methods @@ -49,20 +49,20 @@ SetZone sets Zone field to given value. ### GetCapacity -`func (o *NodeClusterInfo) GetCapacity() int32` +`func (o *NodeClusterInfo) GetCapacity() int64` GetCapacity returns the Capacity field if non-nil, zero value otherwise. ### GetCapacityOk -`func (o *NodeClusterInfo) GetCapacityOk() (*int32, bool)` +`func (o *NodeClusterInfo) GetCapacityOk() (*int64, bool)` GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCapacity -`func (o *NodeClusterInfo) SetCapacity(v int32)` +`func (o *NodeClusterInfo) SetCapacity(v int64)` SetCapacity sets Capacity field to given value. diff --git a/docs/NodeRoleChange.md b/docs/NodeRoleChange.md index 5c6322f..8d66e69 100644 --- a/docs/NodeRoleChange.md +++ b/docs/NodeRoleChange.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] +**Id** | **string** | | **Remove** | **bool** | | **Zone** | **string** | | -**Capacity** | **NullableInt32** | | +**Capacity** | **NullableInt64** | | **Tags** | **[]string** | | ## Methods ### NewNodeRoleChange -`func NewNodeRoleChange(remove bool, zone string, capacity NullableInt32, tags []string, ) *NodeRoleChange` +`func NewNodeRoleChange(id string, remove bool, zone string, capacity NullableInt64, tags []string, ) *NodeRoleChange` NewNodeRoleChange instantiates a new NodeRoleChange object This constructor will assign default values to properties that have it defined, @@ -48,11 +48,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *NodeRoleChange) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetRemove @@ -96,20 +91,20 @@ SetZone sets Zone field to given value. ### GetCapacity -`func (o *NodeRoleChange) GetCapacity() int32` +`func (o *NodeRoleChange) GetCapacity() int64` GetCapacity returns the Capacity field if non-nil, zero value otherwise. ### GetCapacityOk -`func (o *NodeRoleChange) GetCapacityOk() (*int32, bool)` +`func (o *NodeRoleChange) GetCapacityOk() (*int64, bool)` GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCapacity -`func (o *NodeRoleChange) SetCapacity(v int32)` +`func (o *NodeRoleChange) SetCapacity(v int64)` SetCapacity sets Capacity field to given value. diff --git a/docs/NodeRoleRemove.md b/docs/NodeRoleRemove.md index 423b69c..878770c 100644 --- a/docs/NodeRoleRemove.md +++ b/docs/NodeRoleRemove.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] +**Id** | **string** | | **Remove** | **bool** | | ## Methods ### NewNodeRoleRemove -`func NewNodeRoleRemove(remove bool, ) *NodeRoleRemove` +`func NewNodeRoleRemove(id string, remove bool, ) *NodeRoleRemove` NewNodeRoleRemove instantiates a new NodeRoleRemove object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *NodeRoleRemove) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetRemove diff --git a/docs/NodeRoleUpdate.md b/docs/NodeRoleUpdate.md index 9e73fa1..df62a68 100644 --- a/docs/NodeRoleUpdate.md +++ b/docs/NodeRoleUpdate.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] +**Id** | **string** | | **Zone** | **string** | | -**Capacity** | **NullableInt32** | | +**Capacity** | **NullableInt64** | | **Tags** | **[]string** | | ## Methods ### NewNodeRoleUpdate -`func NewNodeRoleUpdate(zone string, capacity NullableInt32, tags []string, ) *NodeRoleUpdate` +`func NewNodeRoleUpdate(id string, zone string, capacity NullableInt64, tags []string, ) *NodeRoleUpdate` NewNodeRoleUpdate instantiates a new NodeRoleUpdate object This constructor will assign default values to properties that have it defined, @@ -47,11 +47,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *NodeRoleUpdate) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetZone @@ -75,20 +70,20 @@ SetZone sets Zone field to given value. ### GetCapacity -`func (o *NodeRoleUpdate) GetCapacity() int32` +`func (o *NodeRoleUpdate) GetCapacity() int64` GetCapacity returns the Capacity field if non-nil, zero value otherwise. ### GetCapacityOk -`func (o *NodeRoleUpdate) GetCapacityOk() (*int32, bool)` +`func (o *NodeRoleUpdate) GetCapacityOk() (*int64, bool)` GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCapacity -`func (o *NodeRoleUpdate) SetCapacity(v int32)` +`func (o *NodeRoleUpdate) SetCapacity(v int64)` SetCapacity sets Capacity field to given value. diff --git a/model_node_cluster_info.go b/model_node_cluster_info.go index ec7f288..fb72a68 100644 --- a/model_node_cluster_info.go +++ b/model_node_cluster_info.go @@ -17,7 +17,7 @@ import ( // NodeClusterInfo struct for NodeClusterInfo type NodeClusterInfo struct { Zone string `json:"zone"` - Capacity NullableInt32 `json:"capacity,omitempty"` + Capacity NullableInt64 `json:"capacity,omitempty"` // User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage Tags []string `json:"tags"` } @@ -66,9 +66,9 @@ func (o *NodeClusterInfo) SetZone(v string) { } // GetCapacity returns the Capacity field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NodeClusterInfo) GetCapacity() int32 { +func (o *NodeClusterInfo) GetCapacity() int64 { if o == nil || o.Capacity.Get() == nil { - var ret int32 + var ret int64 return ret } return *o.Capacity.Get() @@ -77,7 +77,7 @@ func (o *NodeClusterInfo) GetCapacity() int32 { // GetCapacityOk returns a tuple with the Capacity 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 *NodeClusterInfo) GetCapacityOk() (*int32, bool) { +func (o *NodeClusterInfo) GetCapacityOk() (*int64, bool) { if o == nil { return nil, false } @@ -93,8 +93,8 @@ func (o *NodeClusterInfo) HasCapacity() bool { return false } -// SetCapacity gets a reference to the given NullableInt32 and assigns it to the Capacity field. -func (o *NodeClusterInfo) SetCapacity(v int32) { +// SetCapacity gets a reference to the given NullableInt64 and assigns it to the Capacity field. +func (o *NodeClusterInfo) SetCapacity(v int64) { o.Capacity.Set(&v) } // SetCapacityNil sets the value for Capacity to be an explicit nil diff --git a/model_node_role_remove.go b/model_node_role_remove.go index d22bf24..127366b 100644 --- a/model_node_role_remove.go +++ b/model_node_role_remove.go @@ -16,7 +16,7 @@ import ( // NodeRoleRemove struct for NodeRoleRemove type NodeRoleRemove struct { - Id *string `json:"id,omitempty"` + Id string `json:"id"` Remove bool `json:"remove"` } @@ -24,8 +24,9 @@ type NodeRoleRemove struct { // 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 NewNodeRoleRemove(remove bool) *NodeRoleRemove { +func NewNodeRoleRemove(id string, remove bool) *NodeRoleRemove { this := NodeRoleRemove{} + this.Id = id this.Remove = remove return &this } @@ -38,36 +39,28 @@ func NewNodeRoleRemoveWithDefaults() *NodeRoleRemove { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *NodeRoleRemove) GetId() string { - if o == nil || o.Id == nil { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *NodeRoleRemove) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { + if o == nil { return nil, false } - return o.Id, true + return &o.Id, true } -// HasId returns a boolean if a field has been set. -func (o *NodeRoleRemove) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *NodeRoleRemove) SetId(v string) { - o.Id = &v + o.Id = v } // GetRemove returns the Remove field value @@ -96,7 +89,7 @@ func (o *NodeRoleRemove) SetRemove(v bool) { func (o NodeRoleRemove) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if true { toSerialize["id"] = o.Id } if true { diff --git a/model_node_role_update.go b/model_node_role_update.go index c6eb873..2fb3afe 100644 --- a/model_node_role_update.go +++ b/model_node_role_update.go @@ -16,9 +16,9 @@ import ( // NodeRoleUpdate struct for NodeRoleUpdate type NodeRoleUpdate struct { - Id *string `json:"id,omitempty"` + Id string `json:"id"` Zone string `json:"zone"` - Capacity NullableInt32 `json:"capacity"` + Capacity NullableInt64 `json:"capacity"` Tags []string `json:"tags"` } @@ -26,8 +26,9 @@ type NodeRoleUpdate struct { // 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 NewNodeRoleUpdate(zone string, capacity NullableInt32, tags []string) *NodeRoleUpdate { +func NewNodeRoleUpdate(id string, zone string, capacity NullableInt64, tags []string) *NodeRoleUpdate { this := NodeRoleUpdate{} + this.Id = id this.Zone = zone this.Capacity = capacity this.Tags = tags @@ -42,36 +43,28 @@ func NewNodeRoleUpdateWithDefaults() *NodeRoleUpdate { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *NodeRoleUpdate) GetId() string { - if o == nil || o.Id == nil { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *NodeRoleUpdate) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { + if o == nil { return nil, false } - return o.Id, true + return &o.Id, true } -// HasId returns a boolean if a field has been set. -func (o *NodeRoleUpdate) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *NodeRoleUpdate) SetId(v string) { - o.Id = &v + o.Id = v } // GetZone returns the Zone field value @@ -99,10 +92,10 @@ func (o *NodeRoleUpdate) SetZone(v string) { } // GetCapacity returns the Capacity field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *NodeRoleUpdate) GetCapacity() int32 { +// If the value is explicit nil, the zero value for int64 will be returned +func (o *NodeRoleUpdate) GetCapacity() int64 { if o == nil || o.Capacity.Get() == nil { - var ret int32 + var ret int64 return ret } @@ -112,7 +105,7 @@ func (o *NodeRoleUpdate) GetCapacity() int32 { // GetCapacityOk returns a tuple with the Capacity 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 *NodeRoleUpdate) GetCapacityOk() (*int32, bool) { +func (o *NodeRoleUpdate) GetCapacityOk() (*int64, bool) { if o == nil { return nil, false } @@ -120,7 +113,7 @@ func (o *NodeRoleUpdate) GetCapacityOk() (*int32, bool) { } // SetCapacity sets field value -func (o *NodeRoleUpdate) SetCapacity(v int32) { +func (o *NodeRoleUpdate) SetCapacity(v int64) { o.Capacity.Set(&v) } @@ -150,7 +143,7 @@ func (o *NodeRoleUpdate) SetTags(v []string) { func (o NodeRoleUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if true { toSerialize["id"] = o.Id } if true {