From 6c44fdd6023fb9b7dcba99fb662eed92a75a0a02 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 21 Nov 2024 13:07:00 +0000 Subject: [PATCH] Generate serverupdate --- services/serverupdate/api_default.go | 48 +++++++++---------- .../model_create_update_schedule_payload.go | 30 +++++++----- .../serverupdate/model_update_schedule.go | 30 +++++++----- .../model_update_update_schedule_payload.go | 30 +++++++----- 4 files changed, 81 insertions(+), 57 deletions(-) diff --git a/services/serverupdate/api_default.go b/services/serverupdate/api_default.go index d2f9a3587..d7962e9fd 100644 --- a/services/serverupdate/api_default.go +++ b/services/serverupdate/api_default.go @@ -141,8 +141,8 @@ func (r ApiCreateUpdateRequest) Execute() (*Update, error) { CreateUpdate: create update @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiCreateUpdateRequest */ func (a *APIClient) CreateUpdate(ctx context.Context, projectId string, serverId string) ApiCreateUpdateRequest { @@ -280,8 +280,8 @@ func (r ApiCreateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { CreateUpdateSchedule: create update schedule @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiCreateUpdateScheduleRequest */ func (a *APIClient) CreateUpdateSchedule(ctx context.Context, projectId string, serverId string) ApiCreateUpdateScheduleRequest { @@ -402,8 +402,8 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { DeleteUpdateSchedule: delete update schedule @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @param scheduleId update schedule id @return ApiDeleteUpdateScheduleRequest */ @@ -525,8 +525,8 @@ func (r ApiDisableServiceRequest) Execute() error { DisableService: disable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiDisableServiceRequest */ func (a *APIClient) DisableService(ctx context.Context, projectId string, serverId string) ApiDisableServiceRequest { @@ -648,8 +648,8 @@ func (r ApiDisableServiceResourceRequest) Execute() error { DisableServiceResource: disable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiDisableServiceResourceRequest */ func (a *APIClient) DisableServiceResource(ctx context.Context, projectId string, serverId string) ApiDisableServiceResourceRequest { @@ -776,8 +776,8 @@ func (r ApiEnableServiceRequest) Execute() error { EnableService: enable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiEnableServiceRequest */ func (a *APIClient) EnableService(ctx context.Context, projectId string, serverId string) ApiEnableServiceRequest { @@ -907,8 +907,8 @@ func (r ApiEnableServiceResourceRequest) Execute() error { EnableServiceResource: enable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiEnableServiceResourceRequest */ func (a *APIClient) EnableServiceResource(ctx context.Context, projectId string, serverId string) ApiEnableServiceResourceRequest { @@ -1040,8 +1040,8 @@ func (r ApiGetUpdateRequest) Execute() (*Update, error) { GetUpdate: get update @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @param updateId id of the update @return ApiGetUpdateRequest */ @@ -1176,8 +1176,8 @@ func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { GetUpdateSchedule: get single update schedule details @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @param scheduleId update schedule id @return ApiGetUpdateScheduleRequest */ @@ -1310,8 +1310,8 @@ func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, e ListUpdateSchedules: get list of update schedules @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiListUpdateSchedulesRequest */ func (a *APIClient) ListUpdateSchedules(ctx context.Context, projectId string, serverId string) ApiListUpdateSchedulesRequest { @@ -1441,8 +1441,8 @@ func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { ListUpdates: get list of updates @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @return ApiListUpdatesRequest */ func (a *APIClient) ListUpdates(ctx context.Context, projectId string, serverId string) ApiListUpdatesRequest { @@ -1582,8 +1582,8 @@ func (r ApiUpdateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { UpdateUpdateSchedule: update update schedule @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId portal project id - @param serverId openstack server id + @param projectId project id + @param serverId server id @param scheduleId update schedule id @return ApiUpdateUpdateScheduleRequest */ diff --git a/services/serverupdate/model_create_update_schedule_payload.go b/services/serverupdate/model_create_update_schedule_payload.go index 18162c7f0..ddf8afec8 100644 --- a/services/serverupdate/model_create_update_schedule_payload.go +++ b/services/serverupdate/model_create_update_schedule_payload.go @@ -22,8 +22,7 @@ type CreateUpdateSchedulePayload struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - // REQUIRED - Id *int64 `json:"id"` + Id *int64 `json:"id,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` @@ -39,10 +38,9 @@ type _CreateUpdateSchedulePayload CreateUpdateSchedulePayload // 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 NewCreateUpdateSchedulePayload(enabled *bool, id *int64, maintenanceWindow *int64, name *string, rrule *string) *CreateUpdateSchedulePayload { +func NewCreateUpdateSchedulePayload(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *CreateUpdateSchedulePayload { this := CreateUpdateSchedulePayload{} this.Enabled = enabled - this.Id = id this.MaintenanceWindow = maintenanceWindow this.Name = name this.Rrule = rrule @@ -81,26 +79,34 @@ func (o *CreateUpdateSchedulePayload) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value +// GetId returns the Id field value if set, zero value otherwise. func (o *CreateUpdateSchedulePayload) GetId() *int64 { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *int64 return ret } - return o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateUpdateSchedulePayload) GetIdOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true } -// SetId sets field value +// HasId returns a boolean if a field has been set. +func (o *CreateUpdateSchedulePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. func (o *CreateUpdateSchedulePayload) SetId(v *int64) { o.Id = v } @@ -180,7 +186,9 @@ func (o *CreateUpdateSchedulePayload) SetRrule(v *string) { func (o CreateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - toSerialize["id"] = o.Id + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule diff --git a/services/serverupdate/model_update_schedule.go b/services/serverupdate/model_update_schedule.go index 8ee0e6fe7..e279dfcb6 100644 --- a/services/serverupdate/model_update_schedule.go +++ b/services/serverupdate/model_update_schedule.go @@ -22,8 +22,7 @@ type UpdateSchedule struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - // REQUIRED - Id *int64 `json:"id"` + Id *int64 `json:"id,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` @@ -39,10 +38,9 @@ type _UpdateSchedule UpdateSchedule // 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 NewUpdateSchedule(enabled *bool, id *int64, maintenanceWindow *int64, name *string, rrule *string) *UpdateSchedule { +func NewUpdateSchedule(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateSchedule { this := UpdateSchedule{} this.Enabled = enabled - this.Id = id this.MaintenanceWindow = maintenanceWindow this.Name = name this.Rrule = rrule @@ -81,26 +79,34 @@ func (o *UpdateSchedule) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value +// GetId returns the Id field value if set, zero value otherwise. func (o *UpdateSchedule) GetId() *int64 { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *int64 return ret } - return o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateSchedule) GetIdOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true } -// SetId sets field value +// HasId returns a boolean if a field has been set. +func (o *UpdateSchedule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. func (o *UpdateSchedule) SetId(v *int64) { o.Id = v } @@ -180,7 +186,9 @@ func (o *UpdateSchedule) SetRrule(v *string) { func (o UpdateSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - toSerialize["id"] = o.Id + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule diff --git a/services/serverupdate/model_update_update_schedule_payload.go b/services/serverupdate/model_update_update_schedule_payload.go index 20d2c6cb8..0d823cdc7 100644 --- a/services/serverupdate/model_update_update_schedule_payload.go +++ b/services/serverupdate/model_update_update_schedule_payload.go @@ -22,8 +22,7 @@ type UpdateUpdateSchedulePayload struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - // REQUIRED - Id *int64 `json:"id"` + Id *int64 `json:"id,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` @@ -39,10 +38,9 @@ type _UpdateUpdateSchedulePayload UpdateUpdateSchedulePayload // 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 NewUpdateUpdateSchedulePayload(enabled *bool, id *int64, maintenanceWindow *int64, name *string, rrule *string) *UpdateUpdateSchedulePayload { +func NewUpdateUpdateSchedulePayload(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateUpdateSchedulePayload { this := UpdateUpdateSchedulePayload{} this.Enabled = enabled - this.Id = id this.MaintenanceWindow = maintenanceWindow this.Name = name this.Rrule = rrule @@ -81,26 +79,34 @@ func (o *UpdateUpdateSchedulePayload) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value +// GetId returns the Id field value if set, zero value otherwise. func (o *UpdateUpdateSchedulePayload) GetId() *int64 { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *int64 return ret } - return o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateUpdateSchedulePayload) GetIdOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true } -// SetId sets field value +// HasId returns a boolean if a field has been set. +func (o *UpdateUpdateSchedulePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. func (o *UpdateUpdateSchedulePayload) SetId(v *int64) { o.Id = v } @@ -180,7 +186,9 @@ func (o *UpdateUpdateSchedulePayload) SetRrule(v *string) { func (o UpdateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - toSerialize["id"] = o.Id + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule