api-v1 golang #1

Merged
quentin merged 8 commits from v0.9.x into main 2023-11-28 15:36:13 +00:00
9 changed files with 61 additions and 86 deletions
Showing only changes of commit 96f080c89e - Show all commits

View file

@ -885,6 +885,7 @@ components:
type: string type: string
capacity: capacity:
example: 4 example: 4
format: int64
nullable: true nullable: true
type: integer type: integer
tags: tags:
@ -914,6 +915,7 @@ components:
example: true example: true
type: boolean type: boolean
required: required:
- id
- remove - remove
type: object type: object
NodeRoleUpdate: NodeRoleUpdate:
@ -926,6 +928,7 @@ components:
type: string type: string
capacity: capacity:
example: 150000000000 example: 150000000000
format: int64
nullable: true nullable: true
type: integer type: integer
tags: tags:
@ -937,6 +940,7 @@ components:
type: array type: array
required: required:
- capacity - capacity
- id
- tags - tags
- zone - zone
type: object type: object

View file

@ -32,7 +32,7 @@ import (
) )
func main() { 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() configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration) apiClient := openapiclient.NewAPIClient(configuration)

View file

@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Zone** | **string** | | **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 | **Tags** | **[]string** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage |
## Methods ## Methods
@ -49,20 +49,20 @@ SetZone sets Zone field to given value.
### GetCapacity ### GetCapacity
`func (o *NodeClusterInfo) GetCapacity() int32` `func (o *NodeClusterInfo) GetCapacity() int64`
GetCapacity returns the Capacity field if non-nil, zero value otherwise. GetCapacity returns the Capacity field if non-nil, zero value otherwise.
### GetCapacityOk ### 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 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. and a boolean to check if the value has been set.
### SetCapacity ### SetCapacity
`func (o *NodeClusterInfo) SetCapacity(v int32)` `func (o *NodeClusterInfo) SetCapacity(v int64)`
SetCapacity sets Capacity field to given value. SetCapacity sets Capacity field to given value.

View file

@ -4,17 +4,17 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Id** | Pointer to **string** | | [optional] **Id** | **string** | |
**Remove** | **bool** | | **Remove** | **bool** | |
**Zone** | **string** | | **Zone** | **string** | |
**Capacity** | **NullableInt32** | | **Capacity** | **NullableInt64** | |
**Tags** | **[]string** | | **Tags** | **[]string** | |
## Methods ## Methods
### NewNodeRoleChange ### 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 NewNodeRoleChange instantiates a new NodeRoleChange object
This constructor will assign default values to properties that have it defined, 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. SetId sets Id field to given value.
### HasId
`func (o *NodeRoleChange) HasId() bool`
HasId returns a boolean if a field has been set.
### GetRemove ### GetRemove
@ -96,20 +91,20 @@ SetZone sets Zone field to given value.
### GetCapacity ### GetCapacity
`func (o *NodeRoleChange) GetCapacity() int32` `func (o *NodeRoleChange) GetCapacity() int64`
GetCapacity returns the Capacity field if non-nil, zero value otherwise. GetCapacity returns the Capacity field if non-nil, zero value otherwise.
### GetCapacityOk ### 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 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. and a boolean to check if the value has been set.
### SetCapacity ### SetCapacity
`func (o *NodeRoleChange) SetCapacity(v int32)` `func (o *NodeRoleChange) SetCapacity(v int64)`
SetCapacity sets Capacity field to given value. SetCapacity sets Capacity field to given value.

View file

@ -4,14 +4,14 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Id** | Pointer to **string** | | [optional] **Id** | **string** | |
**Remove** | **bool** | | **Remove** | **bool** | |
## Methods ## Methods
### NewNodeRoleRemove ### NewNodeRoleRemove
`func NewNodeRoleRemove(remove bool, ) *NodeRoleRemove` `func NewNodeRoleRemove(id string, remove bool, ) *NodeRoleRemove`
NewNodeRoleRemove instantiates a new NodeRoleRemove object NewNodeRoleRemove instantiates a new NodeRoleRemove object
This constructor will assign default values to properties that have it defined, 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. SetId sets Id field to given value.
### HasId
`func (o *NodeRoleRemove) HasId() bool`
HasId returns a boolean if a field has been set.
### GetRemove ### GetRemove

