From 6dad7660a936f556553dbc21477d3a867f0bb07a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 23 Nov 2023 10:17:56 +0100 Subject: [PATCH] rework api version --- api/openapi.yaml | 3 +++ docs/LayoutApi.md | 4 ++-- docs/LayoutVersion.md | 15 +++++---------- model_layout_version.go | 41 +++++++++++++++++------------------------ 4 files changed, 27 insertions(+), 36 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index aab8146..5c7b062 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1010,7 +1010,10 @@ components: properties: version: example: 13 + format: int64 type: integer + required: + - version type: object KeyInfo: example: diff --git a/docs/LayoutApi.md b/docs/LayoutApi.md index d396c58..a6d3a24 100644 --- a/docs/LayoutApi.md +++ b/docs/LayoutApi.md @@ -98,7 +98,7 @@ import ( ) func main() { - layoutVersion := *openapiclient.NewLayoutVersion() // LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. + layoutVersion := *openapiclient.NewLayoutVersion(int64(13)) // LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -225,7 +225,7 @@ import ( ) func main() { - layoutVersion := *openapiclient.NewLayoutVersion() // LayoutVersion | Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. + layoutVersion := *openapiclient.NewLayoutVersion(int64(13)) // LayoutVersion | Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/docs/LayoutVersion.md b/docs/LayoutVersion.md index 6175d85..f6792bf 100644 --- a/docs/LayoutVersion.md +++ b/docs/LayoutVersion.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Version** | Pointer to **int32** | | [optional] +**Version** | **int64** | | ## Methods ### NewLayoutVersion -`func NewLayoutVersion() *LayoutVersion` +`func NewLayoutVersion(version int64, ) *LayoutVersion` NewLayoutVersion instantiates a new LayoutVersion object This constructor will assign default values to properties that have it defined, @@ -27,28 +27,23 @@ but it doesn't guarantee that properties required by API are set ### GetVersion -`func (o *LayoutVersion) GetVersion() int32` +`func (o *LayoutVersion) GetVersion() int64` GetVersion returns the Version field if non-nil, zero value otherwise. ### GetVersionOk -`func (o *LayoutVersion) GetVersionOk() (*int32, bool)` +`func (o *LayoutVersion) GetVersionOk() (*int64, bool)` GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVersion -`func (o *LayoutVersion) SetVersion(v int32)` +`func (o *LayoutVersion) SetVersion(v int64)` SetVersion sets Version field to given value. -### HasVersion - -`func (o *LayoutVersion) HasVersion() bool` - -HasVersion 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_layout_version.go b/model_layout_version.go index 1703084..4003f53 100644 --- a/model_layout_version.go +++ b/model_layout_version.go @@ -16,15 +16,16 @@ import ( // LayoutVersion struct for LayoutVersion type LayoutVersion struct { - Version *int32 `json:"version,omitempty"` + Version int64 `json:"version"` } // NewLayoutVersion instantiates a new LayoutVersion 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 NewLayoutVersion() *LayoutVersion { +func NewLayoutVersion(version int64) *LayoutVersion { this := LayoutVersion{} + this.Version = version return &this } @@ -36,41 +37,33 @@ func NewLayoutVersionWithDefaults() *LayoutVersion { return &this } -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *LayoutVersion) GetVersion() int32 { - if o == nil || o.Version == nil { - var ret int32 +// GetVersion returns the Version field value +func (o *LayoutVersion) GetVersion() int64 { + if o == nil { + var ret int64 return ret } - return *o.Version + + return o.Version } -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *LayoutVersion) GetVersionOk() (*int32, bool) { - if o == nil || o.Version == nil { +func (o *LayoutVersion) GetVersionOk() (*int64, bool) { + if o == nil { return nil, false } - return o.Version, true + return &o.Version, true } -// HasVersion returns a boolean if a field has been set. -func (o *LayoutVersion) HasVersion() bool { - if o != nil && o.Version != nil { - return true - } - - return false -} - -// SetVersion gets a reference to the given int32 and assigns it to the Version field. -func (o *LayoutVersion) SetVersion(v int32) { - o.Version = &v +// SetVersion sets field value +func (o *LayoutVersion) SetVersion(v int64) { + o.Version = v } func (o LayoutVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Version != nil { + if true { toSerialize["version"] = o.Version } return json.Marshal(toSerialize)