From 91d30abf3f1f9588c7fd1c7b449cf23891fe67b1 Mon Sep 17 00:00:00 2001 From: Leaseweb CI Date: Mon, 26 Aug 2024 09:10:31 +0000 Subject: [PATCH] SDK Update --- abuse/configuration.go | 2 +- dedicatedServer/api/openapi.yaml | 3 + dedicatedServer/configuration.go | 2 +- dedicatedServer/docs/ControlPanel.md | 16 +---- dedicatedServer/model_control_panel.go | 91 ++++++++++++++------------ invoice/configuration.go | 2 +- publicCloud/configuration.go | 2 +- 7 files changed, 58 insertions(+), 60 deletions(-) diff --git a/abuse/configuration.go b/abuse/configuration.go index ad43f68..672caef 100644 --- a/abuse/configuration.go +++ b/abuse/configuration.go @@ -92,7 +92,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "lsw-go-sdk/2024-08-20T11:32:00Z", + UserAgent: "lsw-go-sdk/2024-08-26T09:10:10Z", Debug: false, Servers: ServerConfigurations{ { diff --git a/dedicatedServer/api/openapi.yaml b/dedicatedServer/api/openapi.yaml index 196580d..fa920b1 100644 --- a/dedicatedServer/api/openapi.yaml +++ b/dedicatedServer/api/openapi.yaml @@ -11672,6 +11672,9 @@ components: name: description: A human readable name describing the control panel type: string + required: + - id + - name title: controlPanel type: object operatingSystem: diff --git a/dedicatedServer/configuration.go b/dedicatedServer/configuration.go index 4868817..6fcc95c 100644 --- a/dedicatedServer/configuration.go +++ b/dedicatedServer/configuration.go @@ -92,7 +92,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "lsw-go-sdk/2024-08-20T11:31:46Z", + UserAgent: "lsw-go-sdk/2024-08-26T09:09:39Z", Debug: false, Servers: ServerConfigurations{ { diff --git a/dedicatedServer/docs/ControlPanel.md b/dedicatedServer/docs/ControlPanel.md index f66177d..28edc03 100644 --- a/dedicatedServer/docs/ControlPanel.md +++ b/dedicatedServer/docs/ControlPanel.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | The unique ID of this control panel | [optional] -**Name** | Pointer to **string** | A human readable name describing the control panel | [optional] +**Id** | **string** | The unique ID of this control panel | +**Name** | **string** | A human readable name describing the control panel | ## Methods ### NewControlPanel -`func NewControlPanel() *ControlPanel` +`func NewControlPanel(id string, name string, ) *ControlPanel` NewControlPanel instantiates a new ControlPanel 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 *ControlPanel) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetName @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetName sets Name field to given value. -### HasName - -`func (o *ControlPanel) HasName() bool` - -HasName 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/dedicatedServer/model_control_panel.go b/dedicatedServer/model_control_panel.go index d79663c..980443e 100644 --- a/dedicatedServer/model_control_panel.go +++ b/dedicatedServer/model_control_panel.go @@ -12,6 +12,7 @@ package dedicatedServer import ( "encoding/json" + "fmt" ) // checks if the ControlPanel type satisfies the MappedNullable interface at compile time @@ -20,9 +21,9 @@ var _ MappedNullable = &ControlPanel{} // ControlPanel A single control panel type ControlPanel struct { // The unique ID of this control panel - Id *string `json:"id,omitempty"` + Id string `json:"id"` // A human readable name describing the control panel - Name *string `json:"name,omitempty"` + Name string `json:"name"` AdditionalProperties map[string]interface{} } @@ -32,8 +33,10 @@ type _ControlPanel ControlPanel // 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 NewControlPanel() *ControlPanel { +func NewControlPanel(id string, name string) *ControlPanel { this := ControlPanel{} + this.Id = id + this.Name = name return &this } @@ -45,68 +48,52 @@ func NewControlPanelWithDefaults() *ControlPanel { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *ControlPanel) GetId() string { - if o == nil || IsNil(o.Id) { + 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 *ControlPanel) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { + if o == nil { return nil, false } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ControlPanel) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + return &o.Id, true } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *ControlPanel) SetId(v string) { - o.Id = &v + o.Id = v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *ControlPanel) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ControlPanel) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + return &o.Name, true } -// HasName returns a boolean if a field has been set. -func (o *ControlPanel) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *ControlPanel) SetName(v string) { - o.Name = &v + o.Name = v } func (o ControlPanel) MarshalJSON() ([]byte, error) { @@ -119,12 +106,8 @@ func (o ControlPanel) MarshalJSON() ([]byte, error) { func (o ControlPanel) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -134,6 +117,28 @@ func (o ControlPanel) ToMap() (map[string]interface{}, error) { } func (o *ControlPanel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varControlPanel := _ControlPanel{} err = json.Unmarshal(data, &varControlPanel) diff --git a/invoice/configuration.go b/invoice/configuration.go index b97b141..0dfdfca 100644 --- a/invoice/configuration.go +++ b/invoice/configuration.go @@ -92,7 +92,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "lsw-go-sdk/2024-08-20T11:31:55Z", + UserAgent: "lsw-go-sdk/2024-08-26T09:10:01Z", Debug: false, Servers: ServerConfigurations{ { diff --git a/publicCloud/configuration.go b/publicCloud/configuration.go index f6cc5b6..0ba1fce 100644 --- a/publicCloud/configuration.go +++ b/publicCloud/configuration.go @@ -92,7 +92,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "lsw-go-sdk/2024-08-20T11:32:05Z", + UserAgent: "lsw-go-sdk/2024-08-26T09:10:18Z", Debug: false, Servers: ServerConfigurations{ {