View file

@ -4,16 +4,16 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Id** | Pointer to **string** | | [optional] **Id** | **string** | |
**Zone** | **string** | | **Zone** | **string** | |
**Capacity** | **NullableInt32** | | **Capacity** | **NullableInt64** | |
**Tags** | **[]string** | | **Tags** | **[]string** | |
## Methods ## Methods
### NewNodeRoleUpdate ### 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 NewNodeRoleUpdate instantiates a new NodeRoleUpdate object
This constructor will assign default values to properties that have it defined, 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. SetId sets Id field to given value.
### HasId
`func (o *NodeRoleUpdate) HasId() bool`
HasId returns a boolean if a field has been set.
### GetZone ### GetZone
@ -75,20 +70,20 @@ SetZone sets Zone field to given value.
### GetCapacity ### GetCapacity
`func (o *NodeRoleUpdate) GetCapacity() int32` `func (o *NodeRoleUpdate) GetCapacity() int64`
GetCapacity returns the Capacity field if non-nil, zero value otherwise. GetCapacity returns the Capacity field if non-nil, zero value otherwise.
### GetCapacityOk ### 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 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. and a boolean to check if the value has been set.
### SetCapacity ### SetCapacity
`func (o *NodeRoleUpdate) SetCapacity(v int32)` `func (o *NodeRoleUpdate) SetCapacity(v int64)`
SetCapacity sets Capacity field to given value. SetCapacity sets Capacity field to given value.

View file

@ -17,7 +17,7 @@ import (
// NodeClusterInfo struct for NodeClusterInfo // NodeClusterInfo struct for NodeClusterInfo
type NodeClusterInfo struct { type NodeClusterInfo struct {
Zone string `json:"zone"` 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 // User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage
Tags []string `json:"tags"` 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). // 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 { if o == nil || o.Capacity.Get() == nil {
var ret int32 var ret int64
return ret return ret
} }
return *o.Capacity.Get() 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 // GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise
// and a boolean to check if the value has been set. // and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned // 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 { if o == nil {
return nil, false return nil, false
} }
@ -93,8 +93,8 @@ func (o *NodeClusterInfo) HasCapacity() bool {
return false return false
} }
// SetCapacity gets a reference to the given NullableInt32 and assigns it to the Capacity field. // SetCapacity gets a reference to the given NullableInt64 and assigns it to the Capacity field.
func (o *NodeClusterInfo) SetCapacity(v int32) { func (o *NodeClusterInfo) SetCapacity(v int64) {
o.Capacity.Set(&v) o.Capacity.Set(&v)
} }
// SetCapacityNil sets the value for Capacity to be an explicit nil // SetCapacityNil sets the value for Capacity to be an explicit nil

View file

@ -16,7 +16,7 @@ import (
// NodeRoleRemove struct for NodeRoleRemove // NodeRoleRemove struct for NodeRoleRemove
type NodeRoleRemove struct { type NodeRoleRemove struct {
Id *string `json:"id,omitempty"` Id string `json:"id"`
Remove bool `json:"remove"` Remove bool `json:"remove"`
} }
@ -24,8 +24,9 @@ type NodeRoleRemove struct {
// This constructor will assign default values to properties that have it defined, // 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 // and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed // 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 := NodeRoleRemove{}
this.Id = id
this.Remove = remove this.Remove = remove
return &this return &this
} }
@ -38,36 +39,28 @@ func NewNodeRoleRemoveWithDefaults() *NodeRoleRemove {
return &this return &this
} }
// GetId returns the Id field value if set, zero value otherwise. // GetId returns the Id field value
func (o *NodeRoleRemove) GetId() string { func (o *NodeRoleRemove) GetId() string {
if o == nil || o.Id == nil { if o == nil {
var ret string var ret string
return ret 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. // and a boolean to check if the value has been set.
func (o *NodeRoleRemove) GetIdOk() (*string, bool) { func (o *NodeRoleRemove) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil { if o == nil {
return nil, false return nil, false
} }
return o.Id, true return &o.Id, true
} }
// HasId returns a boolean if a field has been set. // SetId sets field value
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.
func (o *NodeRoleRemove) SetId(v string) { func (o *NodeRoleRemove) SetId(v string) {
o.Id = &v o.Id = v
} }
// GetRemove returns the Remove field value // GetRemove returns the Remove field value
@ -96,7 +89,7 @@ func (o *NodeRoleRemove) SetRemove(v bool) {
func (o NodeRoleRemove) MarshalJSON() ([]byte, error) { func (o NodeRoleRemove) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{} toSerialize := map[string]interface{}{}
if o.Id != nil { if true {
toSerialize["id"] = o.Id toSerialize["id"] = o.Id
} }
if true { if true {

View file

@ -16,9 +16,9 @@ import (
// NodeRoleUpdate struct for NodeRoleUpdate // NodeRoleUpdate struct for NodeRoleUpdate
type NodeRoleUpdate struct { type NodeRoleUpdate struct {
Id *string `json:"id,omitempty"` Id string `json:"id"`
Zone string `json:"zone"` Zone string `json:"zone"`
Capacity NullableInt32 `json:"capacity"` Capacity NullableInt64 `json:"capacity"`
Tags []string `json:"tags"` Tags []string `json:"tags"`
} }
@ -26,8 +26,9 @@ type NodeRoleUpdate struct {
// This constructor will assign default values to properties that have it defined, // 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 // and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed // 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 := NodeRoleUpdate{}
this.Id = id
this.Zone = zone this.Zone = zone
this.Capacity = capacity this.Capacity = capacity
this.Tags = tags this.Tags = tags
@ -42,36 +43,28 @@ func NewNodeRoleUpdateWithDefaults() *NodeRoleUpdate {
return &this return &this
} }
// GetId returns the Id field value if set, zero value otherwise. // GetId returns the Id field value
func (o *NodeRoleUpdate) GetId() string { func (o *NodeRoleUpdate) GetId() string {
if o == nil || o.Id == nil { if o == nil {
var ret string var ret string
return ret 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. // and a boolean to check if the value has been set.
func (o *NodeRoleUpdate) GetIdOk() (*string, bool) { func (o *NodeRoleUpdate) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil { if o == nil {
return nil, false return nil, false
} }
return o.Id, true return &o.Id, true
} }
// HasId returns a boolean if a field has been set. // SetId sets field value
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.
func (o *NodeRoleUpdate) SetId(v string) { func (o *NodeRoleUpdate) SetId(v string) {
o.Id = &v o.Id = v
} }
// GetZone returns the Zone field value // GetZone returns the Zone field value
@ -99,10 +92,10 @@ func (o *NodeRoleUpdate) SetZone(v string) {
} }
// GetCapacity returns the Capacity field value // GetCapacity returns the Capacity field value
// If the value is explicit nil, the zero value for int32 will be returned // If the value is explicit nil, the zero value for int64 will be returned
func (o *NodeRoleUpdate) GetCapacity() int32 { func (o *NodeRoleUpdate) GetCapacity() int64 {
if o == nil || o.Capacity.Get() == nil { if o == nil || o.Capacity.Get() == nil {
var ret int32 var ret int64
return ret return ret
} }
@ -112,7 +105,7 @@ func (o *NodeRoleUpdate) GetCapacity() int32 {
// GetCapacityOk returns a tuple with the Capacity field value // GetCapacityOk returns a tuple with the Capacity field value
// and a boolean to check if the value has been set. // and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned // 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 { if o == nil {
return nil, false return nil, false
} }
@ -120,7 +113,7 @@ func (o *NodeRoleUpdate) GetCapacityOk() (*int32, bool) {
} }
// SetCapacity sets field value // SetCapacity sets field value
func (o *NodeRoleUpdate) SetCapacity(v int32) { func (o *NodeRoleUpdate) SetCapacity(v int64) {
o.Capacity.Set(&v) o.Capacity.Set(&v)
} }
@ -150,7 +143,7 @@ func (o *NodeRoleUpdate) SetTags(v []string) {
func (o NodeRoleUpdate) MarshalJSON() ([]byte, error) { func (o NodeRoleUpdate) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{} toSerialize := map[string]interface{}{}
if o.Id != nil { if true {
toSerialize["id"] = o.Id toSerialize["id"] = o.Id
} }
if true { if true {