From 8a552150699531ac94e1dd958514a3da66e418ea Mon Sep 17 00:00:00 2001 From: "shenwen.yin" Date: Mon, 17 Feb 2025 14:10:16 +0800 Subject: [PATCH] update to v2.19.0 schema --- RELEASE_NOTE.md | 33 + client/backup_plan/backup_plan_client.go | 40 + ...ackup_restore_point_metadata_parameters.go | 148 ++ ...backup_restore_point_metadata_responses.go | 217 +++ client/cloudtower_client.go | 5 + client/cluster/cluster_client.go | 40 + .../get_cluster_storage_info_parameters.go | 148 ++ .../get_cluster_storage_info_responses.go | 215 +++ client/ntp/get_ntp_service_url_parameters.go | 162 ++ client/ntp/get_ntp_service_url_responses.go | 217 +++ client/ntp/ntp_client.go | 79 + ...ce_alert_notification_config_parameters.go | 183 +++ ...ice_alert_notification_config_responses.go | 217 +++ client/observability/observability_client.go | 40 + models/allocatable_ec_storage_capacity.go | 105 ++ .../allocatable_replica_storage_capacity.go | 88 ++ models/allocatable_storage_capacity.go | 173 +++ models/backup_plan.go | 327 ++++ models/backup_plan_order_by_input.go | 56 +- models/backup_plan_phase.go | 90 ++ models/backup_plan_where_input.go | 1374 +++++++++++++++-- ...backup_restore_point_where_unique_input.go | 53 + models/cluster_storage_info.go | 264 ++++ models/cluster_storage_info_ec_config.go | 88 ++ models/content_library_vm_template.go | 511 ++++++ ...tent_library_vm_template_order_by_input.go | 98 +- ...content_library_vm_template_where_input.go | 1238 ++++++++++++++- models/error_body_stringer.go | 32 + ...kup_restore_point_metadata_request_body.go | 107 ++ models/get_cluster_storage_info_effect.go | 166 ++ .../get_cluster_storage_info_request_body.go | 155 ++ models/metric_unit.go | 5 +- models/mfa_type.go | 5 +- ...nested_content_library_vm_template_disk.go | 362 +++++ .../nested_content_library_vm_template_nic.go | 284 ++++ models/nested_frozen_vlan.go | 3 + models/nested_snapshot_info.go | 142 ++ models/nested_storage_policy_config.go | 53 + models/nested_template_config.go | 59 + models/nested_template_vpc_nic.go | 17 + ...sted_virtual_private_cloud_edge_gateway.go | 88 ++ .../nested_virtual_private_cloud_service.go | 84 +- ...rtual_private_cloud_service_tep_ip_pool.go | 139 ++ models/nested_zbs_storage_info.go | 134 ++ models/ntp_service_url.go | 71 + models/r_o_l_e_a_c_t_i_o_n.go | 23 +- models/replica_num.go | 42 + models/security_policy.go | 17 + models/security_policy_order_by_input.go | 8 +- models/security_policy_where_input.go | 6 + models/task_creation_params.go | 6 + models/task_update_params.go | 51 +- models/user_source.go | 5 +- models/virtual_private_cloud.go | 48 + .../virtual_private_cloud_cluster_binding.go | 48 + ...ivate_cloud_cluster_binding_where_input.go | 46 + ...te_cloud_edge_gateway_group_where_input.go | 978 ++++++++++++ ..._private_cloud_edge_gateway_where_input.go | 70 + .../virtual_private_cloud_external_subnet.go | 63 + ...cloud_external_subnet_group_where_input.go | 1132 ++++++++++++++ ...te_cloud_external_subnet_order_by_input.go | 8 +- ...ivate_cloud_external_subnet_where_input.go | 52 + models/virtual_private_cloud_floating_ip.go | 8 +- models/virtual_private_cloud_nat_gateway.go | 8 +- .../virtual_private_cloud_router_gateway.go | 8 +- ...rtual_private_cloud_service_where_input.go | 138 ++ models/virtual_private_cloud_where_input.go | 46 + models/vm.go | 57 + models/vm_disk_meta_data.go | 318 ++++ models/vm_ha_priority.go | 81 + models/vm_meta_data.go | 745 +++++++++ models/vm_nic_meta_data.go | 143 ++ models/vm_where_input.go | 138 ++ 73 files changed, 12214 insertions(+), 194 deletions(-) create mode 100644 client/backup_plan/get_backup_restore_point_metadata_parameters.go create mode 100644 client/backup_plan/get_backup_restore_point_metadata_responses.go create mode 100644 client/cluster/get_cluster_storage_info_parameters.go create mode 100644 client/cluster/get_cluster_storage_info_responses.go create mode 100644 client/ntp/get_ntp_service_url_parameters.go create mode 100644 client/ntp/get_ntp_service_url_responses.go create mode 100644 client/ntp/ntp_client.go create mode 100644 client/observability/clear_system_service_alert_notification_config_parameters.go create mode 100644 client/observability/clear_system_service_alert_notification_config_responses.go create mode 100644 models/allocatable_ec_storage_capacity.go create mode 100644 models/allocatable_replica_storage_capacity.go create mode 100644 models/allocatable_storage_capacity.go create mode 100644 models/backup_plan_phase.go create mode 100644 models/backup_restore_point_where_unique_input.go create mode 100644 models/cluster_storage_info.go create mode 100644 models/cluster_storage_info_ec_config.go create mode 100644 models/error_body_stringer.go create mode 100644 models/get_backup_restore_point_metadata_request_body.go create mode 100644 models/get_cluster_storage_info_effect.go create mode 100644 models/get_cluster_storage_info_request_body.go create mode 100644 models/nested_content_library_vm_template_disk.go create mode 100644 models/nested_content_library_vm_template_nic.go create mode 100644 models/nested_snapshot_info.go create mode 100644 models/nested_storage_policy_config.go create mode 100644 models/nested_template_config.go create mode 100644 models/nested_virtual_private_cloud_edge_gateway.go create mode 100644 models/nested_virtual_private_cloud_service_tep_ip_pool.go create mode 100644 models/nested_zbs_storage_info.go create mode 100644 models/ntp_service_url.go create mode 100644 models/replica_num.go create mode 100644 models/virtual_private_cloud_edge_gateway_group_where_input.go create mode 100644 models/virtual_private_cloud_external_subnet_group_where_input.go create mode 100644 models/vm_disk_meta_data.go create mode 100644 models/vm_ha_priority.go create mode 100644 models/vm_meta_data.go create mode 100644 models/vm_nic_meta_data.go diff --git a/RELEASE_NOTE.md b/RELEASE_NOTE.md index c735fb62..60fa5ee8 100644 --- a/RELEASE_NOTE.md +++ b/RELEASE_NOTE.md @@ -1,5 +1,38 @@ # RELEASE NOTE +## release 日期 2025-02-17 + +v2.19.0 release (tower version 4.5.0) + +### breaking change + +- [TaskApi]: [UpdateTask]: Descripton 字段由 *string 更新为 *TaskDescription + +### feature + +- [BackupPlanApi]: 新增 GetBackupRestorePointMetadata API 用于获取备份恢复点元数据; +- [NtpApi]: 新增 GetNtpServiceURL API 用于获取 Ntp 服务 URL; +- [ClusterApi]: 新增 GetClusterStorageInfo API 用于获取集群存储信息; +- [ObservabilityApi]: 新增 ClearSystemServiceAlertNotificationConfig API 用于清除系统服务报警信息 + +### optimize + +- [BackupPlanApi]: [CreateBackupPlan]: 在 IncrementalPeriod 为 weekly 时,校验 IncrementalWeekdays 是否已输入; +- 为以下资源新增返回字段 + - [BackupPlan]: 新增 Vms, Phase, LastExecuteStatusMessage, LastManualExecuteStatusMessage, BackupRestorePointCount, ValidSizeOfRestorePoint, BackupTotalSize, LogicalSize, BackupDelayOption, DeleteStrategy, BackupPlanExecutions 和 BackupRestorePoints 字段; + - [NestedVirtualPrivateCloudService]: 新增 InternalCidr 和 TepIpPools 字段; + - [VirtualPrivateCloud]: 新增 VpcService 字段; + - [SecurityPolicy]: 新增 IsBlocklist 字段; + - [ContentLibraryVmTemplate]: 新增 VmDisks, VmNics, ClockOffset, Cpu, CpuModel, Firmware, Ha, IoPolicy, LocalCreatedAt, MaxBandwidth, MaxBandwidthPolicy, MaxIops, MaxIopsPolicy, TemplateConfig, VideoType, WinOpt 和 ZbsStorageInfo 字段; + - [VirtualPrivateCloudExternalSubnets]: 新增 EdgeGateway 和 Exclusive 字段; +- [TaskApi]: [CreateTask], [UpdateTask]: 支持传入 StartedAt 和 FinishedAt 字段; +- [ErrorBody]: 为 ErrorBody 实现了 stringer 接口,方便打印错误信息; + +### bugfix + +- [IscsiLunApi]: [CopyIscsiLun]: 修复跨集群克隆 iscsi lun 失败; +- [ObservabilityApi]: [DisassociateSystemServiceFromObsService]: 修复解除关系错误时无法正确返回错误信息。 + ## release 日期 2024-10-14 v2.18.0 release (tower version 4.4.0) diff --git a/client/backup_plan/backup_plan_client.go b/client/backup_plan/backup_plan_client.go index 68b58f20..cf945691 100644 --- a/client/backup_plan/backup_plan_client.go +++ b/client/backup_plan/backup_plan_client.go @@ -46,6 +46,8 @@ type ClientService interface { GetBackupPlansConnection(params *GetBackupPlansConnectionParams, opts ...ClientOption) (*GetBackupPlansConnectionOK, error) + GetBackupRestorePointMetadata(params *GetBackupRestorePointMetadataParams, opts ...ClientOption) (*GetBackupRestorePointMetadataOK, error) + ResumeBackupPlan(params *ResumeBackupPlanParams, opts ...ClientOption) (*ResumeBackupPlanOK, error) SuspendBackupPlan(params *SuspendBackupPlanParams, opts ...ClientOption) (*SuspendBackupPlanOK, error) @@ -359,6 +361,44 @@ func (a *Client) GetBackupPlansConnection(params *GetBackupPlansConnectionParams panic(msg) } +/* + GetBackupRestorePointMetadata get backup restore point metadata API +*/ +func (a *Client) GetBackupRestorePointMetadata(params *GetBackupRestorePointMetadataParams, opts ...ClientOption) (*GetBackupRestorePointMetadataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBackupRestorePointMetadataParams() + } + op := &runtime.ClientOperation{ + ID: "GetBackupRestorePointMetadata", + Method: "POST", + PathPattern: "/get-backup-restore-point-metadata", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetBackupRestorePointMetadataReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetBackupRestorePointMetadataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetBackupRestorePointMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ResumeBackupPlan resume backup plan API */ diff --git a/client/backup_plan/get_backup_restore_point_metadata_parameters.go b/client/backup_plan/get_backup_restore_point_metadata_parameters.go new file mode 100644 index 00000000..f70e2557 --- /dev/null +++ b/client/backup_plan/get_backup_restore_point_metadata_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_plan + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// NewGetBackupRestorePointMetadataParams creates a new GetBackupRestorePointMetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBackupRestorePointMetadataParams() *GetBackupRestorePointMetadataParams { + return &GetBackupRestorePointMetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBackupRestorePointMetadataParamsWithTimeout creates a new GetBackupRestorePointMetadataParams object +// with the ability to set a timeout on a request. +func NewGetBackupRestorePointMetadataParamsWithTimeout(timeout time.Duration) *GetBackupRestorePointMetadataParams { + return &GetBackupRestorePointMetadataParams{ + timeout: timeout, + } +} + +// NewGetBackupRestorePointMetadataParamsWithContext creates a new GetBackupRestorePointMetadataParams object +// with the ability to set a context for a request. +func NewGetBackupRestorePointMetadataParamsWithContext(ctx context.Context) *GetBackupRestorePointMetadataParams { + return &GetBackupRestorePointMetadataParams{ + Context: ctx, + } +} + +// NewGetBackupRestorePointMetadataParamsWithHTTPClient creates a new GetBackupRestorePointMetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBackupRestorePointMetadataParamsWithHTTPClient(client *http.Client) *GetBackupRestorePointMetadataParams { + return &GetBackupRestorePointMetadataParams{ + HTTPClient: client, + } +} + +/* GetBackupRestorePointMetadataParams contains all the parameters to send to the API endpoint + for the get backup restore point metadata operation. + + Typically these are written to a http.Request. +*/ +type GetBackupRestorePointMetadataParams struct { + + // RequestBody. + RequestBody *models.GetBackupRestorePointMetadataRequestBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get backup restore point metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBackupRestorePointMetadataParams) WithDefaults() *GetBackupRestorePointMetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get backup restore point metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBackupRestorePointMetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) WithTimeout(timeout time.Duration) *GetBackupRestorePointMetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) WithContext(ctx context.Context) *GetBackupRestorePointMetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) WithHTTPClient(client *http.Client) *GetBackupRestorePointMetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRequestBody adds the requestBody to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) WithRequestBody(requestBody *models.GetBackupRestorePointMetadataRequestBody) *GetBackupRestorePointMetadataParams { + o.SetRequestBody(requestBody) + return o +} + +// SetRequestBody adds the requestBody to the get backup restore point metadata params +func (o *GetBackupRestorePointMetadataParams) SetRequestBody(requestBody *models.GetBackupRestorePointMetadataRequestBody) { + o.RequestBody = requestBody +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBackupRestorePointMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.RequestBody != nil { + if err := r.SetBodyParam(o.RequestBody); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/backup_plan/get_backup_restore_point_metadata_responses.go b/client/backup_plan/get_backup_restore_point_metadata_responses.go new file mode 100644 index 00000000..8b537978 --- /dev/null +++ b/client/backup_plan/get_backup_restore_point_metadata_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_plan + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// GetBackupRestorePointMetadataReader is a Reader for the GetBackupRestorePointMetadata structure. +type GetBackupRestorePointMetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBackupRestorePointMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBackupRestorePointMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetBackupRestorePointMetadataBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetBackupRestorePointMetadataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetBackupRestorePointMetadataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBackupRestorePointMetadataOK creates a GetBackupRestorePointMetadataOK with default headers values +func NewGetBackupRestorePointMetadataOK() *GetBackupRestorePointMetadataOK { + return &GetBackupRestorePointMetadataOK{} +} + +/* GetBackupRestorePointMetadataOK describes a response with status code 200, with default header values. + +GetBackupRestorePointMetadataOK get backup restore point metadata o k +*/ +type GetBackupRestorePointMetadataOK struct { + XTowerRequestID string + + Payload *models.VMMetaData +} + +func (o *GetBackupRestorePointMetadataOK) Error() string { + return fmt.Sprintf("[POST /get-backup-restore-point-metadata][%d] getBackupRestorePointMetadataOK %+v", 200, o.Payload) +} +func (o *GetBackupRestorePointMetadataOK) GetPayload() *models.VMMetaData { + return o.Payload +} + +func (o *GetBackupRestorePointMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.VMMetaData) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackupRestorePointMetadataBadRequest creates a GetBackupRestorePointMetadataBadRequest with default headers values +func NewGetBackupRestorePointMetadataBadRequest() *GetBackupRestorePointMetadataBadRequest { + return &GetBackupRestorePointMetadataBadRequest{} +} + +/* GetBackupRestorePointMetadataBadRequest describes a response with status code 400, with default header values. + +Bad request +*/ +type GetBackupRestorePointMetadataBadRequest struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetBackupRestorePointMetadataBadRequest) Error() string { + return fmt.Sprintf("[POST /get-backup-restore-point-metadata][%d] getBackupRestorePointMetadataBadRequest %+v", 400, o.Payload) +} +func (o *GetBackupRestorePointMetadataBadRequest) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetBackupRestorePointMetadataBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackupRestorePointMetadataNotFound creates a GetBackupRestorePointMetadataNotFound with default headers values +func NewGetBackupRestorePointMetadataNotFound() *GetBackupRestorePointMetadataNotFound { + return &GetBackupRestorePointMetadataNotFound{} +} + +/* GetBackupRestorePointMetadataNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetBackupRestorePointMetadataNotFound struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetBackupRestorePointMetadataNotFound) Error() string { + return fmt.Sprintf("[POST /get-backup-restore-point-metadata][%d] getBackupRestorePointMetadataNotFound %+v", 404, o.Payload) +} +func (o *GetBackupRestorePointMetadataNotFound) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetBackupRestorePointMetadataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackupRestorePointMetadataInternalServerError creates a GetBackupRestorePointMetadataInternalServerError with default headers values +func NewGetBackupRestorePointMetadataInternalServerError() *GetBackupRestorePointMetadataInternalServerError { + return &GetBackupRestorePointMetadataInternalServerError{} +} + +/* GetBackupRestorePointMetadataInternalServerError describes a response with status code 500, with default header values. + +Server error +*/ +type GetBackupRestorePointMetadataInternalServerError struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetBackupRestorePointMetadataInternalServerError) Error() string { + return fmt.Sprintf("[POST /get-backup-restore-point-metadata][%d] getBackupRestorePointMetadataInternalServerError %+v", 500, o.Payload) +} +func (o *GetBackupRestorePointMetadataInternalServerError) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetBackupRestorePointMetadataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/cloudtower_client.go b/client/cloudtower_client.go index 86ec93e2..293239cc 100644 --- a/client/cloudtower_client.go +++ b/client/cloudtower_client.go @@ -66,6 +66,7 @@ import ( "github.com/smartxworks/cloudtower-go-sdk/v2/client/nfs_inode" "github.com/smartxworks/cloudtower-go-sdk/v2/client/nic" "github.com/smartxworks/cloudtower-go-sdk/v2/client/node_topo" + "github.com/smartxworks/cloudtower-go-sdk/v2/client/ntp" "github.com/smartxworks/cloudtower-go-sdk/v2/client/nvmf_namespace" "github.com/smartxworks/cloudtower-go-sdk/v2/client/nvmf_namespace_snapshot" "github.com/smartxworks/cloudtower-go-sdk/v2/client/nvmf_subsystem" @@ -223,6 +224,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Cloudtower cli.NfsInode = nfs_inode.New(transport, formats) cli.Nic = nic.New(transport, formats) cli.NodeTopo = node_topo.New(transport, formats) + cli.Ntp = ntp.New(transport, formats) cli.NvmfNamespace = nvmf_namespace.New(transport, formats) cli.NvmfNamespaceSnapshot = nvmf_namespace_snapshot.New(transport, formats) cli.NvmfSubsystem = nvmf_subsystem.New(transport, formats) @@ -436,6 +438,8 @@ type Cloudtower struct { NodeTopo node_topo.ClientService + Ntp ntp.ClientService + NvmfNamespace nvmf_namespace.ClientService NvmfNamespaceSnapshot nvmf_namespace_snapshot.ClientService @@ -612,6 +616,7 @@ func (c *Cloudtower) SetTransport(transport runtime.ClientTransport) { c.NfsInode.SetTransport(transport) c.Nic.SetTransport(transport) c.NodeTopo.SetTransport(transport) + c.Ntp.SetTransport(transport) c.NvmfNamespace.SetTransport(transport) c.NvmfNamespaceSnapshot.SetTransport(transport) c.NvmfSubsystem.SetTransport(transport) diff --git a/client/cluster/cluster_client.go b/client/cluster/cluster_client.go index f4746fd9..a2af3eda 100644 --- a/client/cluster/cluster_client.go +++ b/client/cluster/cluster_client.go @@ -34,6 +34,8 @@ type ClientService interface { DeleteCluster(params *DeleteClusterParams, opts ...ClientOption) (*DeleteClusterOK, error) + GetClusterStorageInfo(params *GetClusterStorageInfoParams, opts ...ClientOption) (*GetClusterStorageInfoOK, error) + GetClusters(params *GetClustersParams, opts ...ClientOption) (*GetClustersOK, error) GetClustersConnection(params *GetClustersConnectionParams, opts ...ClientOption) (*GetClustersConnectionOK, error) @@ -131,6 +133,44 @@ func (a *Client) DeleteCluster(params *DeleteClusterParams, opts ...ClientOption panic(msg) } +/* + GetClusterStorageInfo get cluster storage info API +*/ +func (a *Client) GetClusterStorageInfo(params *GetClusterStorageInfoParams, opts ...ClientOption) (*GetClusterStorageInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterStorageInfoParams() + } + op := &runtime.ClientOperation{ + ID: "GetClusterStorageInfo", + Method: "POST", + PathPattern: "/get-cluster-storage-info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterStorageInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterStorageInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetClusterStorageInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetClusters get clusters API */ diff --git a/client/cluster/get_cluster_storage_info_parameters.go b/client/cluster/get_cluster_storage_info_parameters.go new file mode 100644 index 00000000..8f7a6fe6 --- /dev/null +++ b/client/cluster/get_cluster_storage_info_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// NewGetClusterStorageInfoParams creates a new GetClusterStorageInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetClusterStorageInfoParams() *GetClusterStorageInfoParams { + return &GetClusterStorageInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterStorageInfoParamsWithTimeout creates a new GetClusterStorageInfoParams object +// with the ability to set a timeout on a request. +func NewGetClusterStorageInfoParamsWithTimeout(timeout time.Duration) *GetClusterStorageInfoParams { + return &GetClusterStorageInfoParams{ + timeout: timeout, + } +} + +// NewGetClusterStorageInfoParamsWithContext creates a new GetClusterStorageInfoParams object +// with the ability to set a context for a request. +func NewGetClusterStorageInfoParamsWithContext(ctx context.Context) *GetClusterStorageInfoParams { + return &GetClusterStorageInfoParams{ + Context: ctx, + } +} + +// NewGetClusterStorageInfoParamsWithHTTPClient creates a new GetClusterStorageInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClusterStorageInfoParamsWithHTTPClient(client *http.Client) *GetClusterStorageInfoParams { + return &GetClusterStorageInfoParams{ + HTTPClient: client, + } +} + +/* GetClusterStorageInfoParams contains all the parameters to send to the API endpoint + for the get cluster storage info operation. + + Typically these are written to a http.Request. +*/ +type GetClusterStorageInfoParams struct { + + // RequestBody. + RequestBody *models.GetClusterStorageInfoRequestBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cluster storage info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterStorageInfoParams) WithDefaults() *GetClusterStorageInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cluster storage info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterStorageInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cluster storage info params +func (o *GetClusterStorageInfoParams) WithTimeout(timeout time.Duration) *GetClusterStorageInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster storage info params +func (o *GetClusterStorageInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster storage info params +func (o *GetClusterStorageInfoParams) WithContext(ctx context.Context) *GetClusterStorageInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster storage info params +func (o *GetClusterStorageInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster storage info params +func (o *GetClusterStorageInfoParams) WithHTTPClient(client *http.Client) *GetClusterStorageInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster storage info params +func (o *GetClusterStorageInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRequestBody adds the requestBody to the get cluster storage info params +func (o *GetClusterStorageInfoParams) WithRequestBody(requestBody *models.GetClusterStorageInfoRequestBody) *GetClusterStorageInfoParams { + o.SetRequestBody(requestBody) + return o +} + +// SetRequestBody adds the requestBody to the get cluster storage info params +func (o *GetClusterStorageInfoParams) SetRequestBody(requestBody *models.GetClusterStorageInfoRequestBody) { + o.RequestBody = requestBody +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterStorageInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.RequestBody != nil { + if err := r.SetBodyParam(o.RequestBody); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/cluster/get_cluster_storage_info_responses.go b/client/cluster/get_cluster_storage_info_responses.go new file mode 100644 index 00000000..82f928b1 --- /dev/null +++ b/client/cluster/get_cluster_storage_info_responses.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cluster + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// GetClusterStorageInfoReader is a Reader for the GetClusterStorageInfo structure. +type GetClusterStorageInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterStorageInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterStorageInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetClusterStorageInfoBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetClusterStorageInfoNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetClusterStorageInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetClusterStorageInfoOK creates a GetClusterStorageInfoOK with default headers values +func NewGetClusterStorageInfoOK() *GetClusterStorageInfoOK { + return &GetClusterStorageInfoOK{} +} + +/* GetClusterStorageInfoOK describes a response with status code 200, with default header values. + +GetClusterStorageInfoOK get cluster storage info o k +*/ +type GetClusterStorageInfoOK struct { + XTowerRequestID string + + Payload []*models.ClusterStorageInfo +} + +func (o *GetClusterStorageInfoOK) Error() string { + return fmt.Sprintf("[POST /get-cluster-storage-info][%d] getClusterStorageInfoOK %+v", 200, o.Payload) +} +func (o *GetClusterStorageInfoOK) GetPayload() []*models.ClusterStorageInfo { + return o.Payload +} + +func (o *GetClusterStorageInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterStorageInfoBadRequest creates a GetClusterStorageInfoBadRequest with default headers values +func NewGetClusterStorageInfoBadRequest() *GetClusterStorageInfoBadRequest { + return &GetClusterStorageInfoBadRequest{} +} + +/* GetClusterStorageInfoBadRequest describes a response with status code 400, with default header values. + +Bad request +*/ +type GetClusterStorageInfoBadRequest struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetClusterStorageInfoBadRequest) Error() string { + return fmt.Sprintf("[POST /get-cluster-storage-info][%d] getClusterStorageInfoBadRequest %+v", 400, o.Payload) +} +func (o *GetClusterStorageInfoBadRequest) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetClusterStorageInfoBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterStorageInfoNotFound creates a GetClusterStorageInfoNotFound with default headers values +func NewGetClusterStorageInfoNotFound() *GetClusterStorageInfoNotFound { + return &GetClusterStorageInfoNotFound{} +} + +/* GetClusterStorageInfoNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetClusterStorageInfoNotFound struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetClusterStorageInfoNotFound) Error() string { + return fmt.Sprintf("[POST /get-cluster-storage-info][%d] getClusterStorageInfoNotFound %+v", 404, o.Payload) +} +func (o *GetClusterStorageInfoNotFound) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetClusterStorageInfoNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterStorageInfoInternalServerError creates a GetClusterStorageInfoInternalServerError with default headers values +func NewGetClusterStorageInfoInternalServerError() *GetClusterStorageInfoInternalServerError { + return &GetClusterStorageInfoInternalServerError{} +} + +/* GetClusterStorageInfoInternalServerError describes a response with status code 500, with default header values. + +Server error +*/ +type GetClusterStorageInfoInternalServerError struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetClusterStorageInfoInternalServerError) Error() string { + return fmt.Sprintf("[POST /get-cluster-storage-info][%d] getClusterStorageInfoInternalServerError %+v", 500, o.Payload) +} +func (o *GetClusterStorageInfoInternalServerError) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetClusterStorageInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ntp/get_ntp_service_url_parameters.go b/client/ntp/get_ntp_service_url_parameters.go new file mode 100644 index 00000000..6a97f2f6 --- /dev/null +++ b/client/ntp/get_ntp_service_url_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ntp + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetNtpServiceURLParams creates a new GetNtpServiceURLParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetNtpServiceURLParams() *GetNtpServiceURLParams { + return &GetNtpServiceURLParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetNtpServiceURLParamsWithTimeout creates a new GetNtpServiceURLParams object +// with the ability to set a timeout on a request. +func NewGetNtpServiceURLParamsWithTimeout(timeout time.Duration) *GetNtpServiceURLParams { + return &GetNtpServiceURLParams{ + timeout: timeout, + } +} + +// NewGetNtpServiceURLParamsWithContext creates a new GetNtpServiceURLParams object +// with the ability to set a context for a request. +func NewGetNtpServiceURLParamsWithContext(ctx context.Context) *GetNtpServiceURLParams { + return &GetNtpServiceURLParams{ + Context: ctx, + } +} + +// NewGetNtpServiceURLParamsWithHTTPClient creates a new GetNtpServiceURLParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetNtpServiceURLParamsWithHTTPClient(client *http.Client) *GetNtpServiceURLParams { + return &GetNtpServiceURLParams{ + HTTPClient: client, + } +} + +/* GetNtpServiceURLParams contains all the parameters to send to the API endpoint + for the get ntp service Url operation. + + Typically these are written to a http.Request. +*/ +type GetNtpServiceURLParams struct { + + // ContentLanguage. + // + // Default: "en-US" + ContentLanguage *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ntp service Url params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNtpServiceURLParams) WithDefaults() *GetNtpServiceURLParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ntp service Url params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNtpServiceURLParams) SetDefaults() { + var ( + contentLanguageDefault = string("en-US") + ) + + val := GetNtpServiceURLParams{ + ContentLanguage: &contentLanguageDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get ntp service Url params +func (o *GetNtpServiceURLParams) WithTimeout(timeout time.Duration) *GetNtpServiceURLParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ntp service Url params +func (o *GetNtpServiceURLParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ntp service Url params +func (o *GetNtpServiceURLParams) WithContext(ctx context.Context) *GetNtpServiceURLParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ntp service Url params +func (o *GetNtpServiceURLParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ntp service Url params +func (o *GetNtpServiceURLParams) WithHTTPClient(client *http.Client) *GetNtpServiceURLParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ntp service Url params +func (o *GetNtpServiceURLParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContentLanguage adds the contentLanguage to the get ntp service Url params +func (o *GetNtpServiceURLParams) WithContentLanguage(contentLanguage *string) *GetNtpServiceURLParams { + o.SetContentLanguage(contentLanguage) + return o +} + +// SetContentLanguage adds the contentLanguage to the get ntp service Url params +func (o *GetNtpServiceURLParams) SetContentLanguage(contentLanguage *string) { + o.ContentLanguage = contentLanguage +} + +// WriteToRequest writes these params to a swagger request +func (o *GetNtpServiceURLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ContentLanguage != nil { + + // header param content-language + if err := r.SetHeaderParam("content-language", *o.ContentLanguage); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ntp/get_ntp_service_url_responses.go b/client/ntp/get_ntp_service_url_responses.go new file mode 100644 index 00000000..4a79f3d6 --- /dev/null +++ b/client/ntp/get_ntp_service_url_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ntp + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// GetNtpServiceURLReader is a Reader for the GetNtpServiceURL structure. +type GetNtpServiceURLReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetNtpServiceURLReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetNtpServiceURLOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetNtpServiceURLBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetNtpServiceURLNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetNtpServiceURLInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetNtpServiceURLOK creates a GetNtpServiceURLOK with default headers values +func NewGetNtpServiceURLOK() *GetNtpServiceURLOK { + return &GetNtpServiceURLOK{} +} + +/* GetNtpServiceURLOK describes a response with status code 200, with default header values. + +GetNtpServiceURLOK get ntp service Url o k +*/ +type GetNtpServiceURLOK struct { + XTowerRequestID string + + Payload *models.NtpServiceURL +} + +func (o *GetNtpServiceURLOK) Error() string { + return fmt.Sprintf("[POST /get-ntp-service-url][%d] getNtpServiceUrlOK %+v", 200, o.Payload) +} +func (o *GetNtpServiceURLOK) GetPayload() *models.NtpServiceURL { + return o.Payload +} + +func (o *GetNtpServiceURLOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.NtpServiceURL) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNtpServiceURLBadRequest creates a GetNtpServiceURLBadRequest with default headers values +func NewGetNtpServiceURLBadRequest() *GetNtpServiceURLBadRequest { + return &GetNtpServiceURLBadRequest{} +} + +/* GetNtpServiceURLBadRequest describes a response with status code 400, with default header values. + +Bad request +*/ +type GetNtpServiceURLBadRequest struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetNtpServiceURLBadRequest) Error() string { + return fmt.Sprintf("[POST /get-ntp-service-url][%d] getNtpServiceUrlBadRequest %+v", 400, o.Payload) +} +func (o *GetNtpServiceURLBadRequest) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetNtpServiceURLBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNtpServiceURLNotFound creates a GetNtpServiceURLNotFound with default headers values +func NewGetNtpServiceURLNotFound() *GetNtpServiceURLNotFound { + return &GetNtpServiceURLNotFound{} +} + +/* GetNtpServiceURLNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type GetNtpServiceURLNotFound struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetNtpServiceURLNotFound) Error() string { + return fmt.Sprintf("[POST /get-ntp-service-url][%d] getNtpServiceUrlNotFound %+v", 404, o.Payload) +} +func (o *GetNtpServiceURLNotFound) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetNtpServiceURLNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNtpServiceURLInternalServerError creates a GetNtpServiceURLInternalServerError with default headers values +func NewGetNtpServiceURLInternalServerError() *GetNtpServiceURLInternalServerError { + return &GetNtpServiceURLInternalServerError{} +} + +/* GetNtpServiceURLInternalServerError describes a response with status code 500, with default header values. + +Server error +*/ +type GetNtpServiceURLInternalServerError struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *GetNtpServiceURLInternalServerError) Error() string { + return fmt.Sprintf("[POST /get-ntp-service-url][%d] getNtpServiceUrlInternalServerError %+v", 500, o.Payload) +} +func (o *GetNtpServiceURLInternalServerError) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *GetNtpServiceURLInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ntp/ntp_client.go b/client/ntp/ntp_client.go new file mode 100644 index 00000000..215bd836 --- /dev/null +++ b/client/ntp/ntp_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ntp + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new ntp API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ntp API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetNtpServiceURL(params *GetNtpServiceURLParams, opts ...ClientOption) (*GetNtpServiceURLOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetNtpServiceURL get ntp service Url API +*/ +func (a *Client) GetNtpServiceURL(params *GetNtpServiceURLParams, opts ...ClientOption) (*GetNtpServiceURLOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetNtpServiceURLParams() + } + op := &runtime.ClientOperation{ + ID: "GetNtpServiceUrl", + Method: "POST", + PathPattern: "/get-ntp-service-url", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetNtpServiceURLReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetNtpServiceURLOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetNtpServiceUrl: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/observability/clear_system_service_alert_notification_config_parameters.go b/client/observability/clear_system_service_alert_notification_config_parameters.go new file mode 100644 index 00000000..22cbe42c --- /dev/null +++ b/client/observability/clear_system_service_alert_notification_config_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package observability + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// NewClearSystemServiceAlertNotificationConfigParams creates a new ClearSystemServiceAlertNotificationConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewClearSystemServiceAlertNotificationConfigParams() *ClearSystemServiceAlertNotificationConfigParams { + return &ClearSystemServiceAlertNotificationConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewClearSystemServiceAlertNotificationConfigParamsWithTimeout creates a new ClearSystemServiceAlertNotificationConfigParams object +// with the ability to set a timeout on a request. +func NewClearSystemServiceAlertNotificationConfigParamsWithTimeout(timeout time.Duration) *ClearSystemServiceAlertNotificationConfigParams { + return &ClearSystemServiceAlertNotificationConfigParams{ + timeout: timeout, + } +} + +// NewClearSystemServiceAlertNotificationConfigParamsWithContext creates a new ClearSystemServiceAlertNotificationConfigParams object +// with the ability to set a context for a request. +func NewClearSystemServiceAlertNotificationConfigParamsWithContext(ctx context.Context) *ClearSystemServiceAlertNotificationConfigParams { + return &ClearSystemServiceAlertNotificationConfigParams{ + Context: ctx, + } +} + +// NewClearSystemServiceAlertNotificationConfigParamsWithHTTPClient creates a new ClearSystemServiceAlertNotificationConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewClearSystemServiceAlertNotificationConfigParamsWithHTTPClient(client *http.Client) *ClearSystemServiceAlertNotificationConfigParams { + return &ClearSystemServiceAlertNotificationConfigParams{ + HTTPClient: client, + } +} + +/* ClearSystemServiceAlertNotificationConfigParams contains all the parameters to send to the API endpoint + for the clear system service alert notification config operation. + + Typically these are written to a http.Request. +*/ +type ClearSystemServiceAlertNotificationConfigParams struct { + + // ContentLanguage. + // + // Default: "en-US" + ContentLanguage *string + + // RequestBody. + RequestBody *models.DisassociateSystemServiceFromObsServiceParams + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the clear system service alert notification config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClearSystemServiceAlertNotificationConfigParams) WithDefaults() *ClearSystemServiceAlertNotificationConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the clear system service alert notification config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClearSystemServiceAlertNotificationConfigParams) SetDefaults() { + var ( + contentLanguageDefault = string("en-US") + ) + + val := ClearSystemServiceAlertNotificationConfigParams{ + ContentLanguage: &contentLanguageDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) WithTimeout(timeout time.Duration) *ClearSystemServiceAlertNotificationConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) WithContext(ctx context.Context) *ClearSystemServiceAlertNotificationConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) WithHTTPClient(client *http.Client) *ClearSystemServiceAlertNotificationConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContentLanguage adds the contentLanguage to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) WithContentLanguage(contentLanguage *string) *ClearSystemServiceAlertNotificationConfigParams { + o.SetContentLanguage(contentLanguage) + return o +} + +// SetContentLanguage adds the contentLanguage to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) SetContentLanguage(contentLanguage *string) { + o.ContentLanguage = contentLanguage +} + +// WithRequestBody adds the requestBody to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) WithRequestBody(requestBody *models.DisassociateSystemServiceFromObsServiceParams) *ClearSystemServiceAlertNotificationConfigParams { + o.SetRequestBody(requestBody) + return o +} + +// SetRequestBody adds the requestBody to the clear system service alert notification config params +func (o *ClearSystemServiceAlertNotificationConfigParams) SetRequestBody(requestBody *models.DisassociateSystemServiceFromObsServiceParams) { + o.RequestBody = requestBody +} + +// WriteToRequest writes these params to a swagger request +func (o *ClearSystemServiceAlertNotificationConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ContentLanguage != nil { + + // header param content-language + if err := r.SetHeaderParam("content-language", *o.ContentLanguage); err != nil { + return err + } + } + if o.RequestBody != nil { + if err := r.SetBodyParam(o.RequestBody); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/observability/clear_system_service_alert_notification_config_responses.go b/client/observability/clear_system_service_alert_notification_config_responses.go new file mode 100644 index 00000000..743ceccb --- /dev/null +++ b/client/observability/clear_system_service_alert_notification_config_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package observability + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smartxworks/cloudtower-go-sdk/v2/models" +) + +// ClearSystemServiceAlertNotificationConfigReader is a Reader for the ClearSystemServiceAlertNotificationConfig structure. +type ClearSystemServiceAlertNotificationConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ClearSystemServiceAlertNotificationConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewClearSystemServiceAlertNotificationConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewClearSystemServiceAlertNotificationConfigBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewClearSystemServiceAlertNotificationConfigNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewClearSystemServiceAlertNotificationConfigInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewClearSystemServiceAlertNotificationConfigOK creates a ClearSystemServiceAlertNotificationConfigOK with default headers values +func NewClearSystemServiceAlertNotificationConfigOK() *ClearSystemServiceAlertNotificationConfigOK { + return &ClearSystemServiceAlertNotificationConfigOK{} +} + +/* ClearSystemServiceAlertNotificationConfigOK describes a response with status code 200, with default header values. + +ClearSystemServiceAlertNotificationConfigOK clear system service alert notification config o k +*/ +type ClearSystemServiceAlertNotificationConfigOK struct { + XTowerRequestID string + + Payload *models.WithTaskDisassociateSystemServiceFromObsServiceResult +} + +func (o *ClearSystemServiceAlertNotificationConfigOK) Error() string { + return fmt.Sprintf("[POST /clear-system-service-alert-notification-config][%d] clearSystemServiceAlertNotificationConfigOK %+v", 200, o.Payload) +} +func (o *ClearSystemServiceAlertNotificationConfigOK) GetPayload() *models.WithTaskDisassociateSystemServiceFromObsServiceResult { + return o.Payload +} + +func (o *ClearSystemServiceAlertNotificationConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.WithTaskDisassociateSystemServiceFromObsServiceResult) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewClearSystemServiceAlertNotificationConfigBadRequest creates a ClearSystemServiceAlertNotificationConfigBadRequest with default headers values +func NewClearSystemServiceAlertNotificationConfigBadRequest() *ClearSystemServiceAlertNotificationConfigBadRequest { + return &ClearSystemServiceAlertNotificationConfigBadRequest{} +} + +/* ClearSystemServiceAlertNotificationConfigBadRequest describes a response with status code 400, with default header values. + +Bad request +*/ +type ClearSystemServiceAlertNotificationConfigBadRequest struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *ClearSystemServiceAlertNotificationConfigBadRequest) Error() string { + return fmt.Sprintf("[POST /clear-system-service-alert-notification-config][%d] clearSystemServiceAlertNotificationConfigBadRequest %+v", 400, o.Payload) +} +func (o *ClearSystemServiceAlertNotificationConfigBadRequest) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *ClearSystemServiceAlertNotificationConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewClearSystemServiceAlertNotificationConfigNotFound creates a ClearSystemServiceAlertNotificationConfigNotFound with default headers values +func NewClearSystemServiceAlertNotificationConfigNotFound() *ClearSystemServiceAlertNotificationConfigNotFound { + return &ClearSystemServiceAlertNotificationConfigNotFound{} +} + +/* ClearSystemServiceAlertNotificationConfigNotFound describes a response with status code 404, with default header values. + +Not found +*/ +type ClearSystemServiceAlertNotificationConfigNotFound struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *ClearSystemServiceAlertNotificationConfigNotFound) Error() string { + return fmt.Sprintf("[POST /clear-system-service-alert-notification-config][%d] clearSystemServiceAlertNotificationConfigNotFound %+v", 404, o.Payload) +} +func (o *ClearSystemServiceAlertNotificationConfigNotFound) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *ClearSystemServiceAlertNotificationConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewClearSystemServiceAlertNotificationConfigInternalServerError creates a ClearSystemServiceAlertNotificationConfigInternalServerError with default headers values +func NewClearSystemServiceAlertNotificationConfigInternalServerError() *ClearSystemServiceAlertNotificationConfigInternalServerError { + return &ClearSystemServiceAlertNotificationConfigInternalServerError{} +} + +/* ClearSystemServiceAlertNotificationConfigInternalServerError describes a response with status code 500, with default header values. + +Server error +*/ +type ClearSystemServiceAlertNotificationConfigInternalServerError struct { + XTowerRequestID string + + Payload *models.ErrorBody +} + +func (o *ClearSystemServiceAlertNotificationConfigInternalServerError) Error() string { + return fmt.Sprintf("[POST /clear-system-service-alert-notification-config][%d] clearSystemServiceAlertNotificationConfigInternalServerError %+v", 500, o.Payload) +} +func (o *ClearSystemServiceAlertNotificationConfigInternalServerError) GetPayload() *models.ErrorBody { + return o.Payload +} + +func (o *ClearSystemServiceAlertNotificationConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-tower-request-id + hdrXTowerRequestID := response.GetHeader("x-tower-request-id") + + if hdrXTowerRequestID != "" { + o.XTowerRequestID = hdrXTowerRequestID + } + + o.Payload = new(models.ErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/observability/observability_client.go b/client/observability/observability_client.go index eee55e9e..bf05c6d5 100644 --- a/client/observability/observability_client.go +++ b/client/observability/observability_client.go @@ -30,11 +30,51 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + ClearSystemServiceAlertNotificationConfig(params *ClearSystemServiceAlertNotificationConfigParams, opts ...ClientOption) (*ClearSystemServiceAlertNotificationConfigOK, error) + DisassociateSystemServiceFromObsService(params *DisassociateSystemServiceFromObsServiceParams, opts ...ClientOption) (*DisassociateSystemServiceFromObsServiceOK, error) SetTransport(transport runtime.ClientTransport) } +/* + ClearSystemServiceAlertNotificationConfig clear system service alert notification config API +*/ +func (a *Client) ClearSystemServiceAlertNotificationConfig(params *ClearSystemServiceAlertNotificationConfigParams, opts ...ClientOption) (*ClearSystemServiceAlertNotificationConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewClearSystemServiceAlertNotificationConfigParams() + } + op := &runtime.ClientOperation{ + ID: "ClearSystemServiceAlertNotificationConfig", + Method: "POST", + PathPattern: "/clear-system-service-alert-notification-config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ClearSystemServiceAlertNotificationConfigReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ClearSystemServiceAlertNotificationConfigOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ClearSystemServiceAlertNotificationConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DisassociateSystemServiceFromObsService disassociate system service from obs service API */ diff --git a/models/allocatable_ec_storage_capacity.go b/models/allocatable_ec_storage_capacity.go new file mode 100644 index 00000000..c0cf8bb3 --- /dev/null +++ b/models/allocatable_ec_storage_capacity.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AllocatableEcStorageCapacity allocatable ec storage capacity +// +// swagger:model AllocatableEcStorageCapacity +type AllocatableEcStorageCapacity struct { + + // capacity + // Required: true + Capacity *float64 `json:"capacity"` + + // k + // Required: true + K *int32 `json:"k"` + + // m + // Required: true + M *int32 `json:"m"` +} + +// Validate validates this allocatable ec storage capacity +func (m *AllocatableEcStorageCapacity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCapacity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateK(formats); err != nil { + res = append(res, err) + } + + if err := m.validateM(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AllocatableEcStorageCapacity) validateCapacity(formats strfmt.Registry) error { + + if err := validate.Required("capacity", "body", m.Capacity); err != nil { + return err + } + + return nil +} + +func (m *AllocatableEcStorageCapacity) validateK(formats strfmt.Registry) error { + + if err := validate.Required("k", "body", m.K); err != nil { + return err + } + + return nil +} + +func (m *AllocatableEcStorageCapacity) validateM(formats strfmt.Registry) error { + + if err := validate.Required("m", "body", m.M); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this allocatable ec storage capacity based on context it is used +func (m *AllocatableEcStorageCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AllocatableEcStorageCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AllocatableEcStorageCapacity) UnmarshalBinary(b []byte) error { + var res AllocatableEcStorageCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/allocatable_replica_storage_capacity.go b/models/allocatable_replica_storage_capacity.go new file mode 100644 index 00000000..aaff4fc2 --- /dev/null +++ b/models/allocatable_replica_storage_capacity.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AllocatableReplicaStorageCapacity allocatable replica storage capacity +// +// swagger:model AllocatableReplicaStorageCapacity +type AllocatableReplicaStorageCapacity struct { + + // capacity + // Required: true + Capacity *float64 `json:"capacity"` + + // replica num + // Required: true + ReplicaNum *int32 `json:"replica_num"` +} + +// Validate validates this allocatable replica storage capacity +func (m *AllocatableReplicaStorageCapacity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCapacity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicaNum(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AllocatableReplicaStorageCapacity) validateCapacity(formats strfmt.Registry) error { + + if err := validate.Required("capacity", "body", m.Capacity); err != nil { + return err + } + + return nil +} + +func (m *AllocatableReplicaStorageCapacity) validateReplicaNum(formats strfmt.Registry) error { + + if err := validate.Required("replica_num", "body", m.ReplicaNum); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this allocatable replica storage capacity based on context it is used +func (m *AllocatableReplicaStorageCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AllocatableReplicaStorageCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AllocatableReplicaStorageCapacity) UnmarshalBinary(b []byte) error { + var res AllocatableReplicaStorageCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/allocatable_storage_capacity.go b/models/allocatable_storage_capacity.go new file mode 100644 index 00000000..748ee3db --- /dev/null +++ b/models/allocatable_storage_capacity.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AllocatableStorageCapacity allocatable storage capacity +// +// swagger:model AllocatableStorageCapacity +type AllocatableStorageCapacity struct { + + // ec + Ec []*AllocatableEcStorageCapacity `json:"ec,omitempty"` + + // replica + Replica []*AllocatableReplicaStorageCapacity `json:"replica,omitempty"` +} + +// Validate validates this allocatable storage capacity +func (m *AllocatableStorageCapacity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplica(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AllocatableStorageCapacity) validateEc(formats strfmt.Registry) error { + if swag.IsZero(m.Ec) { // not required + return nil + } + + for i := 0; i < len(m.Ec); i++ { + if swag.IsZero(m.Ec[i]) { // not required + continue + } + + if m.Ec[i] != nil { + if err := m.Ec[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ec" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ec" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AllocatableStorageCapacity) validateReplica(formats strfmt.Registry) error { + if swag.IsZero(m.Replica) { // not required + return nil + } + + for i := 0; i < len(m.Replica); i++ { + if swag.IsZero(m.Replica[i]) { // not required + continue + } + + if m.Replica[i] != nil { + if err := m.Replica[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this allocatable storage capacity based on the context it is used +func (m *AllocatableStorageCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEc(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplica(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AllocatableStorageCapacity) contextValidateEc(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ec); i++ { + + if m.Ec[i] != nil { + if err := m.Ec[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ec" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ec" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AllocatableStorageCapacity) contextValidateReplica(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Replica); i++ { + + if m.Replica[i] != nil { + if err := m.Replica[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AllocatableStorageCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AllocatableStorageCapacity) UnmarshalBinary(b []byte) error { + var res AllocatableStorageCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/backup_plan.go b/models/backup_plan.go index 4c00e25e..05c85000 100644 --- a/models/backup_plan.go +++ b/models/backup_plan.go @@ -20,6 +20,18 @@ import ( // swagger:model BackupPlan type BackupPlan struct { + // backup delay option + BackupDelayOption *BackupPlanDelayOption `json:"backup_delay_option,omitempty"` + + // backup plan executions + BackupPlanExecutions []*NestedBackupPlanExecution `json:"backup_plan_executions,omitempty"` + + // backup restore point count + BackupRestorePointCount *int32 `json:"backup_restore_point_count,omitempty"` + + // backup restore points + BackupRestorePoints []*NestedBackupRestorePoint `json:"backup_restore_points,omitempty"` + // backup service // Required: true BackupService *NestedBackupService `json:"backup_service"` @@ -28,6 +40,9 @@ type BackupPlan struct { // Required: true BackupStoreRepository *NestedBackupStoreRepository `json:"backup_store_repository"` + // backup total size + BackupTotalSize *int64 `json:"backup_total_size,omitempty"` + // compression Compression *bool `json:"compression,omitempty"` @@ -38,6 +53,9 @@ type BackupPlan struct { // Required: true CreatedAt *string `json:"createdAt"` + // delete strategy + DeleteStrategy *BackupPlanDeleteStrategy `json:"delete_strategy,omitempty"` + // description Description *string `json:"description,omitempty"` @@ -88,6 +106,9 @@ type BackupPlan struct { // Required: true LastExecuteStatus *BackupPlanExecutionStatus `json:"last_execute_status"` + // last execute status message + LastExecuteStatusMessage *string `json:"last_execute_status_message,omitempty"` + // last execute success job count LastExecuteSuccessJobCount *int32 `json:"last_execute_success_job_count,omitempty"` @@ -101,6 +122,9 @@ type BackupPlan struct { // Required: true LastManualExecuteStatus *BackupPlanExecutionStatus `json:"last_manual_execute_status"` + // last manual execute status message + LastManualExecuteStatusMessage *string `json:"last_manual_execute_status_message,omitempty"` + // last manual execute success job count LastManualExecuteSuccessJobCount *int32 `json:"last_manual_execute_success_job_count,omitempty"` @@ -110,6 +134,9 @@ type BackupPlan struct { // last manual executed at LastManualExecutedAt *string `json:"last_manual_executed_at,omitempty"` + // logical size + LogicalSize *int64 `json:"logical_size,omitempty"` + // name // Required: true Name *string `json:"name"` @@ -117,6 +144,9 @@ type BackupPlan struct { // next execute time NextExecuteTime *string `json:"next_execute_time,omitempty"` + // phase + Phase *BackupPlanPhase `json:"phase,omitempty"` + // physical size PhysicalSize *int64 `json:"physical_size,omitempty"` @@ -130,6 +160,12 @@ type BackupPlan struct { // valid size of backup object ValidSizeOfBackupObject *int64 `json:"valid_size_of_backup_object,omitempty"` + // valid size of restore point + ValidSizeOfRestorePoint *int64 `json:"valid_size_of_restore_point,omitempty"` + + // vms + Vms []*NestedVM `json:"vms,omitempty"` + // window end WindowEnd *string `json:"window_end,omitempty"` @@ -141,6 +177,18 @@ type BackupPlan struct { func (m *BackupPlan) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBackupDelayOption(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlanExecutions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupRestorePoints(formats); err != nil { + res = append(res, err) + } + if err := m.validateBackupService(formats); err != nil { res = append(res, err) } @@ -153,6 +201,10 @@ func (m *BackupPlan) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteStrategy(formats); err != nil { + res = append(res, err) + } + if err := m.validateEnableWindow(formats); err != nil { res = append(res, err) } @@ -205,6 +257,10 @@ func (m *BackupPlan) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validatePhase(formats); err != nil { + res = append(res, err) + } + if err := m.validateSnapshotConsistentType(formats); err != nil { res = append(res, err) } @@ -213,12 +269,87 @@ func (m *BackupPlan) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVms(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *BackupPlan) validateBackupDelayOption(formats strfmt.Registry) error { + if swag.IsZero(m.BackupDelayOption) { // not required + return nil + } + + if m.BackupDelayOption != nil { + if err := m.BackupDelayOption.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option") + } + return err + } + } + + return nil +} + +func (m *BackupPlan) validateBackupPlanExecutions(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlanExecutions) { // not required + return nil + } + + for i := 0; i < len(m.BackupPlanExecutions); i++ { + if swag.IsZero(m.BackupPlanExecutions[i]) { // not required + continue + } + + if m.BackupPlanExecutions[i] != nil { + if err := m.BackupPlanExecutions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plan_executions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plan_executions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BackupPlan) validateBackupRestorePoints(formats strfmt.Registry) error { + if swag.IsZero(m.BackupRestorePoints) { // not required + return nil + } + + for i := 0; i < len(m.BackupRestorePoints); i++ { + if swag.IsZero(m.BackupRestorePoints[i]) { // not required + continue + } + + if m.BackupRestorePoints[i] != nil { + if err := m.BackupRestorePoints[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_restore_points" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_restore_points" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *BackupPlan) validateBackupService(formats strfmt.Registry) error { if err := validate.Required("backup_service", "body", m.BackupService); err != nil { @@ -268,6 +399,25 @@ func (m *BackupPlan) validateCreatedAt(formats strfmt.Registry) error { return nil } +func (m *BackupPlan) validateDeleteStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteStrategy) { // not required + return nil + } + + if m.DeleteStrategy != nil { + if err := m.DeleteStrategy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy") + } + return err + } + } + + return nil +} + func (m *BackupPlan) validateEnableWindow(formats strfmt.Registry) error { if err := validate.Required("enable_window", "body", m.EnableWindow); err != nil { @@ -506,6 +656,25 @@ func (m *BackupPlan) validateName(formats strfmt.Registry) error { return nil } +func (m *BackupPlan) validatePhase(formats strfmt.Registry) error { + if swag.IsZero(m.Phase) { // not required + return nil + } + + if m.Phase != nil { + if err := m.Phase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase") + } + return err + } + } + + return nil +} + func (m *BackupPlan) validateSnapshotConsistentType(formats strfmt.Registry) error { if swag.IsZero(m.SnapshotConsistentType) { // not required return nil @@ -549,10 +718,48 @@ func (m *BackupPlan) validateStatus(formats strfmt.Registry) error { return nil } +func (m *BackupPlan) validateVms(formats strfmt.Registry) error { + if swag.IsZero(m.Vms) { // not required + return nil + } + + for i := 0; i < len(m.Vms); i++ { + if swag.IsZero(m.Vms[i]) { // not required + continue + } + + if m.Vms[i] != nil { + if err := m.Vms[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this backup plan based on the context it is used func (m *BackupPlan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBackupDelayOption(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlanExecutions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupRestorePoints(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateBackupService(ctx, formats); err != nil { res = append(res, err) } @@ -561,6 +768,10 @@ func (m *BackupPlan) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateDeleteStrategy(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } @@ -597,6 +808,10 @@ func (m *BackupPlan) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidatePhase(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSnapshotConsistentType(ctx, formats); err != nil { res = append(res, err) } @@ -605,12 +820,72 @@ func (m *BackupPlan) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateVms(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *BackupPlan) contextValidateBackupDelayOption(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupDelayOption != nil { + if err := m.BackupDelayOption.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option") + } + return err + } + } + + return nil +} + +func (m *BackupPlan) contextValidateBackupPlanExecutions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BackupPlanExecutions); i++ { + + if m.BackupPlanExecutions[i] != nil { + if err := m.BackupPlanExecutions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plan_executions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plan_executions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BackupPlan) contextValidateBackupRestorePoints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BackupRestorePoints); i++ { + + if m.BackupRestorePoints[i] != nil { + if err := m.BackupRestorePoints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_restore_points" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_restore_points" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *BackupPlan) contextValidateBackupService(ctx context.Context, formats strfmt.Registry) error { if m.BackupService != nil { @@ -643,6 +918,22 @@ func (m *BackupPlan) contextValidateBackupStoreRepository(ctx context.Context, f return nil } +func (m *BackupPlan) contextValidateDeleteStrategy(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteStrategy != nil { + if err := m.DeleteStrategy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy") + } + return err + } + } + + return nil +} + func (m *BackupPlan) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { @@ -793,6 +1084,22 @@ func (m *BackupPlan) contextValidateLastManualExecuteStatus(ctx context.Context, return nil } +func (m *BackupPlan) contextValidatePhase(ctx context.Context, formats strfmt.Registry) error { + + if m.Phase != nil { + if err := m.Phase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase") + } + return err + } + } + + return nil +} + func (m *BackupPlan) contextValidateSnapshotConsistentType(ctx context.Context, formats strfmt.Registry) error { if m.SnapshotConsistentType != nil { @@ -825,6 +1132,26 @@ func (m *BackupPlan) contextValidateStatus(ctx context.Context, formats strfmt.R return nil } +func (m *BackupPlan) contextValidateVms(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Vms); i++ { + + if m.Vms[i] != nil { + if err := m.Vms[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *BackupPlan) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/backup_plan_order_by_input.go b/models/backup_plan_order_by_input.go index 9970de11..cf789162 100644 --- a/models/backup_plan_order_by_input.go +++ b/models/backup_plan_order_by_input.go @@ -30,6 +30,24 @@ func (m BackupPlanOrderByInput) Pointer() *BackupPlanOrderByInput { const ( + // BackupPlanOrderByInputBackupDelayOptionASC captures enum value "backup_delay_option_ASC" + BackupPlanOrderByInputBackupDelayOptionASC BackupPlanOrderByInput = "backup_delay_option_ASC" + + // BackupPlanOrderByInputBackupDelayOptionDESC captures enum value "backup_delay_option_DESC" + BackupPlanOrderByInputBackupDelayOptionDESC BackupPlanOrderByInput = "backup_delay_option_DESC" + + // BackupPlanOrderByInputBackupRestorePointCountASC captures enum value "backup_restore_point_count_ASC" + BackupPlanOrderByInputBackupRestorePointCountASC BackupPlanOrderByInput = "backup_restore_point_count_ASC" + + // BackupPlanOrderByInputBackupRestorePointCountDESC captures enum value "backup_restore_point_count_DESC" + BackupPlanOrderByInputBackupRestorePointCountDESC BackupPlanOrderByInput = "backup_restore_point_count_DESC" + + // BackupPlanOrderByInputBackupTotalSizeASC captures enum value "backup_total_size_ASC" + BackupPlanOrderByInputBackupTotalSizeASC BackupPlanOrderByInput = "backup_total_size_ASC" + + // BackupPlanOrderByInputBackupTotalSizeDESC captures enum value "backup_total_size_DESC" + BackupPlanOrderByInputBackupTotalSizeDESC BackupPlanOrderByInput = "backup_total_size_DESC" + // BackupPlanOrderByInputCompressionASC captures enum value "compression_ASC" BackupPlanOrderByInputCompressionASC BackupPlanOrderByInput = "compression_ASC" @@ -48,6 +66,12 @@ const ( // BackupPlanOrderByInputCreatedAtDESC captures enum value "createdAt_DESC" BackupPlanOrderByInputCreatedAtDESC BackupPlanOrderByInput = "createdAt_DESC" + // BackupPlanOrderByInputDeleteStrategyASC captures enum value "delete_strategy_ASC" + BackupPlanOrderByInputDeleteStrategyASC BackupPlanOrderByInput = "delete_strategy_ASC" + + // BackupPlanOrderByInputDeleteStrategyDESC captures enum value "delete_strategy_DESC" + BackupPlanOrderByInputDeleteStrategyDESC BackupPlanOrderByInput = "delete_strategy_DESC" + // BackupPlanOrderByInputDescriptionASC captures enum value "description_ASC" BackupPlanOrderByInputDescriptionASC BackupPlanOrderByInput = "description_ASC" @@ -126,6 +150,12 @@ const ( // BackupPlanOrderByInputLastExecuteStatusDESC captures enum value "last_execute_status_DESC" BackupPlanOrderByInputLastExecuteStatusDESC BackupPlanOrderByInput = "last_execute_status_DESC" + // BackupPlanOrderByInputLastExecuteStatusMessageASC captures enum value "last_execute_status_message_ASC" + BackupPlanOrderByInputLastExecuteStatusMessageASC BackupPlanOrderByInput = "last_execute_status_message_ASC" + + // BackupPlanOrderByInputLastExecuteStatusMessageDESC captures enum value "last_execute_status_message_DESC" + BackupPlanOrderByInputLastExecuteStatusMessageDESC BackupPlanOrderByInput = "last_execute_status_message_DESC" + // BackupPlanOrderByInputLastExecuteSuccessJobCountASC captures enum value "last_execute_success_job_count_ASC" BackupPlanOrderByInputLastExecuteSuccessJobCountASC BackupPlanOrderByInput = "last_execute_success_job_count_ASC" @@ -150,6 +180,12 @@ const ( // BackupPlanOrderByInputLastManualExecuteStatusDESC captures enum value "last_manual_execute_status_DESC" BackupPlanOrderByInputLastManualExecuteStatusDESC BackupPlanOrderByInput = "last_manual_execute_status_DESC" + // BackupPlanOrderByInputLastManualExecuteStatusMessageASC captures enum value "last_manual_execute_status_message_ASC" + BackupPlanOrderByInputLastManualExecuteStatusMessageASC BackupPlanOrderByInput = "last_manual_execute_status_message_ASC" + + // BackupPlanOrderByInputLastManualExecuteStatusMessageDESC captures enum value "last_manual_execute_status_message_DESC" + BackupPlanOrderByInputLastManualExecuteStatusMessageDESC BackupPlanOrderByInput = "last_manual_execute_status_message_DESC" + // BackupPlanOrderByInputLastManualExecuteSuccessJobCountASC captures enum value "last_manual_execute_success_job_count_ASC" BackupPlanOrderByInputLastManualExecuteSuccessJobCountASC BackupPlanOrderByInput = "last_manual_execute_success_job_count_ASC" @@ -168,6 +204,12 @@ const ( // BackupPlanOrderByInputLastManualExecutedAtDESC captures enum value "last_manual_executed_at_DESC" BackupPlanOrderByInputLastManualExecutedAtDESC BackupPlanOrderByInput = "last_manual_executed_at_DESC" + // BackupPlanOrderByInputLogicalSizeASC captures enum value "logical_size_ASC" + BackupPlanOrderByInputLogicalSizeASC BackupPlanOrderByInput = "logical_size_ASC" + + // BackupPlanOrderByInputLogicalSizeDESC captures enum value "logical_size_DESC" + BackupPlanOrderByInputLogicalSizeDESC BackupPlanOrderByInput = "logical_size_DESC" + // BackupPlanOrderByInputNameASC captures enum value "name_ASC" BackupPlanOrderByInputNameASC BackupPlanOrderByInput = "name_ASC" @@ -180,6 +222,12 @@ const ( // BackupPlanOrderByInputNextExecuteTimeDESC captures enum value "next_execute_time_DESC" BackupPlanOrderByInputNextExecuteTimeDESC BackupPlanOrderByInput = "next_execute_time_DESC" + // BackupPlanOrderByInputPhaseASC captures enum value "phase_ASC" + BackupPlanOrderByInputPhaseASC BackupPlanOrderByInput = "phase_ASC" + + // BackupPlanOrderByInputPhaseDESC captures enum value "phase_DESC" + BackupPlanOrderByInputPhaseDESC BackupPlanOrderByInput = "phase_DESC" + // BackupPlanOrderByInputPhysicalSizeASC captures enum value "physical_size_ASC" BackupPlanOrderByInputPhysicalSizeASC BackupPlanOrderByInput = "physical_size_ASC" @@ -204,6 +252,12 @@ const ( // BackupPlanOrderByInputValidSizeOfBackupObjectDESC captures enum value "valid_size_of_backup_object_DESC" BackupPlanOrderByInputValidSizeOfBackupObjectDESC BackupPlanOrderByInput = "valid_size_of_backup_object_DESC" + // BackupPlanOrderByInputValidSizeOfRestorePointASC captures enum value "valid_size_of_restore_point_ASC" + BackupPlanOrderByInputValidSizeOfRestorePointASC BackupPlanOrderByInput = "valid_size_of_restore_point_ASC" + + // BackupPlanOrderByInputValidSizeOfRestorePointDESC captures enum value "valid_size_of_restore_point_DESC" + BackupPlanOrderByInputValidSizeOfRestorePointDESC BackupPlanOrderByInput = "valid_size_of_restore_point_DESC" + // BackupPlanOrderByInputWindowEndASC captures enum value "window_end_ASC" BackupPlanOrderByInputWindowEndASC BackupPlanOrderByInput = "window_end_ASC" @@ -222,7 +276,7 @@ var backupPlanOrderByInputEnum []interface{} func init() { var res []BackupPlanOrderByInput - if err := json.Unmarshal([]byte(`["compression_ASC","compression_DESC","compression_ratio_ASC","compression_ratio_DESC","createdAt_ASC","createdAt_DESC","description_ASC","description_DESC","enable_window_ASC","enable_window_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","full_interval_ASC","full_interval_DESC","full_period_ASC","full_period_DESC","full_time_point_ASC","full_time_point_DESC","id_ASC","id_DESC","incremental_interval_ASC","incremental_interval_DESC","incremental_period_ASC","incremental_period_DESC","incremental_time_points_ASC","incremental_time_points_DESC","keep_policy_ASC","keep_policy_DESC","keep_policy_value_ASC","keep_policy_value_DESC","last_execute_status_ASC","last_execute_status_DESC","last_execute_success_job_count_ASC","last_execute_success_job_count_DESC","last_execute_total_job_count_ASC","last_execute_total_job_count_DESC","last_executed_at_ASC","last_executed_at_DESC","last_manual_execute_status_ASC","last_manual_execute_status_DESC","last_manual_execute_success_job_count_ASC","last_manual_execute_success_job_count_DESC","last_manual_execute_total_job_count_ASC","last_manual_execute_total_job_count_DESC","last_manual_executed_at_ASC","last_manual_executed_at_DESC","name_ASC","name_DESC","next_execute_time_ASC","next_execute_time_DESC","physical_size_ASC","physical_size_DESC","snapshot_consistent_type_ASC","snapshot_consistent_type_DESC","status_ASC","status_DESC","valid_size_of_backup_object_ASC","valid_size_of_backup_object_DESC","window_end_ASC","window_end_DESC","window_start_ASC","window_start_DESC"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["backup_delay_option_ASC","backup_delay_option_DESC","backup_restore_point_count_ASC","backup_restore_point_count_DESC","backup_total_size_ASC","backup_total_size_DESC","compression_ASC","compression_DESC","compression_ratio_ASC","compression_ratio_DESC","createdAt_ASC","createdAt_DESC","delete_strategy_ASC","delete_strategy_DESC","description_ASC","description_DESC","enable_window_ASC","enable_window_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","full_interval_ASC","full_interval_DESC","full_period_ASC","full_period_DESC","full_time_point_ASC","full_time_point_DESC","id_ASC","id_DESC","incremental_interval_ASC","incremental_interval_DESC","incremental_period_ASC","incremental_period_DESC","incremental_time_points_ASC","incremental_time_points_DESC","keep_policy_ASC","keep_policy_DESC","keep_policy_value_ASC","keep_policy_value_DESC","last_execute_status_ASC","last_execute_status_DESC","last_execute_status_message_ASC","last_execute_status_message_DESC","last_execute_success_job_count_ASC","last_execute_success_job_count_DESC","last_execute_total_job_count_ASC","last_execute_total_job_count_DESC","last_executed_at_ASC","last_executed_at_DESC","last_manual_execute_status_ASC","last_manual_execute_status_DESC","last_manual_execute_status_message_ASC","last_manual_execute_status_message_DESC","last_manual_execute_success_job_count_ASC","last_manual_execute_success_job_count_DESC","last_manual_execute_total_job_count_ASC","last_manual_execute_total_job_count_DESC","last_manual_executed_at_ASC","last_manual_executed_at_DESC","logical_size_ASC","logical_size_DESC","name_ASC","name_DESC","next_execute_time_ASC","next_execute_time_DESC","phase_ASC","phase_DESC","physical_size_ASC","physical_size_DESC","snapshot_consistent_type_ASC","snapshot_consistent_type_DESC","status_ASC","status_DESC","valid_size_of_backup_object_ASC","valid_size_of_backup_object_DESC","valid_size_of_restore_point_ASC","valid_size_of_restore_point_DESC","window_end_ASC","window_end_DESC","window_start_ASC","window_start_DESC"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/backup_plan_phase.go b/models/backup_plan_phase.go new file mode 100644 index 00000000..1f0e0df7 --- /dev/null +++ b/models/backup_plan_phase.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// BackupPlanPhase backup plan phase +// +// swagger:model BackupPlanPhase +type BackupPlanPhase string + +func NewBackupPlanPhase(value BackupPlanPhase) *BackupPlanPhase { + return &value +} + +// Pointer returns a pointer to a freshly-allocated BackupPlanPhase. +func (m BackupPlanPhase) Pointer() *BackupPlanPhase { + return &m +} + +const ( + + // BackupPlanPhaseINVALID captures enum value "INVALID" + BackupPlanPhaseINVALID BackupPlanPhase = "INVALID" + + // BackupPlanPhasePAUSED captures enum value "PAUSED" + BackupPlanPhasePAUSED BackupPlanPhase = "PAUSED" + + // BackupPlanPhaseSCHEDULING captures enum value "SCHEDULING" + BackupPlanPhaseSCHEDULING BackupPlanPhase = "SCHEDULING" + + // BackupPlanPhaseSTOPPED captures enum value "STOPPED" + BackupPlanPhaseSTOPPED BackupPlanPhase = "STOPPED" + + // BackupPlanPhaseVALIDATING captures enum value "VALIDATING" + BackupPlanPhaseVALIDATING BackupPlanPhase = "VALIDATING" + + // BackupPlanPhaseWAITINGSCHEDULE captures enum value "WAITING_SCHEDULE" + BackupPlanPhaseWAITINGSCHEDULE BackupPlanPhase = "WAITING_SCHEDULE" +) + +// for schema +var backupPlanPhaseEnum []interface{} + +func init() { + var res []BackupPlanPhase + if err := json.Unmarshal([]byte(`["INVALID","PAUSED","SCHEDULING","STOPPED","VALIDATING","WAITING_SCHEDULE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + backupPlanPhaseEnum = append(backupPlanPhaseEnum, v) + } +} + +func (m BackupPlanPhase) validateBackupPlanPhaseEnum(path, location string, value BackupPlanPhase) error { + if err := validate.EnumCase(path, location, value, backupPlanPhaseEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this backup plan phase +func (m BackupPlanPhase) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateBackupPlanPhaseEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this backup plan phase based on context it is used +func (m BackupPlanPhase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/models/backup_plan_where_input.go b/models/backup_plan_where_input.go index 150820bf..2f95b2ef 100644 --- a/models/backup_plan_where_input.go +++ b/models/backup_plan_where_input.go @@ -28,12 +28,90 @@ type BackupPlanWhereInput struct { // o r OR []*BackupPlanWhereInput `json:"OR,omitempty"` + // backup delay option + BackupDelayOption *BackupPlanDelayOption `json:"backup_delay_option,omitempty"` + + // backup delay option in + BackupDelayOptionIn []BackupPlanDelayOption `json:"backup_delay_option_in,omitempty"` + + // backup delay option not + BackupDelayOptionNot *BackupPlanDelayOption `json:"backup_delay_option_not,omitempty"` + + // backup delay option not in + BackupDelayOptionNotIn []BackupPlanDelayOption `json:"backup_delay_option_not_in,omitempty"` + + // backup plan executions every + BackupPlanExecutionsEvery *BackupPlanExecutionWhereInput `json:"backup_plan_executions_every,omitempty"` + + // backup plan executions none + BackupPlanExecutionsNone *BackupPlanExecutionWhereInput `json:"backup_plan_executions_none,omitempty"` + + // backup plan executions some + BackupPlanExecutionsSome *BackupPlanExecutionWhereInput `json:"backup_plan_executions_some,omitempty"` + + // backup restore point count + BackupRestorePointCount *int32 `json:"backup_restore_point_count,omitempty"` + + // backup restore point count gt + BackupRestorePointCountGt *int32 `json:"backup_restore_point_count_gt,omitempty"` + + // backup restore point count gte + BackupRestorePointCountGte *int32 `json:"backup_restore_point_count_gte,omitempty"` + + // backup restore point count in + BackupRestorePointCountIn []int32 `json:"backup_restore_point_count_in,omitempty"` + + // backup restore point count lt + BackupRestorePointCountLt *int32 `json:"backup_restore_point_count_lt,omitempty"` + + // backup restore point count lte + BackupRestorePointCountLte *int32 `json:"backup_restore_point_count_lte,omitempty"` + + // backup restore point count not + BackupRestorePointCountNot *int32 `json:"backup_restore_point_count_not,omitempty"` + + // backup restore point count not in + BackupRestorePointCountNotIn []int32 `json:"backup_restore_point_count_not_in,omitempty"` + + // backup restore points every + BackupRestorePointsEvery *BackupRestorePointWhereInput `json:"backup_restore_points_every,omitempty"` + + // backup restore points none + BackupRestorePointsNone *BackupRestorePointWhereInput `json:"backup_restore_points_none,omitempty"` + + // backup restore points some + BackupRestorePointsSome *BackupRestorePointWhereInput `json:"backup_restore_points_some,omitempty"` + // backup service BackupService *BackupServiceWhereInput `json:"backup_service,omitempty"` // backup store repository BackupStoreRepository *BackupStoreRepositoryWhereInput `json:"backup_store_repository,omitempty"` + // backup total size + BackupTotalSize *int64 `json:"backup_total_size,omitempty"` + + // backup total size gt + BackupTotalSizeGt *int64 `json:"backup_total_size_gt,omitempty"` + + // backup total size gte + BackupTotalSizeGte *int64 `json:"backup_total_size_gte,omitempty"` + + // backup total size in + BackupTotalSizeIn []int64 `json:"backup_total_size_in,omitempty"` + + // backup total size lt + BackupTotalSizeLt *int64 `json:"backup_total_size_lt,omitempty"` + + // backup total size lte + BackupTotalSizeLte *int64 `json:"backup_total_size_lte,omitempty"` + + // backup total size not + BackupTotalSizeNot *int64 `json:"backup_total_size_not,omitempty"` + + // backup total size not in + BackupTotalSizeNotIn []int64 `json:"backup_total_size_not_in,omitempty"` + // compression Compression *bool `json:"compression,omitempty"` @@ -88,6 +166,18 @@ type BackupPlanWhereInput struct { // created at not in CreatedAtNotIn []string `json:"createdAt_not_in,omitempty"` + // delete strategy + DeleteStrategy *BackupPlanDeleteStrategy `json:"delete_strategy,omitempty"` + + // delete strategy in + DeleteStrategyIn []BackupPlanDeleteStrategy `json:"delete_strategy_in,omitempty"` + + // delete strategy not + DeleteStrategyNot *BackupPlanDeleteStrategy `json:"delete_strategy_not,omitempty"` + + // delete strategy not in + DeleteStrategyNotIn []BackupPlanDeleteStrategy `json:"delete_strategy_not_in,omitempty"` + // description Description *string `json:"description,omitempty"` @@ -304,6 +394,48 @@ type BackupPlanWhereInput struct { // last execute status in LastExecuteStatusIn []BackupPlanExecutionStatus `json:"last_execute_status_in,omitempty"` + // last execute status message + LastExecuteStatusMessage *string `json:"last_execute_status_message,omitempty"` + + // last execute status message contains + LastExecuteStatusMessageContains *string `json:"last_execute_status_message_contains,omitempty"` + + // last execute status message ends with + LastExecuteStatusMessageEndsWith *string `json:"last_execute_status_message_ends_with,omitempty"` + + // last execute status message gt + LastExecuteStatusMessageGt *string `json:"last_execute_status_message_gt,omitempty"` + + // last execute status message gte + LastExecuteStatusMessageGte *string `json:"last_execute_status_message_gte,omitempty"` + + // last execute status message in + LastExecuteStatusMessageIn []string `json:"last_execute_status_message_in,omitempty"` + + // last execute status message lt + LastExecuteStatusMessageLt *string `json:"last_execute_status_message_lt,omitempty"` + + // last execute status message lte + LastExecuteStatusMessageLte *string `json:"last_execute_status_message_lte,omitempty"` + + // last execute status message not + LastExecuteStatusMessageNot *string `json:"last_execute_status_message_not,omitempty"` + + // last execute status message not contains + LastExecuteStatusMessageNotContains *string `json:"last_execute_status_message_not_contains,omitempty"` + + // last execute status message not ends with + LastExecuteStatusMessageNotEndsWith *string `json:"last_execute_status_message_not_ends_with,omitempty"` + + // last execute status message not in + LastExecuteStatusMessageNotIn []string `json:"last_execute_status_message_not_in,omitempty"` + + // last execute status message not starts with + LastExecuteStatusMessageNotStartsWith *string `json:"last_execute_status_message_not_starts_with,omitempty"` + + // last execute status message starts with + LastExecuteStatusMessageStartsWith *string `json:"last_execute_status_message_starts_with,omitempty"` + // last execute status not LastExecuteStatusNot *BackupPlanExecutionStatus `json:"last_execute_status_not,omitempty"` @@ -388,6 +520,48 @@ type BackupPlanWhereInput struct { // last manual execute status in LastManualExecuteStatusIn []BackupPlanExecutionStatus `json:"last_manual_execute_status_in,omitempty"` + // last manual execute status message + LastManualExecuteStatusMessage *string `json:"last_manual_execute_status_message,omitempty"` + + // last manual execute status message contains + LastManualExecuteStatusMessageContains *string `json:"last_manual_execute_status_message_contains,omitempty"` + + // last manual execute status message ends with + LastManualExecuteStatusMessageEndsWith *string `json:"last_manual_execute_status_message_ends_with,omitempty"` + + // last manual execute status message gt + LastManualExecuteStatusMessageGt *string `json:"last_manual_execute_status_message_gt,omitempty"` + + // last manual execute status message gte + LastManualExecuteStatusMessageGte *string `json:"last_manual_execute_status_message_gte,omitempty"` + + // last manual execute status message in + LastManualExecuteStatusMessageIn []string `json:"last_manual_execute_status_message_in,omitempty"` + + // last manual execute status message lt + LastManualExecuteStatusMessageLt *string `json:"last_manual_execute_status_message_lt,omitempty"` + + // last manual execute status message lte + LastManualExecuteStatusMessageLte *string `json:"last_manual_execute_status_message_lte,omitempty"` + + // last manual execute status message not + LastManualExecuteStatusMessageNot *string `json:"last_manual_execute_status_message_not,omitempty"` + + // last manual execute status message not contains + LastManualExecuteStatusMessageNotContains *string `json:"last_manual_execute_status_message_not_contains,omitempty"` + + // last manual execute status message not ends with + LastManualExecuteStatusMessageNotEndsWith *string `json:"last_manual_execute_status_message_not_ends_with,omitempty"` + + // last manual execute status message not in + LastManualExecuteStatusMessageNotIn []string `json:"last_manual_execute_status_message_not_in,omitempty"` + + // last manual execute status message not starts with + LastManualExecuteStatusMessageNotStartsWith *string `json:"last_manual_execute_status_message_not_starts_with,omitempty"` + + // last manual execute status message starts with + LastManualExecuteStatusMessageStartsWith *string `json:"last_manual_execute_status_message_starts_with,omitempty"` + // last manual execute status not LastManualExecuteStatusNot *BackupPlanExecutionStatus `json:"last_manual_execute_status_not,omitempty"` @@ -466,6 +640,30 @@ type BackupPlanWhereInput struct { // last manual executed at not in LastManualExecutedAtNotIn []string `json:"last_manual_executed_at_not_in,omitempty"` + // logical size + LogicalSize *int64 `json:"logical_size,omitempty"` + + // logical size gt + LogicalSizeGt *int64 `json:"logical_size_gt,omitempty"` + + // logical size gte + LogicalSizeGte *int64 `json:"logical_size_gte,omitempty"` + + // logical size in + LogicalSizeIn []int64 `json:"logical_size_in,omitempty"` + + // logical size lt + LogicalSizeLt *int64 `json:"logical_size_lt,omitempty"` + + // logical size lte + LogicalSizeLte *int64 `json:"logical_size_lte,omitempty"` + + // logical size not + LogicalSizeNot *int64 `json:"logical_size_not,omitempty"` + + // logical size not in + LogicalSizeNotIn []int64 `json:"logical_size_not_in,omitempty"` + // name Name *string `json:"name,omitempty"` @@ -532,6 +730,18 @@ type BackupPlanWhereInput struct { // next execute time not in NextExecuteTimeNotIn []string `json:"next_execute_time_not_in,omitempty"` + // phase + Phase *BackupPlanPhase `json:"phase,omitempty"` + + // phase in + PhaseIn []BackupPlanPhase `json:"phase_in,omitempty"` + + // phase not + PhaseNot *BackupPlanPhase `json:"phase_not,omitempty"` + + // phase not in + PhaseNotIn []BackupPlanPhase `json:"phase_not_in,omitempty"` + // physical size PhysicalSize *int64 `json:"physical_size,omitempty"` @@ -604,6 +814,39 @@ type BackupPlanWhereInput struct { // valid size of backup object not in ValidSizeOfBackupObjectNotIn []int64 `json:"valid_size_of_backup_object_not_in,omitempty"` + // valid size of restore point + ValidSizeOfRestorePoint *int64 `json:"valid_size_of_restore_point,omitempty"` + + // valid size of restore point gt + ValidSizeOfRestorePointGt *int64 `json:"valid_size_of_restore_point_gt,omitempty"` + + // valid size of restore point gte + ValidSizeOfRestorePointGte *int64 `json:"valid_size_of_restore_point_gte,omitempty"` + + // valid size of restore point in + ValidSizeOfRestorePointIn []int64 `json:"valid_size_of_restore_point_in,omitempty"` + + // valid size of restore point lt + ValidSizeOfRestorePointLt *int64 `json:"valid_size_of_restore_point_lt,omitempty"` + + // valid size of restore point lte + ValidSizeOfRestorePointLte *int64 `json:"valid_size_of_restore_point_lte,omitempty"` + + // valid size of restore point not + ValidSizeOfRestorePointNot *int64 `json:"valid_size_of_restore_point_not,omitempty"` + + // valid size of restore point not in + ValidSizeOfRestorePointNotIn []int64 `json:"valid_size_of_restore_point_not_in,omitempty"` + + // vms every + VmsEvery *VMWhereInput `json:"vms_every,omitempty"` + + // vms none + VmsNone *VMWhereInput `json:"vms_none,omitempty"` + + // vms some + VmsSome *VMWhereInput `json:"vms_some,omitempty"` + // window end WindowEnd *string `json:"window_end,omitempty"` @@ -705,6 +948,46 @@ func (m *BackupPlanWhereInput) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateBackupDelayOption(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupDelayOptionIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupDelayOptionNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupDelayOptionNotIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlanExecutionsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlanExecutionsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlanExecutionsSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupRestorePointsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupRestorePointsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupRestorePointsSome(formats); err != nil { + res = append(res, err) + } + if err := m.validateBackupService(formats); err != nil { res = append(res, err) } @@ -713,6 +996,22 @@ func (m *BackupPlanWhereInput) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteStrategy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeleteStrategyIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeleteStrategyNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeleteStrategyNotIn(formats); err != nil { + res = append(res, err) + } + if err := m.validateEntityAsyncStatus(formats); err != nil { res = append(res, err) } @@ -809,6 +1108,22 @@ func (m *BackupPlanWhereInput) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validatePhase(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhaseIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhaseNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhaseNotIn(formats); err != nil { + res = append(res, err) + } + if err := m.validateSnapshotConsistentType(formats); err != nil { res = append(res, err) } @@ -841,6 +1156,18 @@ func (m *BackupPlanWhereInput) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVmsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVmsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVmsSome(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -925,17 +1252,17 @@ func (m *BackupPlanWhereInput) validateOR(formats strfmt.Registry) error { return nil } -func (m *BackupPlanWhereInput) validateBackupService(formats strfmt.Registry) error { - if swag.IsZero(m.BackupService) { // not required +func (m *BackupPlanWhereInput) validateBackupDelayOption(formats strfmt.Registry) error { + if swag.IsZero(m.BackupDelayOption) { // not required return nil } - if m.BackupService != nil { - if err := m.BackupService.Validate(formats); err != nil { + if m.BackupDelayOption != nil { + if err := m.BackupDelayOption.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_service") + return ve.ValidateName("backup_delay_option") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_service") + return ce.ValidateName("backup_delay_option") } return err } @@ -944,36 +1271,38 @@ func (m *BackupPlanWhereInput) validateBackupService(formats strfmt.Registry) er return nil } -func (m *BackupPlanWhereInput) validateBackupStoreRepository(formats strfmt.Registry) error { - if swag.IsZero(m.BackupStoreRepository) { // not required +func (m *BackupPlanWhereInput) validateBackupDelayOptionIn(formats strfmt.Registry) error { + if swag.IsZero(m.BackupDelayOptionIn) { // not required return nil } - if m.BackupStoreRepository != nil { - if err := m.BackupStoreRepository.Validate(formats); err != nil { + for i := 0; i < len(m.BackupDelayOptionIn); i++ { + + if err := m.BackupDelayOptionIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_store_repository") + return ve.ValidateName("backup_delay_option_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_store_repository") + return ce.ValidateName("backup_delay_option_in" + "." + strconv.Itoa(i)) } return err } + } return nil } -func (m *BackupPlanWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { - if swag.IsZero(m.EntityAsyncStatus) { // not required +func (m *BackupPlanWhereInput) validateBackupDelayOptionNot(formats strfmt.Registry) error { + if swag.IsZero(m.BackupDelayOptionNot) { // not required return nil } - if m.EntityAsyncStatus != nil { - if err := m.EntityAsyncStatus.Validate(formats); err != nil { + if m.BackupDelayOptionNot != nil { + if err := m.BackupDelayOptionNot.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entityAsyncStatus") + return ve.ValidateName("backup_delay_option_not") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entityAsyncStatus") + return ce.ValidateName("backup_delay_option_not") } return err } @@ -982,18 +1311,18 @@ func (m *BackupPlanWhereInput) validateEntityAsyncStatus(formats strfmt.Registry return nil } -func (m *BackupPlanWhereInput) validateEntityAsyncStatusIn(formats strfmt.Registry) error { - if swag.IsZero(m.EntityAsyncStatusIn) { // not required +func (m *BackupPlanWhereInput) validateBackupDelayOptionNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.BackupDelayOptionNotIn) { // not required return nil } - for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + for i := 0; i < len(m.BackupDelayOptionNotIn); i++ { - if err := m.EntityAsyncStatusIn[i].Validate(formats); err != nil { + if err := m.BackupDelayOptionNotIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("backup_delay_option_not_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("backup_delay_option_not_in" + "." + strconv.Itoa(i)) } return err } @@ -1003,17 +1332,17 @@ func (m *BackupPlanWhereInput) validateEntityAsyncStatusIn(formats strfmt.Regist return nil } -func (m *BackupPlanWhereInput) validateEntityAsyncStatusNot(formats strfmt.Registry) error { - if swag.IsZero(m.EntityAsyncStatusNot) { // not required +func (m *BackupPlanWhereInput) validateBackupPlanExecutionsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlanExecutionsEvery) { // not required return nil } - if m.EntityAsyncStatusNot != nil { - if err := m.EntityAsyncStatusNot.Validate(formats); err != nil { + if m.BackupPlanExecutionsEvery != nil { + if err := m.BackupPlanExecutionsEvery.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entityAsyncStatus_not") + return ve.ValidateName("backup_plan_executions_every") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entityAsyncStatus_not") + return ce.ValidateName("backup_plan_executions_every") } return err } @@ -1022,38 +1351,36 @@ func (m *BackupPlanWhereInput) validateEntityAsyncStatusNot(formats strfmt.Regis return nil } -func (m *BackupPlanWhereInput) validateEntityAsyncStatusNotIn(formats strfmt.Registry) error { - if swag.IsZero(m.EntityAsyncStatusNotIn) { // not required +func (m *BackupPlanWhereInput) validateBackupPlanExecutionsNone(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlanExecutionsNone) { // not required return nil } - for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { - - if err := m.EntityAsyncStatusNotIn[i].Validate(formats); err != nil { + if m.BackupPlanExecutionsNone != nil { + if err := m.BackupPlanExecutionsNone.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("backup_plan_executions_none") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("backup_plan_executions_none") } return err } - } return nil } -func (m *BackupPlanWhereInput) validateFullPeriod(formats strfmt.Registry) error { - if swag.IsZero(m.FullPeriod) { // not required +func (m *BackupPlanWhereInput) validateBackupPlanExecutionsSome(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlanExecutionsSome) { // not required return nil } - if m.FullPeriod != nil { - if err := m.FullPeriod.Validate(formats); err != nil { + if m.BackupPlanExecutionsSome != nil { + if err := m.BackupPlanExecutionsSome.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("full_period") + return ve.ValidateName("backup_plan_executions_some") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("full_period") + return ce.ValidateName("backup_plan_executions_some") } return err } @@ -1062,38 +1389,36 @@ func (m *BackupPlanWhereInput) validateFullPeriod(formats strfmt.Registry) error return nil } -func (m *BackupPlanWhereInput) validateFullPeriodIn(formats strfmt.Registry) error { - if swag.IsZero(m.FullPeriodIn) { // not required +func (m *BackupPlanWhereInput) validateBackupRestorePointsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.BackupRestorePointsEvery) { // not required return nil } - for i := 0; i < len(m.FullPeriodIn); i++ { - - if err := m.FullPeriodIn[i].Validate(formats); err != nil { + if m.BackupRestorePointsEvery != nil { + if err := m.BackupRestorePointsEvery.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("full_period_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("backup_restore_points_every") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("full_period_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("backup_restore_points_every") } return err } - } return nil } -func (m *BackupPlanWhereInput) validateFullPeriodNot(formats strfmt.Registry) error { - if swag.IsZero(m.FullPeriodNot) { // not required +func (m *BackupPlanWhereInput) validateBackupRestorePointsNone(formats strfmt.Registry) error { + if swag.IsZero(m.BackupRestorePointsNone) { // not required return nil } - if m.FullPeriodNot != nil { - if err := m.FullPeriodNot.Validate(formats); err != nil { + if m.BackupRestorePointsNone != nil { + if err := m.BackupRestorePointsNone.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("full_period_not") + return ve.ValidateName("backup_restore_points_none") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("full_period_not") + return ce.ValidateName("backup_restore_points_none") } return err } @@ -1102,38 +1427,36 @@ func (m *BackupPlanWhereInput) validateFullPeriodNot(formats strfmt.Registry) er return nil } -func (m *BackupPlanWhereInput) validateFullPeriodNotIn(formats strfmt.Registry) error { - if swag.IsZero(m.FullPeriodNotIn) { // not required +func (m *BackupPlanWhereInput) validateBackupRestorePointsSome(formats strfmt.Registry) error { + if swag.IsZero(m.BackupRestorePointsSome) { // not required return nil } - for i := 0; i < len(m.FullPeriodNotIn); i++ { - - if err := m.FullPeriodNotIn[i].Validate(formats); err != nil { + if m.BackupRestorePointsSome != nil { + if err := m.BackupRestorePointsSome.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("full_period_not_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("backup_restore_points_some") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("full_period_not_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("backup_restore_points_some") } return err } - } return nil } -func (m *BackupPlanWhereInput) validateIncrementalPeriod(formats strfmt.Registry) error { - if swag.IsZero(m.IncrementalPeriod) { // not required +func (m *BackupPlanWhereInput) validateBackupService(formats strfmt.Registry) error { + if swag.IsZero(m.BackupService) { // not required return nil } - if m.IncrementalPeriod != nil { - if err := m.IncrementalPeriod.Validate(formats); err != nil { + if m.BackupService != nil { + if err := m.BackupService.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("incremental_period") + return ve.ValidateName("backup_service") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("incremental_period") + return ce.ValidateName("backup_service") } return err } @@ -1142,38 +1465,36 @@ func (m *BackupPlanWhereInput) validateIncrementalPeriod(formats strfmt.Registry return nil } -func (m *BackupPlanWhereInput) validateIncrementalPeriodIn(formats strfmt.Registry) error { - if swag.IsZero(m.IncrementalPeriodIn) { // not required +func (m *BackupPlanWhereInput) validateBackupStoreRepository(formats strfmt.Registry) error { + if swag.IsZero(m.BackupStoreRepository) { // not required return nil } - for i := 0; i < len(m.IncrementalPeriodIn); i++ { - - if err := m.IncrementalPeriodIn[i].Validate(formats); err != nil { + if m.BackupStoreRepository != nil { + if err := m.BackupStoreRepository.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("incremental_period_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("backup_store_repository") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("incremental_period_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("backup_store_repository") } return err } - } return nil } -func (m *BackupPlanWhereInput) validateIncrementalPeriodNot(formats strfmt.Registry) error { - if swag.IsZero(m.IncrementalPeriodNot) { // not required +func (m *BackupPlanWhereInput) validateDeleteStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteStrategy) { // not required return nil } - if m.IncrementalPeriodNot != nil { - if err := m.IncrementalPeriodNot.Validate(formats); err != nil { + if m.DeleteStrategy != nil { + if err := m.DeleteStrategy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("incremental_period_not") + return ve.ValidateName("delete_strategy") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("incremental_period_not") + return ce.ValidateName("delete_strategy") } return err } @@ -1182,18 +1503,18 @@ func (m *BackupPlanWhereInput) validateIncrementalPeriodNot(formats strfmt.Regis return nil } -func (m *BackupPlanWhereInput) validateIncrementalPeriodNotIn(formats strfmt.Registry) error { - if swag.IsZero(m.IncrementalPeriodNotIn) { // not required +func (m *BackupPlanWhereInput) validateDeleteStrategyIn(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteStrategyIn) { // not required return nil } - for i := 0; i < len(m.IncrementalPeriodNotIn); i++ { + for i := 0; i < len(m.DeleteStrategyIn); i++ { - if err := m.IncrementalPeriodNotIn[i].Validate(formats); err != nil { + if err := m.DeleteStrategyIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("incremental_period_not_in" + "." + strconv.Itoa(i)) + return ve.ValidateName("delete_strategy_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("incremental_period_not_in" + "." + strconv.Itoa(i)) + return ce.ValidateName("delete_strategy_in" + "." + strconv.Itoa(i)) } return err } @@ -1203,17 +1524,297 @@ func (m *BackupPlanWhereInput) validateIncrementalPeriodNotIn(formats strfmt.Reg return nil } -func (m *BackupPlanWhereInput) validateKeepPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.KeepPolicy) { // not required +func (m *BackupPlanWhereInput) validateDeleteStrategyNot(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteStrategyNot) { // not required return nil } - if m.KeepPolicy != nil { - if err := m.KeepPolicy.Validate(formats); err != nil { + if m.DeleteStrategyNot != nil { + if err := m.DeleteStrategyNot.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keep_policy") + return ve.ValidateName("delete_strategy_not") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keep_policy") + return ce.ValidateName("delete_strategy_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateDeleteStrategyNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteStrategyNotIn) { // not required + return nil + } + + for i := 0; i < len(m.DeleteStrategyNotIn); i++ { + + if err := m.DeleteStrategyNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatus) { // not required + return nil + } + + if m.EntityAsyncStatus != nil { + if err := m.EntityAsyncStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateEntityAsyncStatusIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + + if err := m.EntityAsyncStatusIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateEntityAsyncStatusNot(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNot) { // not required + return nil + } + + if m.EntityAsyncStatusNot != nil { + if err := m.EntityAsyncStatusNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateEntityAsyncStatusNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNotIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { + + if err := m.EntityAsyncStatusNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateFullPeriod(formats strfmt.Registry) error { + if swag.IsZero(m.FullPeriod) { // not required + return nil + } + + if m.FullPeriod != nil { + if err := m.FullPeriod.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("full_period") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("full_period") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateFullPeriodIn(formats strfmt.Registry) error { + if swag.IsZero(m.FullPeriodIn) { // not required + return nil + } + + for i := 0; i < len(m.FullPeriodIn); i++ { + + if err := m.FullPeriodIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("full_period_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("full_period_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateFullPeriodNot(formats strfmt.Registry) error { + if swag.IsZero(m.FullPeriodNot) { // not required + return nil + } + + if m.FullPeriodNot != nil { + if err := m.FullPeriodNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("full_period_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("full_period_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateFullPeriodNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.FullPeriodNotIn) { // not required + return nil + } + + for i := 0; i < len(m.FullPeriodNotIn); i++ { + + if err := m.FullPeriodNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("full_period_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("full_period_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateIncrementalPeriod(formats strfmt.Registry) error { + if swag.IsZero(m.IncrementalPeriod) { // not required + return nil + } + + if m.IncrementalPeriod != nil { + if err := m.IncrementalPeriod.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incremental_period") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incremental_period") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateIncrementalPeriodIn(formats strfmt.Registry) error { + if swag.IsZero(m.IncrementalPeriodIn) { // not required + return nil + } + + for i := 0; i < len(m.IncrementalPeriodIn); i++ { + + if err := m.IncrementalPeriodIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incremental_period_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incremental_period_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateIncrementalPeriodNot(formats strfmt.Registry) error { + if swag.IsZero(m.IncrementalPeriodNot) { // not required + return nil + } + + if m.IncrementalPeriodNot != nil { + if err := m.IncrementalPeriodNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incremental_period_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incremental_period_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateIncrementalPeriodNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.IncrementalPeriodNotIn) { // not required + return nil + } + + for i := 0; i < len(m.IncrementalPeriodNotIn); i++ { + + if err := m.IncrementalPeriodNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incremental_period_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incremental_period_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validateKeepPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.KeepPolicy) { // not required + return nil + } + + if m.KeepPolicy != nil { + if err := m.KeepPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keep_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keep_policy") } return err } @@ -1443,6 +2044,86 @@ func (m *BackupPlanWhereInput) validateLastManualExecuteStatusNotIn(formats strf return nil } +func (m *BackupPlanWhereInput) validatePhase(formats strfmt.Registry) error { + if swag.IsZero(m.Phase) { // not required + return nil + } + + if m.Phase != nil { + if err := m.Phase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validatePhaseIn(formats strfmt.Registry) error { + if swag.IsZero(m.PhaseIn) { // not required + return nil + } + + for i := 0; i < len(m.PhaseIn); i++ { + + if err := m.PhaseIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) validatePhaseNot(formats strfmt.Registry) error { + if swag.IsZero(m.PhaseNot) { // not required + return nil + } + + if m.PhaseNot != nil { + if err := m.PhaseNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validatePhaseNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.PhaseNotIn) { // not required + return nil + } + + for i := 0; i < len(m.PhaseNotIn); i++ { + + if err := m.PhaseNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *BackupPlanWhereInput) validateSnapshotConsistentType(formats strfmt.Registry) error { if swag.IsZero(m.SnapshotConsistentType) { // not required return nil @@ -1603,6 +2284,63 @@ func (m *BackupPlanWhereInput) validateStatusNotIn(formats strfmt.Registry) erro return nil } +func (m *BackupPlanWhereInput) validateVmsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.VmsEvery) { // not required + return nil + } + + if m.VmsEvery != nil { + if err := m.VmsEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_every") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateVmsNone(formats strfmt.Registry) error { + if swag.IsZero(m.VmsNone) { // not required + return nil + } + + if m.VmsNone != nil { + if err := m.VmsNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_none") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) validateVmsSome(formats strfmt.Registry) error { + if swag.IsZero(m.VmsSome) { // not required + return nil + } + + if m.VmsSome != nil { + if err := m.VmsSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_some") + } + return err + } + } + + return nil +} + // ContextValidate validate this backup plan where input based on the context it is used func (m *BackupPlanWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -1619,6 +2357,46 @@ func (m *BackupPlanWhereInput) ContextValidate(ctx context.Context, formats strf res = append(res, err) } + if err := m.contextValidateBackupDelayOption(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupDelayOptionIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupDelayOptionNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupDelayOptionNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlanExecutionsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlanExecutionsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlanExecutionsSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupRestorePointsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupRestorePointsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupRestorePointsSome(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateBackupService(ctx, formats); err != nil { res = append(res, err) } @@ -1627,6 +2405,22 @@ func (m *BackupPlanWhereInput) ContextValidate(ctx context.Context, formats strf res = append(res, err) } + if err := m.contextValidateDeleteStrategy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeleteStrategyIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeleteStrategyNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeleteStrategyNotIn(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } @@ -1707,19 +2501,35 @@ func (m *BackupPlanWhereInput) ContextValidate(ctx context.Context, formats strf res = append(res, err) } - if err := m.contextValidateLastManualExecuteStatus(ctx, formats); err != nil { + if err := m.contextValidateLastManualExecuteStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastManualExecuteStatusIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastManualExecuteStatusNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastManualExecuteStatusNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePhase(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastManualExecuteStatusIn(ctx, formats); err != nil { + if err := m.contextValidatePhaseIn(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastManualExecuteStatusNot(ctx, formats); err != nil { + if err := m.contextValidatePhaseNot(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastManualExecuteStatusNotIn(ctx, formats); err != nil { + if err := m.contextValidatePhaseNotIn(ctx, formats); err != nil { res = append(res, err) } @@ -1755,6 +2565,18 @@ func (m *BackupPlanWhereInput) ContextValidate(ctx context.Context, formats strf res = append(res, err) } + if err := m.contextValidateVmsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVmsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVmsSome(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -1821,6 +2643,170 @@ func (m *BackupPlanWhereInput) contextValidateOR(ctx context.Context, formats st return nil } +func (m *BackupPlanWhereInput) contextValidateBackupDelayOption(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupDelayOption != nil { + if err := m.BackupDelayOption.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupDelayOptionIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BackupDelayOptionIn); i++ { + + if err := m.BackupDelayOptionIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupDelayOptionNot(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupDelayOptionNot != nil { + if err := m.BackupDelayOptionNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupDelayOptionNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BackupDelayOptionNotIn); i++ { + + if err := m.BackupDelayOptionNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_delay_option_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_delay_option_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupPlanExecutionsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlanExecutionsEvery != nil { + if err := m.BackupPlanExecutionsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plan_executions_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plan_executions_every") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupPlanExecutionsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlanExecutionsNone != nil { + if err := m.BackupPlanExecutionsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plan_executions_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plan_executions_none") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupPlanExecutionsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlanExecutionsSome != nil { + if err := m.BackupPlanExecutionsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plan_executions_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plan_executions_some") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupRestorePointsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupRestorePointsEvery != nil { + if err := m.BackupRestorePointsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_restore_points_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_restore_points_every") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupRestorePointsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupRestorePointsNone != nil { + if err := m.BackupRestorePointsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_restore_points_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_restore_points_none") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateBackupRestorePointsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupRestorePointsSome != nil { + if err := m.BackupRestorePointsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_restore_points_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_restore_points_some") + } + return err + } + } + + return nil +} + func (m *BackupPlanWhereInput) contextValidateBackupService(ctx context.Context, formats strfmt.Registry) error { if m.BackupService != nil { @@ -1853,6 +2839,74 @@ func (m *BackupPlanWhereInput) contextValidateBackupStoreRepository(ctx context. return nil } +func (m *BackupPlanWhereInput) contextValidateDeleteStrategy(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteStrategy != nil { + if err := m.DeleteStrategy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateDeleteStrategyIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DeleteStrategyIn); i++ { + + if err := m.DeleteStrategyIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateDeleteStrategyNot(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteStrategyNot != nil { + if err := m.DeleteStrategyNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateDeleteStrategyNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DeleteStrategyNotIn); i++ { + + if err := m.DeleteStrategyNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("delete_strategy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("delete_strategy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *BackupPlanWhereInput) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { @@ -2261,6 +3315,74 @@ func (m *BackupPlanWhereInput) contextValidateLastManualExecuteStatusNotIn(ctx c return nil } +func (m *BackupPlanWhereInput) contextValidatePhase(ctx context.Context, formats strfmt.Registry) error { + + if m.Phase != nil { + if err := m.Phase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidatePhaseIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PhaseIn); i++ { + + if err := m.PhaseIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidatePhaseNot(ctx context.Context, formats strfmt.Registry) error { + + if m.PhaseNot != nil { + if err := m.PhaseNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_not") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidatePhaseNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PhaseNotIn); i++ { + + if err := m.PhaseNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("phase_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *BackupPlanWhereInput) contextValidateSnapshotConsistentType(ctx context.Context, formats strfmt.Registry) error { if m.SnapshotConsistentType != nil { @@ -2397,6 +3519,54 @@ func (m *BackupPlanWhereInput) contextValidateStatusNotIn(ctx context.Context, f return nil } +func (m *BackupPlanWhereInput) contextValidateVmsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.VmsEvery != nil { + if err := m.VmsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_every") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateVmsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.VmsNone != nil { + if err := m.VmsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_none") + } + return err + } + } + + return nil +} + +func (m *BackupPlanWhereInput) contextValidateVmsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.VmsSome != nil { + if err := m.VmsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vms_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vms_some") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *BackupPlanWhereInput) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/backup_restore_point_where_unique_input.go b/models/backup_restore_point_where_unique_input.go new file mode 100644 index 00000000..cad2371a --- /dev/null +++ b/models/backup_restore_point_where_unique_input.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackupRestorePointWhereUniqueInput backup restore point where unique input +// +// swagger:model BackupRestorePointWhereUniqueInput +type BackupRestorePointWhereUniqueInput struct { + + // id + ID *string `json:"id,omitempty"` + + // local id + LocalID *string `json:"local_id,omitempty"` +} + +// Validate validates this backup restore point where unique input +func (m *BackupRestorePointWhereUniqueInput) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this backup restore point where unique input based on context it is used +func (m *BackupRestorePointWhereUniqueInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BackupRestorePointWhereUniqueInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupRestorePointWhereUniqueInput) UnmarshalBinary(b []byte) error { + var res BackupRestorePointWhereUniqueInput + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/cluster_storage_info.go b/models/cluster_storage_info.go new file mode 100644 index 00000000..29a64c1f --- /dev/null +++ b/models/cluster_storage_info.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClusterStorageInfo cluster storage info +// +// swagger:model ClusterStorageInfo +type ClusterStorageInfo struct { + + // allocable storage capacity + AllocableStorageCapacity *AllocatableStorageCapacity `json:"allocable_storage_capacity,omitempty"` + + // failure data space + FailureDataSpace *int64 `json:"failure_data_space,omitempty"` + + // free data space + FreeDataSpace *int64 `json:"free_data_space,omitempty"` + + // id + // Required: true + ID *string `json:"id"` + + // name + // Required: true + Name *string `json:"name"` + + // storage cluster + StorageCluster []*ClusterStorageInfo `json:"storage_cluster,omitempty"` + + // stretch + Stretch *bool `json:"stretch,omitempty"` + + // total data capacity + TotalDataCapacity *int64 `json:"total_data_capacity,omitempty"` + + // type + // Required: true + Type *ClusterType `json:"type"` + + // used data space + UsedDataSpace *int64 `json:"used_data_space,omitempty"` +} + +// Validate validates this cluster storage info +func (m *ClusterStorageInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAllocableStorageCapacity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageCluster(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterStorageInfo) validateAllocableStorageCapacity(formats strfmt.Registry) error { + if swag.IsZero(m.AllocableStorageCapacity) { // not required + return nil + } + + if m.AllocableStorageCapacity != nil { + if err := m.AllocableStorageCapacity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("allocable_storage_capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("allocable_storage_capacity") + } + return err + } + } + + return nil +} + +func (m *ClusterStorageInfo) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ClusterStorageInfo) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ClusterStorageInfo) validateStorageCluster(formats strfmt.Registry) error { + if swag.IsZero(m.StorageCluster) { // not required + return nil + } + + for i := 0; i < len(m.StorageCluster); i++ { + if swag.IsZero(m.StorageCluster[i]) { // not required + continue + } + + if m.StorageCluster[i] != nil { + if err := m.StorageCluster[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_cluster" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_cluster" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ClusterStorageInfo) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cluster storage info based on the context it is used +func (m *ClusterStorageInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAllocableStorageCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterStorageInfo) contextValidateAllocableStorageCapacity(ctx context.Context, formats strfmt.Registry) error { + + if m.AllocableStorageCapacity != nil { + if err := m.AllocableStorageCapacity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("allocable_storage_capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("allocable_storage_capacity") + } + return err + } + } + + return nil +} + +func (m *ClusterStorageInfo) contextValidateStorageCluster(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StorageCluster); i++ { + + if m.StorageCluster[i] != nil { + if err := m.StorageCluster[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_cluster" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_cluster" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ClusterStorageInfo) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterStorageInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterStorageInfo) UnmarshalBinary(b []byte) error { + var res ClusterStorageInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/cluster_storage_info_ec_config.go b/models/cluster_storage_info_ec_config.go new file mode 100644 index 00000000..dfd70e76 --- /dev/null +++ b/models/cluster_storage_info_ec_config.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClusterStorageInfoEcConfig cluster storage info ec config +// +// swagger:model ClusterStorageInfoEcConfig +type ClusterStorageInfoEcConfig struct { + + // k + // Required: true + K *int32 `json:"k"` + + // m + // Required: true + M *int32 `json:"m"` +} + +// Validate validates this cluster storage info ec config +func (m *ClusterStorageInfoEcConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateK(formats); err != nil { + res = append(res, err) + } + + if err := m.validateM(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterStorageInfoEcConfig) validateK(formats strfmt.Registry) error { + + if err := validate.Required("k", "body", m.K); err != nil { + return err + } + + return nil +} + +func (m *ClusterStorageInfoEcConfig) validateM(formats strfmt.Registry) error { + + if err := validate.Required("m", "body", m.M); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this cluster storage info ec config based on context it is used +func (m *ClusterStorageInfoEcConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterStorageInfoEcConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterStorageInfoEcConfig) UnmarshalBinary(b []byte) error { + var res ClusterStorageInfoEcConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/content_library_vm_template.go b/models/content_library_vm_template.go index cc984443..21e1cffc 100644 --- a/models/content_library_vm_template.go +++ b/models/content_library_vm_template.go @@ -24,6 +24,9 @@ type ContentLibraryVMTemplate struct { // Required: true Architecture *Architecture `json:"architecture"` + // clock offset + ClockOffset *VMClockOffset `json:"clock_offset,omitempty"` + // cloud init supported // Required: true CloudInitSupported *bool `json:"cloud_init_supported"` @@ -31,6 +34,12 @@ type ContentLibraryVMTemplate struct { // clusters Clusters []*NestedCluster `json:"clusters,omitempty"` + // cpu + CPU *NestedCPU `json:"cpu,omitempty"` + + // cpu model + CPUModel *string `json:"cpu_model,omitempty"` + // created at // Required: true CreatedAt *string `json:"createdAt"` @@ -42,13 +51,34 @@ type ContentLibraryVMTemplate struct { // entity async status EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` + // firmware + Firmware *VMFirmware `json:"firmware,omitempty"` + + // ha + Ha *bool `json:"ha,omitempty"` + // id // Required: true ID *string `json:"id"` + // io policy + IoPolicy *VMDiskIoPolicy `json:"io_policy,omitempty"` + // labels Labels []*NestedLabel `json:"labels,omitempty"` + // max bandwidth + MaxBandwidth *int64 `json:"max_bandwidth,omitempty"` + + // max bandwidth policy + MaxBandwidthPolicy *VMDiskIoRestrictType `json:"max_bandwidth_policy,omitempty"` + + // max iops + MaxIops *int32 `json:"max_iops,omitempty"` + + // max iops policy + MaxIopsPolicy *VMDiskIoRestrictType `json:"max_iops_policy,omitempty"` + // memory // Required: true Memory *int64 `json:"memory"` @@ -64,16 +94,34 @@ type ContentLibraryVMTemplate struct { // Required: true Size *int64 `json:"size"` + // template config + TemplateConfig *NestedTemplateConfig `json:"template_config,omitempty"` + // vcpu // Required: true Vcpu *int32 `json:"vcpu"` + // video type + VideoType *string `json:"video_type,omitempty"` + + // vm disks + VMDisks []*NestedContentLibraryVMTemplateDisk `json:"vm_disks,omitempty"` + + // vm nics + VMNics []*NestedContentLibraryVMTemplateNic `json:"vm_nics,omitempty"` + // vm template uuids // Required: true VMTemplateUuids []string `json:"vm_template_uuids"` // vm templates VMTemplates []*NestedVMTemplate `json:"vm_templates,omitempty"` + + // win opt + WinOpt *bool `json:"win_opt,omitempty"` + + // zbs storage info + ZbsStorageInfo []*NestedZbsStorageInfo `json:"zbs_storage_info,omitempty"` } // Validate validates this content library Vm template @@ -84,6 +132,10 @@ func (m *ContentLibraryVMTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateClockOffset(formats); err != nil { + res = append(res, err) + } + if err := m.validateCloudInitSupported(formats); err != nil { res = append(res, err) } @@ -92,6 +144,10 @@ func (m *ContentLibraryVMTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCPU(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreatedAt(formats); err != nil { res = append(res, err) } @@ -104,14 +160,30 @@ func (m *ContentLibraryVMTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateFirmware(formats); err != nil { + res = append(res, err) + } + if err := m.validateID(formats); err != nil { res = append(res, err) } + if err := m.validateIoPolicy(formats); err != nil { + res = append(res, err) + } + if err := m.validateLabels(formats); err != nil { res = append(res, err) } + if err := m.validateMaxBandwidthPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicy(formats); err != nil { + res = append(res, err) + } + if err := m.validateMemory(formats); err != nil { res = append(res, err) } @@ -124,10 +196,22 @@ func (m *ContentLibraryVMTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTemplateConfig(formats); err != nil { + res = append(res, err) + } + if err := m.validateVcpu(formats); err != nil { res = append(res, err) } + if err := m.validateVMDisks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVMNics(formats); err != nil { + res = append(res, err) + } + if err := m.validateVMTemplateUuids(formats); err != nil { res = append(res, err) } @@ -136,6 +220,10 @@ func (m *ContentLibraryVMTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateZbsStorageInfo(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -166,6 +254,25 @@ func (m *ContentLibraryVMTemplate) validateArchitecture(formats strfmt.Registry) return nil } +func (m *ContentLibraryVMTemplate) validateClockOffset(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffset) { // not required + return nil + } + + if m.ClockOffset != nil { + if err := m.ClockOffset.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateCloudInitSupported(formats strfmt.Registry) error { if err := validate.Required("cloud_init_supported", "body", m.CloudInitSupported); err != nil { @@ -201,6 +308,25 @@ func (m *ContentLibraryVMTemplate) validateClusters(formats strfmt.Registry) err return nil } +func (m *ContentLibraryVMTemplate) validateCPU(formats strfmt.Registry) error { + if swag.IsZero(m.CPU) { // not required + return nil + } + + if m.CPU != nil { + if err := m.CPU.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cpu") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cpu") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateCreatedAt(formats strfmt.Registry) error { if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil { @@ -238,6 +364,25 @@ func (m *ContentLibraryVMTemplate) validateEntityAsyncStatus(formats strfmt.Regi return nil } +func (m *ContentLibraryVMTemplate) validateFirmware(formats strfmt.Registry) error { + if swag.IsZero(m.Firmware) { // not required + return nil + } + + if m.Firmware != nil { + if err := m.Firmware.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { @@ -247,6 +392,25 @@ func (m *ContentLibraryVMTemplate) validateID(formats strfmt.Registry) error { return nil } +func (m *ContentLibraryVMTemplate) validateIoPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicy) { // not required + return nil + } + + if m.IoPolicy != nil { + if err := m.IoPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateLabels(formats strfmt.Registry) error { if swag.IsZero(m.Labels) { // not required return nil @@ -273,6 +437,44 @@ func (m *ContentLibraryVMTemplate) validateLabels(formats strfmt.Registry) error return nil } +func (m *ContentLibraryVMTemplate) validateMaxBandwidthPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicy) { // not required + return nil + } + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplate) validateMaxIopsPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicy) { // not required + return nil + } + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateMemory(formats strfmt.Registry) error { if err := validate.Required("memory", "body", m.Memory); err != nil { @@ -300,6 +502,25 @@ func (m *ContentLibraryVMTemplate) validateSize(formats strfmt.Registry) error { return nil } +func (m *ContentLibraryVMTemplate) validateTemplateConfig(formats strfmt.Registry) error { + if swag.IsZero(m.TemplateConfig) { // not required + return nil + } + + if m.TemplateConfig != nil { + if err := m.TemplateConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_config") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateVcpu(formats strfmt.Registry) error { if err := validate.Required("vcpu", "body", m.Vcpu); err != nil { @@ -309,6 +530,58 @@ func (m *ContentLibraryVMTemplate) validateVcpu(formats strfmt.Registry) error { return nil } +func (m *ContentLibraryVMTemplate) validateVMDisks(formats strfmt.Registry) error { + if swag.IsZero(m.VMDisks) { // not required + return nil + } + + for i := 0; i < len(m.VMDisks); i++ { + if swag.IsZero(m.VMDisks[i]) { // not required + continue + } + + if m.VMDisks[i] != nil { + if err := m.VMDisks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplate) validateVMNics(formats strfmt.Registry) error { + if swag.IsZero(m.VMNics) { // not required + return nil + } + + for i := 0; i < len(m.VMNics); i++ { + if swag.IsZero(m.VMNics[i]) { // not required + continue + } + + if m.VMNics[i] != nil { + if err := m.VMNics[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ContentLibraryVMTemplate) validateVMTemplateUuids(formats strfmt.Registry) error { if err := validate.Required("vm_template_uuids", "body", m.VMTemplateUuids); err != nil { @@ -344,6 +617,32 @@ func (m *ContentLibraryVMTemplate) validateVMTemplates(formats strfmt.Registry) return nil } +func (m *ContentLibraryVMTemplate) validateZbsStorageInfo(formats strfmt.Registry) error { + if swag.IsZero(m.ZbsStorageInfo) { // not required + return nil + } + + for i := 0; i < len(m.ZbsStorageInfo); i++ { + if swag.IsZero(m.ZbsStorageInfo[i]) { // not required + continue + } + + if m.ZbsStorageInfo[i] != nil { + if err := m.ZbsStorageInfo[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("zbs_storage_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("zbs_storage_info" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this content library Vm template based on the context it is used func (m *ContentLibraryVMTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -352,22 +651,62 @@ func (m *ContentLibraryVMTemplate) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateClockOffset(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateClusters(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateCPU(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateFirmware(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicy(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLabels(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateMaxBandwidthPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxIopsPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTemplateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMDisks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMNics(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateVMTemplates(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateZbsStorageInfo(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -390,6 +729,22 @@ func (m *ContentLibraryVMTemplate) contextValidateArchitecture(ctx context.Conte return nil } +func (m *ContentLibraryVMTemplate) contextValidateClockOffset(ctx context.Context, formats strfmt.Registry) error { + + if m.ClockOffset != nil { + if err := m.ClockOffset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) contextValidateClusters(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Clusters); i++ { @@ -410,6 +765,22 @@ func (m *ContentLibraryVMTemplate) contextValidateClusters(ctx context.Context, return nil } +func (m *ContentLibraryVMTemplate) contextValidateCPU(ctx context.Context, formats strfmt.Registry) error { + + if m.CPU != nil { + if err := m.CPU.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cpu") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cpu") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { @@ -426,6 +797,38 @@ func (m *ContentLibraryVMTemplate) contextValidateEntityAsyncStatus(ctx context. return nil } +func (m *ContentLibraryVMTemplate) contextValidateFirmware(ctx context.Context, formats strfmt.Registry) error { + + if m.Firmware != nil { + if err := m.Firmware.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplate) contextValidateIoPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.IoPolicy != nil { + if err := m.IoPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy") + } + return err + } + } + + return nil +} + func (m *ContentLibraryVMTemplate) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Labels); i++ { @@ -446,6 +849,94 @@ func (m *ContentLibraryVMTemplate) contextValidateLabels(ctx context.Context, fo return nil } +func (m *ContentLibraryVMTemplate) contextValidateMaxBandwidthPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplate) contextValidateMaxIopsPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplate) contextValidateTemplateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.TemplateConfig != nil { + if err := m.TemplateConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_config") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplate) contextValidateVMDisks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VMDisks); i++ { + + if m.VMDisks[i] != nil { + if err := m.VMDisks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplate) contextValidateVMNics(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VMNics); i++ { + + if m.VMNics[i] != nil { + if err := m.VMNics[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ContentLibraryVMTemplate) contextValidateVMTemplates(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.VMTemplates); i++ { @@ -466,6 +957,26 @@ func (m *ContentLibraryVMTemplate) contextValidateVMTemplates(ctx context.Contex return nil } +func (m *ContentLibraryVMTemplate) contextValidateZbsStorageInfo(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ZbsStorageInfo); i++ { + + if m.ZbsStorageInfo[i] != nil { + if err := m.ZbsStorageInfo[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("zbs_storage_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("zbs_storage_info" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ContentLibraryVMTemplate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/content_library_vm_template_order_by_input.go b/models/content_library_vm_template_order_by_input.go index 0facea4c..e62091ca 100644 --- a/models/content_library_vm_template_order_by_input.go +++ b/models/content_library_vm_template_order_by_input.go @@ -36,12 +36,30 @@ const ( // ContentLibraryVMTemplateOrderByInputArchitectureDESC captures enum value "architecture_DESC" ContentLibraryVMTemplateOrderByInputArchitectureDESC ContentLibraryVMTemplateOrderByInput = "architecture_DESC" + // ContentLibraryVMTemplateOrderByInputClockOffsetASC captures enum value "clock_offset_ASC" + ContentLibraryVMTemplateOrderByInputClockOffsetASC ContentLibraryVMTemplateOrderByInput = "clock_offset_ASC" + + // ContentLibraryVMTemplateOrderByInputClockOffsetDESC captures enum value "clock_offset_DESC" + ContentLibraryVMTemplateOrderByInputClockOffsetDESC ContentLibraryVMTemplateOrderByInput = "clock_offset_DESC" + // ContentLibraryVMTemplateOrderByInputCloudInitSupportedASC captures enum value "cloud_init_supported_ASC" ContentLibraryVMTemplateOrderByInputCloudInitSupportedASC ContentLibraryVMTemplateOrderByInput = "cloud_init_supported_ASC" // ContentLibraryVMTemplateOrderByInputCloudInitSupportedDESC captures enum value "cloud_init_supported_DESC" ContentLibraryVMTemplateOrderByInputCloudInitSupportedDESC ContentLibraryVMTemplateOrderByInput = "cloud_init_supported_DESC" + // ContentLibraryVMTemplateOrderByInputCPUASC captures enum value "cpu_ASC" + ContentLibraryVMTemplateOrderByInputCPUASC ContentLibraryVMTemplateOrderByInput = "cpu_ASC" + + // ContentLibraryVMTemplateOrderByInputCPUDESC captures enum value "cpu_DESC" + ContentLibraryVMTemplateOrderByInputCPUDESC ContentLibraryVMTemplateOrderByInput = "cpu_DESC" + + // ContentLibraryVMTemplateOrderByInputCPUModelASC captures enum value "cpu_model_ASC" + ContentLibraryVMTemplateOrderByInputCPUModelASC ContentLibraryVMTemplateOrderByInput = "cpu_model_ASC" + + // ContentLibraryVMTemplateOrderByInputCPUModelDESC captures enum value "cpu_model_DESC" + ContentLibraryVMTemplateOrderByInputCPUModelDESC ContentLibraryVMTemplateOrderByInput = "cpu_model_DESC" + // ContentLibraryVMTemplateOrderByInputCreatedAtASC captures enum value "createdAt_ASC" ContentLibraryVMTemplateOrderByInputCreatedAtASC ContentLibraryVMTemplateOrderByInput = "createdAt_ASC" @@ -60,12 +78,54 @@ const ( // ContentLibraryVMTemplateOrderByInputEntityAsyncStatusDESC captures enum value "entityAsyncStatus_DESC" ContentLibraryVMTemplateOrderByInputEntityAsyncStatusDESC ContentLibraryVMTemplateOrderByInput = "entityAsyncStatus_DESC" + // ContentLibraryVMTemplateOrderByInputFirmwareASC captures enum value "firmware_ASC" + ContentLibraryVMTemplateOrderByInputFirmwareASC ContentLibraryVMTemplateOrderByInput = "firmware_ASC" + + // ContentLibraryVMTemplateOrderByInputFirmwareDESC captures enum value "firmware_DESC" + ContentLibraryVMTemplateOrderByInputFirmwareDESC ContentLibraryVMTemplateOrderByInput = "firmware_DESC" + + // ContentLibraryVMTemplateOrderByInputHaASC captures enum value "ha_ASC" + ContentLibraryVMTemplateOrderByInputHaASC ContentLibraryVMTemplateOrderByInput = "ha_ASC" + + // ContentLibraryVMTemplateOrderByInputHaDESC captures enum value "ha_DESC" + ContentLibraryVMTemplateOrderByInputHaDESC ContentLibraryVMTemplateOrderByInput = "ha_DESC" + // ContentLibraryVMTemplateOrderByInputIDASC captures enum value "id_ASC" ContentLibraryVMTemplateOrderByInputIDASC ContentLibraryVMTemplateOrderByInput = "id_ASC" // ContentLibraryVMTemplateOrderByInputIDDESC captures enum value "id_DESC" ContentLibraryVMTemplateOrderByInputIDDESC ContentLibraryVMTemplateOrderByInput = "id_DESC" + // ContentLibraryVMTemplateOrderByInputIoPolicyASC captures enum value "io_policy_ASC" + ContentLibraryVMTemplateOrderByInputIoPolicyASC ContentLibraryVMTemplateOrderByInput = "io_policy_ASC" + + // ContentLibraryVMTemplateOrderByInputIoPolicyDESC captures enum value "io_policy_DESC" + ContentLibraryVMTemplateOrderByInputIoPolicyDESC ContentLibraryVMTemplateOrderByInput = "io_policy_DESC" + + // ContentLibraryVMTemplateOrderByInputMaxBandwidthASC captures enum value "max_bandwidth_ASC" + ContentLibraryVMTemplateOrderByInputMaxBandwidthASC ContentLibraryVMTemplateOrderByInput = "max_bandwidth_ASC" + + // ContentLibraryVMTemplateOrderByInputMaxBandwidthDESC captures enum value "max_bandwidth_DESC" + ContentLibraryVMTemplateOrderByInputMaxBandwidthDESC ContentLibraryVMTemplateOrderByInput = "max_bandwidth_DESC" + + // ContentLibraryVMTemplateOrderByInputMaxBandwidthPolicyASC captures enum value "max_bandwidth_policy_ASC" + ContentLibraryVMTemplateOrderByInputMaxBandwidthPolicyASC ContentLibraryVMTemplateOrderByInput = "max_bandwidth_policy_ASC" + + // ContentLibraryVMTemplateOrderByInputMaxBandwidthPolicyDESC captures enum value "max_bandwidth_policy_DESC" + ContentLibraryVMTemplateOrderByInputMaxBandwidthPolicyDESC ContentLibraryVMTemplateOrderByInput = "max_bandwidth_policy_DESC" + + // ContentLibraryVMTemplateOrderByInputMaxIopsASC captures enum value "max_iops_ASC" + ContentLibraryVMTemplateOrderByInputMaxIopsASC ContentLibraryVMTemplateOrderByInput = "max_iops_ASC" + + // ContentLibraryVMTemplateOrderByInputMaxIopsDESC captures enum value "max_iops_DESC" + ContentLibraryVMTemplateOrderByInputMaxIopsDESC ContentLibraryVMTemplateOrderByInput = "max_iops_DESC" + + // ContentLibraryVMTemplateOrderByInputMaxIopsPolicyASC captures enum value "max_iops_policy_ASC" + ContentLibraryVMTemplateOrderByInputMaxIopsPolicyASC ContentLibraryVMTemplateOrderByInput = "max_iops_policy_ASC" + + // ContentLibraryVMTemplateOrderByInputMaxIopsPolicyDESC captures enum value "max_iops_policy_DESC" + ContentLibraryVMTemplateOrderByInputMaxIopsPolicyDESC ContentLibraryVMTemplateOrderByInput = "max_iops_policy_DESC" + // ContentLibraryVMTemplateOrderByInputMemoryASC captures enum value "memory_ASC" ContentLibraryVMTemplateOrderByInputMemoryASC ContentLibraryVMTemplateOrderByInput = "memory_ASC" @@ -90,11 +150,47 @@ const ( // ContentLibraryVMTemplateOrderByInputSizeDESC captures enum value "size_DESC" ContentLibraryVMTemplateOrderByInputSizeDESC ContentLibraryVMTemplateOrderByInput = "size_DESC" + // ContentLibraryVMTemplateOrderByInputTemplateConfigASC captures enum value "template_config_ASC" + ContentLibraryVMTemplateOrderByInputTemplateConfigASC ContentLibraryVMTemplateOrderByInput = "template_config_ASC" + + // ContentLibraryVMTemplateOrderByInputTemplateConfigDESC captures enum value "template_config_DESC" + ContentLibraryVMTemplateOrderByInputTemplateConfigDESC ContentLibraryVMTemplateOrderByInput = "template_config_DESC" + // ContentLibraryVMTemplateOrderByInputVcpuASC captures enum value "vcpu_ASC" ContentLibraryVMTemplateOrderByInputVcpuASC ContentLibraryVMTemplateOrderByInput = "vcpu_ASC" // ContentLibraryVMTemplateOrderByInputVcpuDESC captures enum value "vcpu_DESC" ContentLibraryVMTemplateOrderByInputVcpuDESC ContentLibraryVMTemplateOrderByInput = "vcpu_DESC" + + // ContentLibraryVMTemplateOrderByInputVideoTypeASC captures enum value "video_type_ASC" + ContentLibraryVMTemplateOrderByInputVideoTypeASC ContentLibraryVMTemplateOrderByInput = "video_type_ASC" + + // ContentLibraryVMTemplateOrderByInputVideoTypeDESC captures enum value "video_type_DESC" + ContentLibraryVMTemplateOrderByInputVideoTypeDESC ContentLibraryVMTemplateOrderByInput = "video_type_DESC" + + // ContentLibraryVMTemplateOrderByInputVMDisksASC captures enum value "vm_disks_ASC" + ContentLibraryVMTemplateOrderByInputVMDisksASC ContentLibraryVMTemplateOrderByInput = "vm_disks_ASC" + + // ContentLibraryVMTemplateOrderByInputVMDisksDESC captures enum value "vm_disks_DESC" + ContentLibraryVMTemplateOrderByInputVMDisksDESC ContentLibraryVMTemplateOrderByInput = "vm_disks_DESC" + + // ContentLibraryVMTemplateOrderByInputVMNicsASC captures enum value "vm_nics_ASC" + ContentLibraryVMTemplateOrderByInputVMNicsASC ContentLibraryVMTemplateOrderByInput = "vm_nics_ASC" + + // ContentLibraryVMTemplateOrderByInputVMNicsDESC captures enum value "vm_nics_DESC" + ContentLibraryVMTemplateOrderByInputVMNicsDESC ContentLibraryVMTemplateOrderByInput = "vm_nics_DESC" + + // ContentLibraryVMTemplateOrderByInputWinOptASC captures enum value "win_opt_ASC" + ContentLibraryVMTemplateOrderByInputWinOptASC ContentLibraryVMTemplateOrderByInput = "win_opt_ASC" + + // ContentLibraryVMTemplateOrderByInputWinOptDESC captures enum value "win_opt_DESC" + ContentLibraryVMTemplateOrderByInputWinOptDESC ContentLibraryVMTemplateOrderByInput = "win_opt_DESC" + + // ContentLibraryVMTemplateOrderByInputZbsStorageInfoASC captures enum value "zbs_storage_info_ASC" + ContentLibraryVMTemplateOrderByInputZbsStorageInfoASC ContentLibraryVMTemplateOrderByInput = "zbs_storage_info_ASC" + + // ContentLibraryVMTemplateOrderByInputZbsStorageInfoDESC captures enum value "zbs_storage_info_DESC" + ContentLibraryVMTemplateOrderByInputZbsStorageInfoDESC ContentLibraryVMTemplateOrderByInput = "zbs_storage_info_DESC" ) // for schema @@ -102,7 +198,7 @@ var contentLibraryVmTemplateOrderByInputEnum []interface{} func init() { var res []ContentLibraryVMTemplateOrderByInput - if err := json.Unmarshal([]byte(`["architecture_ASC","architecture_DESC","cloud_init_supported_ASC","cloud_init_supported_DESC","createdAt_ASC","createdAt_DESC","description_ASC","description_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","id_ASC","id_DESC","memory_ASC","memory_DESC","name_ASC","name_DESC","os_ASC","os_DESC","size_ASC","size_DESC","vcpu_ASC","vcpu_DESC"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["architecture_ASC","architecture_DESC","clock_offset_ASC","clock_offset_DESC","cloud_init_supported_ASC","cloud_init_supported_DESC","cpu_ASC","cpu_DESC","cpu_model_ASC","cpu_model_DESC","createdAt_ASC","createdAt_DESC","description_ASC","description_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","firmware_ASC","firmware_DESC","ha_ASC","ha_DESC","id_ASC","id_DESC","io_policy_ASC","io_policy_DESC","max_bandwidth_ASC","max_bandwidth_DESC","max_bandwidth_policy_ASC","max_bandwidth_policy_DESC","max_iops_ASC","max_iops_DESC","max_iops_policy_ASC","max_iops_policy_DESC","memory_ASC","memory_DESC","name_ASC","name_DESC","os_ASC","os_DESC","size_ASC","size_DESC","template_config_ASC","template_config_DESC","vcpu_ASC","vcpu_DESC","video_type_ASC","video_type_DESC","vm_disks_ASC","vm_disks_DESC","vm_nics_ASC","vm_nics_DESC","win_opt_ASC","win_opt_DESC","zbs_storage_info_ASC","zbs_storage_info_DESC"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/content_library_vm_template_where_input.go b/models/content_library_vm_template_where_input.go index 798aced7..a9f2d686 100644 --- a/models/content_library_vm_template_where_input.go +++ b/models/content_library_vm_template_where_input.go @@ -40,6 +40,18 @@ type ContentLibraryVMTemplateWhereInput struct { // architecture not in ArchitectureNotIn []Architecture `json:"architecture_not_in,omitempty"` + // clock offset + ClockOffset *VMClockOffset `json:"clock_offset,omitempty"` + + // clock offset in + ClockOffsetIn []VMClockOffset `json:"clock_offset_in,omitempty"` + + // clock offset not + ClockOffsetNot *VMClockOffset `json:"clock_offset_not,omitempty"` + + // clock offset not in + ClockOffsetNotIn []VMClockOffset `json:"clock_offset_not_in,omitempty"` + // cloud init supported CloudInitSupported *bool `json:"cloud_init_supported,omitempty"` @@ -55,6 +67,48 @@ type ContentLibraryVMTemplateWhereInput struct { // clusters some ClustersSome *ClusterWhereInput `json:"clusters_some,omitempty"` + // cpu model + CPUModel *string `json:"cpu_model,omitempty"` + + // cpu model contains + CPUModelContains *string `json:"cpu_model_contains,omitempty"` + + // cpu model ends with + CPUModelEndsWith *string `json:"cpu_model_ends_with,omitempty"` + + // cpu model gt + CPUModelGt *string `json:"cpu_model_gt,omitempty"` + + // cpu model gte + CPUModelGte *string `json:"cpu_model_gte,omitempty"` + + // cpu model in + CPUModelIn []string `json:"cpu_model_in,omitempty"` + + // cpu model lt + CPUModelLt *string `json:"cpu_model_lt,omitempty"` + + // cpu model lte + CPUModelLte *string `json:"cpu_model_lte,omitempty"` + + // cpu model not + CPUModelNot *string `json:"cpu_model_not,omitempty"` + + // cpu model not contains + CPUModelNotContains *string `json:"cpu_model_not_contains,omitempty"` + + // cpu model not ends with + CPUModelNotEndsWith *string `json:"cpu_model_not_ends_with,omitempty"` + + // cpu model not in + CPUModelNotIn []string `json:"cpu_model_not_in,omitempty"` + + // cpu model not starts with + CPUModelNotStartsWith *string `json:"cpu_model_not_starts_with,omitempty"` + + // cpu model starts with + CPUModelStartsWith *string `json:"cpu_model_starts_with,omitempty"` + // created at CreatedAt *string `json:"createdAt,omitempty"` @@ -133,6 +187,24 @@ type ContentLibraryVMTemplateWhereInput struct { // entity async status not in EntityAsyncStatusNotIn []EntityAsyncStatus `json:"entityAsyncStatus_not_in,omitempty"` + // firmware + Firmware *VMFirmware `json:"firmware,omitempty"` + + // firmware in + FirmwareIn []VMFirmware `json:"firmware_in,omitempty"` + + // firmware not + FirmwareNot *VMFirmware `json:"firmware_not,omitempty"` + + // firmware not in + FirmwareNotIn []VMFirmware `json:"firmware_not_in,omitempty"` + + // ha + Ha *bool `json:"ha,omitempty"` + + // ha not + HaNot *bool `json:"ha_not,omitempty"` + // id ID *string `json:"id,omitempty"` @@ -175,6 +247,18 @@ type ContentLibraryVMTemplateWhereInput struct { // id starts with IDStartsWith *string `json:"id_starts_with,omitempty"` + // io policy + IoPolicy *VMDiskIoPolicy `json:"io_policy,omitempty"` + + // io policy in + IoPolicyIn []VMDiskIoPolicy `json:"io_policy_in,omitempty"` + + // io policy not + IoPolicyNot *VMDiskIoPolicy `json:"io_policy_not,omitempty"` + + // io policy not in + IoPolicyNotIn []VMDiskIoPolicy `json:"io_policy_not_in,omitempty"` + // labels every LabelsEvery *LabelWhereInput `json:"labels_every,omitempty"` @@ -184,6 +268,78 @@ type ContentLibraryVMTemplateWhereInput struct { // labels some LabelsSome *LabelWhereInput `json:"labels_some,omitempty"` + // max bandwidth + MaxBandwidth *int64 `json:"max_bandwidth,omitempty"` + + // max bandwidth gt + MaxBandwidthGt *int64 `json:"max_bandwidth_gt,omitempty"` + + // max bandwidth gte + MaxBandwidthGte *int64 `json:"max_bandwidth_gte,omitempty"` + + // max bandwidth in + MaxBandwidthIn []int64 `json:"max_bandwidth_in,omitempty"` + + // max bandwidth lt + MaxBandwidthLt *int64 `json:"max_bandwidth_lt,omitempty"` + + // max bandwidth lte + MaxBandwidthLte *int64 `json:"max_bandwidth_lte,omitempty"` + + // max bandwidth not + MaxBandwidthNot *int64 `json:"max_bandwidth_not,omitempty"` + + // max bandwidth not in + MaxBandwidthNotIn []int64 `json:"max_bandwidth_not_in,omitempty"` + + // max bandwidth policy + MaxBandwidthPolicy *VMDiskIoRestrictType `json:"max_bandwidth_policy,omitempty"` + + // max bandwidth policy in + MaxBandwidthPolicyIn []VMDiskIoRestrictType `json:"max_bandwidth_policy_in,omitempty"` + + // max bandwidth policy not + MaxBandwidthPolicyNot *VMDiskIoRestrictType `json:"max_bandwidth_policy_not,omitempty"` + + // max bandwidth policy not in + MaxBandwidthPolicyNotIn []VMDiskIoRestrictType `json:"max_bandwidth_policy_not_in,omitempty"` + + // max iops + MaxIops *int32 `json:"max_iops,omitempty"` + + // max iops gt + MaxIopsGt *int32 `json:"max_iops_gt,omitempty"` + + // max iops gte + MaxIopsGte *int32 `json:"max_iops_gte,omitempty"` + + // max iops in + MaxIopsIn []int32 `json:"max_iops_in,omitempty"` + + // max iops lt + MaxIopsLt *int32 `json:"max_iops_lt,omitempty"` + + // max iops lte + MaxIopsLte *int32 `json:"max_iops_lte,omitempty"` + + // max iops not + MaxIopsNot *int32 `json:"max_iops_not,omitempty"` + + // max iops not in + MaxIopsNotIn []int32 `json:"max_iops_not_in,omitempty"` + + // max iops policy + MaxIopsPolicy *VMDiskIoRestrictType `json:"max_iops_policy,omitempty"` + + // max iops policy in + MaxIopsPolicyIn []VMDiskIoRestrictType `json:"max_iops_policy_in,omitempty"` + + // max iops policy not + MaxIopsPolicyNot *VMDiskIoRestrictType `json:"max_iops_policy_not,omitempty"` + + // max iops policy not in + MaxIopsPolicyNotIn []VMDiskIoRestrictType `json:"max_iops_policy_not_in,omitempty"` + // memory Memory *int64 `json:"memory,omitempty"` @@ -340,6 +496,48 @@ type ContentLibraryVMTemplateWhereInput struct { // vcpu not in VcpuNotIn []int32 `json:"vcpu_not_in,omitempty"` + // video type + VideoType *string `json:"video_type,omitempty"` + + // video type contains + VideoTypeContains *string `json:"video_type_contains,omitempty"` + + // video type ends with + VideoTypeEndsWith *string `json:"video_type_ends_with,omitempty"` + + // video type gt + VideoTypeGt *string `json:"video_type_gt,omitempty"` + + // video type gte + VideoTypeGte *string `json:"video_type_gte,omitempty"` + + // video type in + VideoTypeIn []string `json:"video_type_in,omitempty"` + + // video type lt + VideoTypeLt *string `json:"video_type_lt,omitempty"` + + // video type lte + VideoTypeLte *string `json:"video_type_lte,omitempty"` + + // video type not + VideoTypeNot *string `json:"video_type_not,omitempty"` + + // video type not contains + VideoTypeNotContains *string `json:"video_type_not_contains,omitempty"` + + // video type not ends with + VideoTypeNotEndsWith *string `json:"video_type_not_ends_with,omitempty"` + + // video type not in + VideoTypeNotIn []string `json:"video_type_not_in,omitempty"` + + // video type not starts with + VideoTypeNotStartsWith *string `json:"video_type_not_starts_with,omitempty"` + + // video type starts with + VideoTypeStartsWith *string `json:"video_type_starts_with,omitempty"` + // vm templates every VMTemplatesEvery *VMTemplateWhereInput `json:"vm_templates_every,omitempty"` @@ -348,6 +546,12 @@ type ContentLibraryVMTemplateWhereInput struct { // vm templates some VMTemplatesSome *VMTemplateWhereInput `json:"vm_templates_some,omitempty"` + + // win opt + WinOpt *bool `json:"win_opt,omitempty"` + + // win opt not + WinOptNot *bool `json:"win_opt_not,omitempty"` } // Validate validates this content library Vm template where input @@ -382,6 +586,22 @@ func (m *ContentLibraryVMTemplateWhereInput) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := m.validateClockOffset(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClockOffsetIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClockOffsetNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClockOffsetNotIn(formats); err != nil { + res = append(res, err) + } + if err := m.validateClustersEvery(formats); err != nil { res = append(res, err) } @@ -410,6 +630,38 @@ func (m *ContentLibraryVMTemplateWhereInput) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := m.validateFirmware(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirmwareIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirmwareNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirmwareNotIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIoPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIoPolicyIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIoPolicyNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIoPolicyNotIn(formats); err != nil { + res = append(res, err) + } + if err := m.validateLabelsEvery(formats); err != nil { res = append(res, err) } @@ -422,6 +674,38 @@ func (m *ContentLibraryVMTemplateWhereInput) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := m.validateMaxBandwidthPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicyIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicyNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicyNotIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicyIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicyNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicyNotIn(formats); err != nil { + res = append(res, err) + } + if err := m.validateVMTemplatesEvery(formats); err != nil { res = append(res, err) } @@ -598,6 +882,86 @@ func (m *ContentLibraryVMTemplateWhereInput) validateArchitectureNotIn(formats s return nil } +func (m *ContentLibraryVMTemplateWhereInput) validateClockOffset(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffset) { // not required + return nil + } + + if m.ClockOffset != nil { + if err := m.ClockOffset.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateClockOffsetIn(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffsetIn) { // not required + return nil + } + + for i := 0; i < len(m.ClockOffsetIn); i++ { + + if err := m.ClockOffsetIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateClockOffsetNot(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffsetNot) { // not required + return nil + } + + if m.ClockOffsetNot != nil { + if err := m.ClockOffsetNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateClockOffsetNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffsetNotIn) { // not required + return nil + } + + for i := 0; i < len(m.ClockOffsetNotIn); i++ { + + if err := m.ClockOffsetNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *ContentLibraryVMTemplateWhereInput) validateClustersEvery(formats strfmt.Registry) error { if swag.IsZero(m.ClustersEvery) { // not required return nil @@ -735,17 +1099,17 @@ func (m *ContentLibraryVMTemplateWhereInput) validateEntityAsyncStatusNotIn(form return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateLabelsEvery(formats strfmt.Registry) error { - if swag.IsZero(m.LabelsEvery) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateFirmware(formats strfmt.Registry) error { + if swag.IsZero(m.Firmware) { // not required return nil } - if m.LabelsEvery != nil { - if err := m.LabelsEvery.Validate(formats); err != nil { + if m.Firmware != nil { + if err := m.Firmware.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("labels_every") + return ve.ValidateName("firmware") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("labels_every") + return ce.ValidateName("firmware") } return err } @@ -754,36 +1118,38 @@ func (m *ContentLibraryVMTemplateWhereInput) validateLabelsEvery(formats strfmt. return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateLabelsNone(formats strfmt.Registry) error { - if swag.IsZero(m.LabelsNone) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateFirmwareIn(formats strfmt.Registry) error { + if swag.IsZero(m.FirmwareIn) { // not required return nil } - if m.LabelsNone != nil { - if err := m.LabelsNone.Validate(formats); err != nil { + for i := 0; i < len(m.FirmwareIn); i++ { + + if err := m.FirmwareIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("labels_none") + return ve.ValidateName("firmware_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("labels_none") + return ce.ValidateName("firmware_in" + "." + strconv.Itoa(i)) } return err } + } return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateLabelsSome(formats strfmt.Registry) error { - if swag.IsZero(m.LabelsSome) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateFirmwareNot(formats strfmt.Registry) error { + if swag.IsZero(m.FirmwareNot) { // not required return nil } - if m.LabelsSome != nil { - if err := m.LabelsSome.Validate(formats); err != nil { + if m.FirmwareNot != nil { + if err := m.FirmwareNot.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("labels_some") + return ve.ValidateName("firmware_not") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("labels_some") + return ce.ValidateName("firmware_not") } return err } @@ -792,36 +1158,38 @@ func (m *ContentLibraryVMTemplateWhereInput) validateLabelsSome(formats strfmt.R return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesEvery(formats strfmt.Registry) error { - if swag.IsZero(m.VMTemplatesEvery) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateFirmwareNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.FirmwareNotIn) { // not required return nil } - if m.VMTemplatesEvery != nil { - if err := m.VMTemplatesEvery.Validate(formats); err != nil { + for i := 0; i < len(m.FirmwareNotIn); i++ { + + if err := m.FirmwareNotIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vm_templates_every") + return ve.ValidateName("firmware_not_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vm_templates_every") + return ce.ValidateName("firmware_not_in" + "." + strconv.Itoa(i)) } return err } + } return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesNone(formats strfmt.Registry) error { - if swag.IsZero(m.VMTemplatesNone) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateIoPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicy) { // not required return nil } - if m.VMTemplatesNone != nil { - if err := m.VMTemplatesNone.Validate(formats); err != nil { + if m.IoPolicy != nil { + if err := m.IoPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vm_templates_none") + return ve.ValidateName("io_policy") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vm_templates_none") + return ce.ValidateName("io_policy") } return err } @@ -830,94 +1198,490 @@ func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesNone(formats str return nil } -func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesSome(formats strfmt.Registry) error { - if swag.IsZero(m.VMTemplatesSome) { // not required +func (m *ContentLibraryVMTemplateWhereInput) validateIoPolicyIn(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicyIn) { // not required return nil } - if m.VMTemplatesSome != nil { - if err := m.VMTemplatesSome.Validate(formats); err != nil { + for i := 0; i < len(m.IoPolicyIn); i++ { + + if err := m.IoPolicyIn[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vm_templates_some") + return ve.ValidateName("io_policy_in" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vm_templates_some") + return ce.ValidateName("io_policy_in" + "." + strconv.Itoa(i)) } return err } + } return nil } -// ContextValidate validate this content library Vm template where input based on the context it is used -func (m *ContentLibraryVMTemplateWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAND(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNOT(ctx, formats); err != nil { - res = append(res, err) +func (m *ContentLibraryVMTemplateWhereInput) validateIoPolicyNot(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicyNot) { // not required + return nil } - if err := m.contextValidateOR(ctx, formats); err != nil { - res = append(res, err) + if m.IoPolicyNot != nil { + if err := m.IoPolicyNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy_not") + } + return err + } } - if err := m.contextValidateArchitecture(ctx, formats); err != nil { - res = append(res, err) - } + return nil +} - if err := m.contextValidateArchitectureIn(ctx, formats); err != nil { - res = append(res, err) +func (m *ContentLibraryVMTemplateWhereInput) validateIoPolicyNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicyNotIn) { // not required + return nil } - if err := m.contextValidateArchitectureNot(ctx, formats); err != nil { - res = append(res, err) - } + for i := 0; i < len(m.IoPolicyNotIn); i++ { - if err := m.contextValidateArchitectureNotIn(ctx, formats); err != nil { + if err := m.IoPolicyNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateLabelsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.LabelsEvery) { // not required + return nil + } + + if m.LabelsEvery != nil { + if err := m.LabelsEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels_every") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateLabelsNone(formats strfmt.Registry) error { + if swag.IsZero(m.LabelsNone) { // not required + return nil + } + + if m.LabelsNone != nil { + if err := m.LabelsNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels_none") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateLabelsSome(formats strfmt.Registry) error { + if swag.IsZero(m.LabelsSome) { // not required + return nil + } + + if m.LabelsSome != nil { + if err := m.LabelsSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels_some") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxBandwidthPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicy) { // not required + return nil + } + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxBandwidthPolicyIn(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicyIn) { // not required + return nil + } + + for i := 0; i < len(m.MaxBandwidthPolicyIn); i++ { + + if err := m.MaxBandwidthPolicyIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxBandwidthPolicyNot(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicyNot) { // not required + return nil + } + + if m.MaxBandwidthPolicyNot != nil { + if err := m.MaxBandwidthPolicyNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxBandwidthPolicyNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicyNotIn) { // not required + return nil + } + + for i := 0; i < len(m.MaxBandwidthPolicyNotIn); i++ { + + if err := m.MaxBandwidthPolicyNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxIopsPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicy) { // not required + return nil + } + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxIopsPolicyIn(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicyIn) { // not required + return nil + } + + for i := 0; i < len(m.MaxIopsPolicyIn); i++ { + + if err := m.MaxIopsPolicyIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxIopsPolicyNot(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicyNot) { // not required + return nil + } + + if m.MaxIopsPolicyNot != nil { + if err := m.MaxIopsPolicyNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateMaxIopsPolicyNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicyNotIn) { // not required + return nil + } + + for i := 0; i < len(m.MaxIopsPolicyNotIn); i++ { + + if err := m.MaxIopsPolicyNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesEvery(formats strfmt.Registry) error { + if swag.IsZero(m.VMTemplatesEvery) { // not required + return nil + } + + if m.VMTemplatesEvery != nil { + if err := m.VMTemplatesEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_templates_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_templates_every") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesNone(formats strfmt.Registry) error { + if swag.IsZero(m.VMTemplatesNone) { // not required + return nil + } + + if m.VMTemplatesNone != nil { + if err := m.VMTemplatesNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_templates_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_templates_none") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) validateVMTemplatesSome(formats strfmt.Registry) error { + if swag.IsZero(m.VMTemplatesSome) { // not required + return nil + } + + if m.VMTemplatesSome != nil { + if err := m.VMTemplatesSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_templates_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_templates_some") + } + return err + } + } + + return nil +} + +// ContextValidate validate this content library Vm template where input based on the context it is used +func (m *ContentLibraryVMTemplateWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAND(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNOT(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOR(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateArchitecture(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateArchitectureIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateArchitectureNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateArchitectureNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClockOffset(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClockOffsetIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClockOffsetNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClockOffsetNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClustersEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClustersNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClustersSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirmware(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirmwareIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirmwareNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirmwareNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicyIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicyNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicyNotIn(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateClustersEvery(ctx, formats); err != nil { + if err := m.contextValidateLabelsEvery(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateClustersNone(ctx, formats); err != nil { + if err := m.contextValidateLabelsNone(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateClustersSome(ctx, formats); err != nil { + if err := m.contextValidateLabelsSome(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { + if err := m.contextValidateMaxBandwidthPolicy(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateEntityAsyncStatusIn(ctx, formats); err != nil { + if err := m.contextValidateMaxBandwidthPolicyIn(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateEntityAsyncStatusNot(ctx, formats); err != nil { + if err := m.contextValidateMaxBandwidthPolicyNot(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateEntityAsyncStatusNotIn(ctx, formats); err != nil { + if err := m.contextValidateMaxBandwidthPolicyNotIn(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLabelsEvery(ctx, formats); err != nil { + if err := m.contextValidateMaxIopsPolicy(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLabelsNone(ctx, formats); err != nil { + if err := m.contextValidateMaxIopsPolicyIn(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLabelsSome(ctx, formats); err != nil { + if err := m.contextValidateMaxIopsPolicyNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxIopsPolicyNotIn(ctx, formats); err != nil { res = append(res, err) } @@ -1067,6 +1831,74 @@ func (m *ContentLibraryVMTemplateWhereInput) contextValidateArchitectureNotIn(ct return nil } +func (m *ContentLibraryVMTemplateWhereInput) contextValidateClockOffset(ctx context.Context, formats strfmt.Registry) error { + + if m.ClockOffset != nil { + if err := m.ClockOffset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateClockOffsetIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ClockOffsetIn); i++ { + + if err := m.ClockOffsetIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateClockOffsetNot(ctx context.Context, formats strfmt.Registry) error { + + if m.ClockOffsetNot != nil { + if err := m.ClockOffsetNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateClockOffsetNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ClockOffsetNotIn); i++ { + + if err := m.ClockOffsetNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *ContentLibraryVMTemplateWhereInput) contextValidateClustersEvery(ctx context.Context, formats strfmt.Registry) error { if m.ClustersEvery != nil { @@ -1183,6 +2015,142 @@ func (m *ContentLibraryVMTemplateWhereInput) contextValidateEntityAsyncStatusNot return nil } +func (m *ContentLibraryVMTemplateWhereInput) contextValidateFirmware(ctx context.Context, formats strfmt.Registry) error { + + if m.Firmware != nil { + if err := m.Firmware.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateFirmwareIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.FirmwareIn); i++ { + + if err := m.FirmwareIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateFirmwareNot(ctx context.Context, formats strfmt.Registry) error { + + if m.FirmwareNot != nil { + if err := m.FirmwareNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateFirmwareNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.FirmwareNotIn); i++ { + + if err := m.FirmwareNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateIoPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.IoPolicy != nil { + if err := m.IoPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateIoPolicyIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IoPolicyIn); i++ { + + if err := m.IoPolicyIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateIoPolicyNot(ctx context.Context, formats strfmt.Registry) error { + + if m.IoPolicyNot != nil { + if err := m.IoPolicyNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateIoPolicyNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IoPolicyNotIn); i++ { + + if err := m.IoPolicyNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *ContentLibraryVMTemplateWhereInput) contextValidateLabelsEvery(ctx context.Context, formats strfmt.Registry) error { if m.LabelsEvery != nil { @@ -1231,6 +2199,142 @@ func (m *ContentLibraryVMTemplateWhereInput) contextValidateLabelsSome(ctx conte return nil } +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxBandwidthPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxBandwidthPolicyIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MaxBandwidthPolicyIn); i++ { + + if err := m.MaxBandwidthPolicyIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxBandwidthPolicyNot(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicyNot != nil { + if err := m.MaxBandwidthPolicyNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxBandwidthPolicyNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MaxBandwidthPolicyNotIn); i++ { + + if err := m.MaxBandwidthPolicyNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxIopsPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxIopsPolicyIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MaxIopsPolicyIn); i++ { + + if err := m.MaxIopsPolicyIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxIopsPolicyNot(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicyNot != nil { + if err := m.MaxIopsPolicyNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_not") + } + return err + } + } + + return nil +} + +func (m *ContentLibraryVMTemplateWhereInput) contextValidateMaxIopsPolicyNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MaxIopsPolicyNotIn); i++ { + + if err := m.MaxIopsPolicyNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + func (m *ContentLibraryVMTemplateWhereInput) contextValidateVMTemplatesEvery(ctx context.Context, formats strfmt.Registry) error { if m.VMTemplatesEvery != nil { diff --git a/models/error_body_stringer.go b/models/error_body_stringer.go new file mode 100644 index 00000000..799f3296 --- /dev/null +++ b/models/error_body_stringer.go @@ -0,0 +1,32 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "encoding/json" + "fmt" +) + +func (m *ErrorBody) String() string { + if m == nil { + return "" + } + str := "" + if m.Code != nil { + str = fmt.Sprintf("code: %s", *m.Code) + } + if m.Message != nil { + if str != "" { + str += ", " + } + str += fmt.Sprintf("message: %s", *m.Message) + } + bProps, err := json.Marshal(m.Props) + if err == nil { + if str != "" { + str += ", " + } + str += fmt.Sprintf("props: %s", string(bProps[:])) + } + return str +} diff --git a/models/get_backup_restore_point_metadata_request_body.go b/models/get_backup_restore_point_metadata_request_body.go new file mode 100644 index 00000000..794cead3 --- /dev/null +++ b/models/get_backup_restore_point_metadata_request_body.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetBackupRestorePointMetadataRequestBody get backup restore point metadata request body +// +// swagger:model GetBackupRestorePointMetadataRequestBody +type GetBackupRestorePointMetadataRequestBody struct { + + // where + // Required: true + Where *BackupRestorePointWhereUniqueInput `json:"where"` +} + +// Validate validates this get backup restore point metadata request body +func (m *GetBackupRestorePointMetadataRequestBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWhere(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetBackupRestorePointMetadataRequestBody) validateWhere(formats strfmt.Registry) error { + + if err := validate.Required("where", "body", m.Where); err != nil { + return err + } + + if m.Where != nil { + if err := m.Where.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("where") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("where") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get backup restore point metadata request body based on the context it is used +func (m *GetBackupRestorePointMetadataRequestBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateWhere(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetBackupRestorePointMetadataRequestBody) contextValidateWhere(ctx context.Context, formats strfmt.Registry) error { + + if m.Where != nil { + if err := m.Where.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("where") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("where") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetBackupRestorePointMetadataRequestBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetBackupRestorePointMetadataRequestBody) UnmarshalBinary(b []byte) error { + var res GetBackupRestorePointMetadataRequestBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/get_cluster_storage_info_effect.go b/models/get_cluster_storage_info_effect.go new file mode 100644 index 00000000..99b47834 --- /dev/null +++ b/models/get_cluster_storage_info_effect.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetClusterStorageInfoEffect get cluster storage info effect +// +// swagger:model GetClusterStorageInfoEffect +type GetClusterStorageInfoEffect struct { + + // ec + Ec []*ClusterStorageInfoEcConfig `json:"ec,omitempty"` + + // replica + Replica []ReplicaNum `json:"replica,omitempty"` +} + +// Validate validates this get cluster storage info effect +func (m *GetClusterStorageInfoEffect) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplica(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetClusterStorageInfoEffect) validateEc(formats strfmt.Registry) error { + if swag.IsZero(m.Ec) { // not required + return nil + } + + for i := 0; i < len(m.Ec); i++ { + if swag.IsZero(m.Ec[i]) { // not required + continue + } + + if m.Ec[i] != nil { + if err := m.Ec[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ec" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ec" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *GetClusterStorageInfoEffect) validateReplica(formats strfmt.Registry) error { + if swag.IsZero(m.Replica) { // not required + return nil + } + + for i := 0; i < len(m.Replica); i++ { + + if err := m.Replica[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// ContextValidate validate this get cluster storage info effect based on the context it is used +func (m *GetClusterStorageInfoEffect) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEc(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReplica(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetClusterStorageInfoEffect) contextValidateEc(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ec); i++ { + + if m.Ec[i] != nil { + if err := m.Ec[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ec" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ec" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *GetClusterStorageInfoEffect) contextValidateReplica(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Replica); i++ { + + if err := m.Replica[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replica" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replica" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetClusterStorageInfoEffect) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetClusterStorageInfoEffect) UnmarshalBinary(b []byte) error { + var res GetClusterStorageInfoEffect + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/get_cluster_storage_info_request_body.go b/models/get_cluster_storage_info_request_body.go new file mode 100644 index 00000000..ebbf9ea3 --- /dev/null +++ b/models/get_cluster_storage_info_request_body.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetClusterStorageInfoRequestBody get cluster storage info request body +// +// swagger:model GetClusterStorageInfoRequestBody +type GetClusterStorageInfoRequestBody struct { + + // effect + // Required: true + Effect *GetClusterStorageInfoEffect `json:"effect"` + + // where + // Required: true + Where *ClusterWhereInput `json:"where"` +} + +// Validate validates this get cluster storage info request body +func (m *GetClusterStorageInfoRequestBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEffect(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWhere(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetClusterStorageInfoRequestBody) validateEffect(formats strfmt.Registry) error { + + if err := validate.Required("effect", "body", m.Effect); err != nil { + return err + } + + if m.Effect != nil { + if err := m.Effect.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("effect") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("effect") + } + return err + } + } + + return nil +} + +func (m *GetClusterStorageInfoRequestBody) validateWhere(formats strfmt.Registry) error { + + if err := validate.Required("where", "body", m.Where); err != nil { + return err + } + + if m.Where != nil { + if err := m.Where.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("where") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("where") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get cluster storage info request body based on the context it is used +func (m *GetClusterStorageInfoRequestBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEffect(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWhere(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetClusterStorageInfoRequestBody) contextValidateEffect(ctx context.Context, formats strfmt.Registry) error { + + if m.Effect != nil { + if err := m.Effect.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("effect") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("effect") + } + return err + } + } + + return nil +} + +func (m *GetClusterStorageInfoRequestBody) contextValidateWhere(ctx context.Context, formats strfmt.Registry) error { + + if m.Where != nil { + if err := m.Where.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("where") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("where") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetClusterStorageInfoRequestBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetClusterStorageInfoRequestBody) UnmarshalBinary(b []byte) error { + var res GetClusterStorageInfoRequestBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metric_unit.go b/models/metric_unit.go index 5b8ece3e..7891e1ae 100644 --- a/models/metric_unit.go +++ b/models/metric_unit.go @@ -54,6 +54,9 @@ const ( // MetricUnitRATIO captures enum value "RATIO" MetricUnitRATIO MetricUnit = "RATIO" + // MetricUnitSTORAGEBANDWIDTH captures enum value "STORAGE_BAND_WIDTH" + MetricUnitSTORAGEBANDWIDTH MetricUnit = "STORAGE_BAND_WIDTH" + // MetricUnitTEMPERATURE captures enum value "TEMPERATURE" MetricUnitTEMPERATURE MetricUnit = "TEMPERATURE" @@ -66,7 +69,7 @@ var metricUnitEnum []interface{} func init() { var res []MetricUnit - if err := json.Unmarshal([]byte(`["COUNT","DATA_RATE_BIT","DATA_RATE_BYTE","DATA_SIZE","FREQUENCY","LOAD","PERCENT","RATIO","TEMPERATURE","TIME"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["COUNT","DATA_RATE_BIT","DATA_RATE_BYTE","DATA_SIZE","FREQUENCY","LOAD","PERCENT","RATIO","STORAGE_BAND_WIDTH","TEMPERATURE","TIME"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/mfa_type.go b/models/mfa_type.go index 97068a29..a921a9e2 100644 --- a/models/mfa_type.go +++ b/models/mfa_type.go @@ -32,6 +32,9 @@ const ( // MfaTypeMail captures enum value "Mail" MfaTypeMail MfaType = "Mail" + + // MfaTypeSms captures enum value "Sms" + MfaTypeSms MfaType = "Sms" ) // for schema @@ -39,7 +42,7 @@ var mfaTypeEnum []interface{} func init() { var res []MfaType - if err := json.Unmarshal([]byte(`["Mail"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Mail","Sms"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/nested_content_library_vm_template_disk.go b/models/nested_content_library_vm_template_disk.go new file mode 100644 index 00000000..4e66afd9 --- /dev/null +++ b/models/nested_content_library_vm_template_disk.go @@ -0,0 +1,362 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedContentLibraryVMTemplateDisk nested content library Vm template disk +// +// swagger:model NestedContentLibraryVmTemplateDisk +type NestedContentLibraryVMTemplateDisk struct { + + // boot + // Required: true + Boot *int32 `json:"boot"` + + // bus + // Required: true + Bus *Bus `json:"bus"` + + // content library image id + ContentLibraryImageID *string `json:"content_library_image_id,omitempty"` + + // disabled + Disabled *bool `json:"disabled,omitempty"` + + // disk name + DiskName *string `json:"disk_name,omitempty"` + + // index + // Required: true + Index *int32 `json:"index"` + + // max bandwidth + MaxBandwidth *int64 `json:"max_bandwidth,omitempty"` + + // max bandwidth policy + MaxBandwidthPolicy *VMDiskIoRestrictType `json:"max_bandwidth_policy,omitempty"` + + // max iops + MaxIops *int32 `json:"max_iops,omitempty"` + + // max iops policy + MaxIopsPolicy *VMDiskIoRestrictType `json:"max_iops_policy,omitempty"` + + // path + Path *string `json:"path,omitempty"` + + // resident in cache + ResidentInCache *bool `json:"resident_in_cache,omitempty"` + + // size + Size *int64 `json:"size,omitempty"` + + // storage encrypted + StorageEncrypted *bool `json:"storage_encrypted,omitempty"` + + // storage policy + StoragePolicy *VMVolumeElfStoragePolicyType `json:"storage_policy,omitempty"` + + // type + // Required: true + Type *VMDiskType `json:"type"` +} + +// Validate validates this nested content library Vm template disk +func (m *NestedContentLibraryVMTemplateDisk) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBoot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStoragePolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateBoot(formats strfmt.Registry) error { + + if err := validate.Required("boot", "body", m.Boot); err != nil { + return err + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateBus(formats strfmt.Registry) error { + + if err := validate.Required("bus", "body", m.Bus); err != nil { + return err + } + + if err := validate.Required("bus", "body", m.Bus); err != nil { + return err + } + + if m.Bus != nil { + if err := m.Bus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bus") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateIndex(formats strfmt.Registry) error { + + if err := validate.Required("index", "body", m.Index); err != nil { + return err + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateMaxBandwidthPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicy) { // not required + return nil + } + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateMaxIopsPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicy) { // not required + return nil + } + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateStoragePolicy(formats strfmt.Registry) error { + if swag.IsZero(m.StoragePolicy) { // not required + return nil + } + + if m.StoragePolicy != nil { + if err := m.StoragePolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +// ContextValidate validate this nested content library Vm template disk based on the context it is used +func (m *NestedContentLibraryVMTemplateDisk) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxBandwidthPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxIopsPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStoragePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) contextValidateBus(ctx context.Context, formats strfmt.Registry) error { + + if m.Bus != nil { + if err := m.Bus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bus") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) contextValidateMaxBandwidthPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) contextValidateMaxIopsPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) contextValidateStoragePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.StoragePolicy != nil { + if err := m.StoragePolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_policy") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateDisk) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedContentLibraryVMTemplateDisk) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedContentLibraryVMTemplateDisk) UnmarshalBinary(b []byte) error { + var res NestedContentLibraryVMTemplateDisk + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_content_library_vm_template_nic.go b/models/nested_content_library_vm_template_nic.go new file mode 100644 index 00000000..3bff4a3a --- /dev/null +++ b/models/nested_content_library_vm_template_nic.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedContentLibraryVMTemplateNic nested content library Vm template nic +// +// swagger:model NestedContentLibraryVmTemplateNic +type NestedContentLibraryVMTemplateNic struct { + + // egress rate limit burst in bit + EgressRateLimitBurstInBit *float64 `json:"egress_rate_limit_burst_in_bit,omitempty"` + + // egress rate limit enabled + EgressRateLimitEnabled *bool `json:"egress_rate_limit_enabled,omitempty"` + + // egress rate limit max rate in bitps + EgressRateLimitMaxRateInBitps *float64 `json:"egress_rate_limit_max_rate_in_bitps,omitempty"` + + // enabled + Enabled *bool `json:"enabled,omitempty"` + + // index + // Required: true + Index *int32 `json:"index"` + + // ingress rate limit burst in bit + IngressRateLimitBurstInBit *float64 `json:"ingress_rate_limit_burst_in_bit,omitempty"` + + // ingress rate limit enabled + IngressRateLimitEnabled *bool `json:"ingress_rate_limit_enabled,omitempty"` + + // ingress rate limit max rate in bitps + IngressRateLimitMaxRateInBitps *float64 `json:"ingress_rate_limit_max_rate_in_bitps,omitempty"` + + // mirror + Mirror *bool `json:"mirror,omitempty"` + + // model + Model *VMNicModel `json:"model,omitempty"` + + // type + Type *VMNicType `json:"type,omitempty"` + + // vlan + Vlan *NestedFrozenVlan `json:"vlan,omitempty"` + + // vpc nic + VpcNic *NestedTemplateVpcNic `json:"vpc_nic,omitempty"` +} + +// Validate validates this nested content library Vm template nic +func (m *NestedContentLibraryVMTemplateNic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVpcNic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) validateIndex(formats strfmt.Registry) error { + + if err := validate.Required("index", "body", m.Index); err != nil { + return err + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) validateModel(formats strfmt.Registry) error { + if swag.IsZero(m.Model) { // not required + return nil + } + + if m.Model != nil { + if err := m.Model.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("model") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("model") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) validateVlan(formats strfmt.Registry) error { + if swag.IsZero(m.Vlan) { // not required + return nil + } + + if m.Vlan != nil { + if err := m.Vlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) validateVpcNic(formats strfmt.Registry) error { + if swag.IsZero(m.VpcNic) { // not required + return nil + } + + if m.VpcNic != nil { + if err := m.VpcNic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_nic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_nic") + } + return err + } + } + + return nil +} + +// ContextValidate validate this nested content library Vm template nic based on the context it is used +func (m *NestedContentLibraryVMTemplateNic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModel(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVlan(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpcNic(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) contextValidateModel(ctx context.Context, formats strfmt.Registry) error { + + if m.Model != nil { + if err := m.Model.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("model") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("model") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) contextValidateVlan(ctx context.Context, formats strfmt.Registry) error { + + if m.Vlan != nil { + if err := m.Vlan.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan") + } + return err + } + } + + return nil +} + +func (m *NestedContentLibraryVMTemplateNic) contextValidateVpcNic(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcNic != nil { + if err := m.VpcNic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_nic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_nic") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedContentLibraryVMTemplateNic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedContentLibraryVMTemplateNic) UnmarshalBinary(b []byte) error { + var res NestedContentLibraryVMTemplateNic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_frozen_vlan.go b/models/nested_frozen_vlan.go index 66a73f5a..96715767 100644 --- a/models/nested_frozen_vlan.go +++ b/models/nested_frozen_vlan.go @@ -23,6 +23,9 @@ type NestedFrozenVlan struct { // Required: true Name *string `json:"name"` + // network ids + NetworkIds []string `json:"network_ids,omitempty"` + // vds ovs // Required: true VdsOvs *string `json:"vds_ovs"` diff --git a/models/nested_snapshot_info.go b/models/nested_snapshot_info.go new file mode 100644 index 00000000..9ffcdc3e --- /dev/null +++ b/models/nested_snapshot_info.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedSnapshotInfo nested snapshot info +// +// swagger:model NestedSnapshotInfo +type NestedSnapshotInfo struct { + + // index + // Required: true + Index *int32 `json:"index"` + + // iscsi lun snapshot uuid + // Required: true + IscsiLunSnapshotUUID *string `json:"iscsi_lun_snapshot_uuid"` + + // storage encrypted + StorageEncrypted *bool `json:"storage_encrypted,omitempty"` + + // storage policy config + StoragePolicyConfig *NestedStoragePolicyConfig `json:"storage_policy_config,omitempty"` +} + +// Validate validates this nested snapshot info +func (m *NestedSnapshotInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIscsiLunSnapshotUUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStoragePolicyConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSnapshotInfo) validateIndex(formats strfmt.Registry) error { + + if err := validate.Required("index", "body", m.Index); err != nil { + return err + } + + return nil +} + +func (m *NestedSnapshotInfo) validateIscsiLunSnapshotUUID(formats strfmt.Registry) error { + + if err := validate.Required("iscsi_lun_snapshot_uuid", "body", m.IscsiLunSnapshotUUID); err != nil { + return err + } + + return nil +} + +func (m *NestedSnapshotInfo) validateStoragePolicyConfig(formats strfmt.Registry) error { + if swag.IsZero(m.StoragePolicyConfig) { // not required + return nil + } + + if m.StoragePolicyConfig != nil { + if err := m.StoragePolicyConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_policy_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_policy_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this nested snapshot info based on the context it is used +func (m *NestedSnapshotInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStoragePolicyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSnapshotInfo) contextValidateStoragePolicyConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.StoragePolicyConfig != nil { + if err := m.StoragePolicyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_policy_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_policy_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedSnapshotInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedSnapshotInfo) UnmarshalBinary(b []byte) error { + var res NestedSnapshotInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_storage_policy_config.go b/models/nested_storage_policy_config.go new file mode 100644 index 00000000..c76dfeae --- /dev/null +++ b/models/nested_storage_policy_config.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NestedStoragePolicyConfig nested storage policy config +// +// swagger:model NestedStoragePolicyConfig +type NestedStoragePolicyConfig struct { + + // replica num + ReplicaNum *int32 `json:"replica_num,omitempty"` + + // thin provision + ThinProvision *bool `json:"thin_provision,omitempty"` +} + +// Validate validates this nested storage policy config +func (m *NestedStoragePolicyConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this nested storage policy config based on context it is used +func (m *NestedStoragePolicyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NestedStoragePolicyConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedStoragePolicyConfig) UnmarshalBinary(b []byte) error { + var res NestedStoragePolicyConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_template_config.go b/models/nested_template_config.go new file mode 100644 index 00000000..5b3a90af --- /dev/null +++ b/models/nested_template_config.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NestedTemplateConfig nested template config +// +// swagger:model NestedTemplateConfig +type NestedTemplateConfig struct { + + // cpu exclusive expected enabled + CPUExclusiveExpectedEnabled *bool `json:"cpu_exclusive_expected_enabled,omitempty"` + + // guest os type + GuestOsType *string `json:"guest_os_type,omitempty"` + + // minimum replica + MinimumReplica *bool `json:"minimum_replica,omitempty"` + + // sync vm time on resume + SyncVMTimeOnResume *bool `json:"sync_vm_time_on_resume,omitempty"` +} + +// Validate validates this nested template config +func (m *NestedTemplateConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this nested template config based on context it is used +func (m *NestedTemplateConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NestedTemplateConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedTemplateConfig) UnmarshalBinary(b []byte) error { + var res NestedTemplateConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_template_vpc_nic.go b/models/nested_template_vpc_nic.go index 3d106647..9b464a73 100644 --- a/models/nested_template_vpc_nic.go +++ b/models/nested_template_vpc_nic.go @@ -19,6 +19,10 @@ import ( // swagger:model NestedTemplateVpcNic type NestedTemplateVpcNic struct { + // use floating ip + // Required: true + UseFloatingIP *bool `json:"use_floating_ip"` + // vpc local id // Required: true VpcLocalID *string `json:"vpc_local_id"` @@ -32,6 +36,10 @@ type NestedTemplateVpcNic struct { func (m *NestedTemplateVpcNic) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateUseFloatingIP(formats); err != nil { + res = append(res, err) + } + if err := m.validateVpcLocalID(formats); err != nil { res = append(res, err) } @@ -46,6 +54,15 @@ func (m *NestedTemplateVpcNic) Validate(formats strfmt.Registry) error { return nil } +func (m *NestedTemplateVpcNic) validateUseFloatingIP(formats strfmt.Registry) error { + + if err := validate.Required("use_floating_ip", "body", m.UseFloatingIP); err != nil { + return err + } + + return nil +} + func (m *NestedTemplateVpcNic) validateVpcLocalID(formats strfmt.Registry) error { if err := validate.Required("vpc_local_id", "body", m.VpcLocalID); err != nil { diff --git a/models/nested_virtual_private_cloud_edge_gateway.go b/models/nested_virtual_private_cloud_edge_gateway.go new file mode 100644 index 00000000..2f788275 --- /dev/null +++ b/models/nested_virtual_private_cloud_edge_gateway.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVirtualPrivateCloudEdgeGateway nested virtual private cloud edge gateway +// +// swagger:model NestedVirtualPrivateCloudEdgeGateway +type NestedVirtualPrivateCloudEdgeGateway struct { + + // id + // Required: true + ID *string `json:"id"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this nested virtual private cloud edge gateway +func (m *NestedVirtualPrivateCloudEdgeGateway) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVirtualPrivateCloudEdgeGateway) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudEdgeGateway) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this nested virtual private cloud edge gateway based on context it is used +func (m *NestedVirtualPrivateCloudEdgeGateway) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVirtualPrivateCloudEdgeGateway) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVirtualPrivateCloudEdgeGateway) UnmarshalBinary(b []byte) error { + var res NestedVirtualPrivateCloudEdgeGateway + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_virtual_private_cloud_service.go b/models/nested_virtual_private_cloud_service.go index 589618c3..e13151fe 100644 --- a/models/nested_virtual_private_cloud_service.go +++ b/models/nested_virtual_private_cloud_service.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -22,6 +23,14 @@ type NestedVirtualPrivateCloudService struct { // id // Required: true ID *string `json:"id"` + + // internal cidr + // Required: true + InternalCidr *string `json:"internal_cidr"` + + // tep ip pools + // Required: true + TepIPPools []*NestedVirtualPrivateCloudServiceTepIPPool `json:"tep_ip_pools"` } // Validate validates this nested virtual private cloud service @@ -32,6 +41,14 @@ func (m *NestedVirtualPrivateCloudService) Validate(formats strfmt.Registry) err res = append(res, err) } + if err := m.validateInternalCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTepIPPools(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -47,8 +64,73 @@ func (m *NestedVirtualPrivateCloudService) validateID(formats strfmt.Registry) e return nil } -// ContextValidate validates this nested virtual private cloud service based on context it is used +func (m *NestedVirtualPrivateCloudService) validateInternalCidr(formats strfmt.Registry) error { + + if err := validate.Required("internal_cidr", "body", m.InternalCidr); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudService) validateTepIPPools(formats strfmt.Registry) error { + + if err := validate.Required("tep_ip_pools", "body", m.TepIPPools); err != nil { + return err + } + + for i := 0; i < len(m.TepIPPools); i++ { + if swag.IsZero(m.TepIPPools[i]) { // not required + continue + } + + if m.TepIPPools[i] != nil { + if err := m.TepIPPools[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tep_ip_pools" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tep_ip_pools" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this nested virtual private cloud service based on the context it is used func (m *NestedVirtualPrivateCloudService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTepIPPools(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVirtualPrivateCloudService) contextValidateTepIPPools(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TepIPPools); i++ { + + if m.TepIPPools[i] != nil { + if err := m.TepIPPools[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tep_ip_pools" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tep_ip_pools" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } diff --git a/models/nested_virtual_private_cloud_service_tep_ip_pool.go b/models/nested_virtual_private_cloud_service_tep_ip_pool.go new file mode 100644 index 00000000..4de68217 --- /dev/null +++ b/models/nested_virtual_private_cloud_service_tep_ip_pool.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedVirtualPrivateCloudServiceTepIPPool nested virtual private cloud service tep Ip pool +// +// swagger:model NestedVirtualPrivateCloudServiceTepIpPool +type NestedVirtualPrivateCloudServiceTepIPPool struct { + + // display name + // Required: true + DisplayName *string `json:"display_name"` + + // gateway + // Required: true + Gateway *string `json:"gateway"` + + // ip end + // Required: true + IPEnd *string `json:"ip_end"` + + // ip start + // Required: true + IPStart *string `json:"ip_start"` + + // netmask + // Required: true + Netmask *string `json:"netmask"` +} + +// Validate validates this nested virtual private cloud service tep Ip pool +func (m *NestedVirtualPrivateCloudServiceTepIPPool) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisplayName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGateway(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNetmask(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVirtualPrivateCloudServiceTepIPPool) validateDisplayName(formats strfmt.Registry) error { + + if err := validate.Required("display_name", "body", m.DisplayName); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudServiceTepIPPool) validateGateway(formats strfmt.Registry) error { + + if err := validate.Required("gateway", "body", m.Gateway); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudServiceTepIPPool) validateIPEnd(formats strfmt.Registry) error { + + if err := validate.Required("ip_end", "body", m.IPEnd); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudServiceTepIPPool) validateIPStart(formats strfmt.Registry) error { + + if err := validate.Required("ip_start", "body", m.IPStart); err != nil { + return err + } + + return nil +} + +func (m *NestedVirtualPrivateCloudServiceTepIPPool) validateNetmask(formats strfmt.Registry) error { + + if err := validate.Required("netmask", "body", m.Netmask); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this nested virtual private cloud service tep Ip pool based on context it is used +func (m *NestedVirtualPrivateCloudServiceTepIPPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVirtualPrivateCloudServiceTepIPPool) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVirtualPrivateCloudServiceTepIPPool) UnmarshalBinary(b []byte) error { + var res NestedVirtualPrivateCloudServiceTepIPPool + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/nested_zbs_storage_info.go b/models/nested_zbs_storage_info.go new file mode 100644 index 00000000..db4c8170 --- /dev/null +++ b/models/nested_zbs_storage_info.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedZbsStorageInfo nested zbs storage info +// +// swagger:model NestedZbsStorageInfo +type NestedZbsStorageInfo struct { + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // snapshot info + SnapshotInfo []*NestedSnapshotInfo `json:"snapshot_info,omitempty"` +} + +// Validate validates this nested zbs storage info +func (m *NestedZbsStorageInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshotInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedZbsStorageInfo) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *NestedZbsStorageInfo) validateSnapshotInfo(formats strfmt.Registry) error { + if swag.IsZero(m.SnapshotInfo) { // not required + return nil + } + + for i := 0; i < len(m.SnapshotInfo); i++ { + if swag.IsZero(m.SnapshotInfo[i]) { // not required + continue + } + + if m.SnapshotInfo[i] != nil { + if err := m.SnapshotInfo[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("snapshot_info" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this nested zbs storage info based on the context it is used +func (m *NestedZbsStorageInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSnapshotInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedZbsStorageInfo) contextValidateSnapshotInfo(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SnapshotInfo); i++ { + + if m.SnapshotInfo[i] != nil { + if err := m.SnapshotInfo[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("snapshot_info" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedZbsStorageInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedZbsStorageInfo) UnmarshalBinary(b []byte) error { + var res NestedZbsStorageInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/ntp_service_url.go b/models/ntp_service_url.go new file mode 100644 index 00000000..b5df20fd --- /dev/null +++ b/models/ntp_service_url.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NtpServiceURL ntp service Url +// +// swagger:model NtpServiceUrl +type NtpServiceURL struct { + + // ntp service url + // Required: true + NtpServiceURL *string `json:"ntp_service_url"` +} + +// Validate validates this ntp service Url +func (m *NtpServiceURL) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNtpServiceURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NtpServiceURL) validateNtpServiceURL(formats strfmt.Registry) error { + + if err := validate.Required("ntp_service_url", "body", m.NtpServiceURL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this ntp service Url based on context it is used +func (m *NtpServiceURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NtpServiceURL) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NtpServiceURL) UnmarshalBinary(b []byte) error { + var res NtpServiceURL + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/r_o_l_e_a_c_t_i_o_n.go b/models/r_o_l_e_a_c_t_i_o_n.go index 29999175..808c7388 100644 --- a/models/r_o_l_e_a_c_t_i_o_n.go +++ b/models/r_o_l_e_a_c_t_i_o_n.go @@ -42,6 +42,9 @@ const ( // ROLEACTIONMANAGESTORAGECLUSTERCONNECTION captures enum value "MANAGE_STORAGE_CLUSTER_CONNECTION" ROLEACTIONMANAGESTORAGECLUSTERCONNECTION ROLEACTION = "MANAGE_STORAGE_CLUSTER_CONNECTION" + // ROLEACTIONMANAGEPORTACCESSCONTROL captures enum value "MANAGE_PORT_ACCESS_CONTROL" + ROLEACTIONMANAGEPORTACCESSCONTROL ROLEACTION = "MANAGE_PORT_ACCESS_CONTROL" + // ROLEACTIONMANAGEHOST captures enum value "MANAGE_HOST" ROLEACTIONMANAGEHOST ROLEACTION = "MANAGE_HOST" @@ -246,6 +249,12 @@ const ( // ROLEACTIONMANAGEUPGRADECENTER captures enum value "MANAGE_UPGRADE_CENTER" ROLEACTIONMANAGEUPGRADECENTER ROLEACTION = "MANAGE_UPGRADE_CENTER" + // ROLEACTIONMANAGECLUSTERUPGRADE captures enum value "MANAGE_CLUSTER_UPGRADE" + ROLEACTIONMANAGECLUSTERUPGRADE ROLEACTION = "MANAGE_CLUSTER_UPGRADE" + + // ROLEACTIONMANAGEALERTNOTIFIER captures enum value "MANAGE_ALERT_NOTIFIER" + ROLEACTIONMANAGEALERTNOTIFIER ROLEACTION = "MANAGE_ALERT_NOTIFIER" + // ROLEACTIONMANAGEVMRECYCLEBINSETTING captures enum value "MANAGE_VM_RECYCLE_BIN_SETTING" ROLEACTIONMANAGEVMRECYCLEBINSETTING ROLEACTION = "MANAGE_VM_RECYCLE_BIN_SETTING" @@ -489,6 +498,9 @@ const ( // ROLEACTIONMANAGESFSFILESYSTEMACCESSIBILITY captures enum value "MANAGE_SFS_FILE_SYSTEM_ACCESSIBILITY" ROLEACTIONMANAGESFSFILESYSTEMACCESSIBILITY ROLEACTION = "MANAGE_SFS_FILE_SYSTEM_ACCESSIBILITY" + // ROLEACTIONMANAGESFSFSCONTROLLER captures enum value "MANAGE_SFS_FS_CONTROLLER" + ROLEACTIONMANAGESFSFSCONTROLLER ROLEACTION = "MANAGE_SFS_FS_CONTROLLER" + // ROLEACTIONMANAGESFSSNAPSHOT captures enum value "MANAGE_SFS_SNAPSHOT" ROLEACTIONMANAGESFSSNAPSHOT ROLEACTION = "MANAGE_SFS_SNAPSHOT" @@ -503,6 +515,15 @@ const ( // ROLEACTIONMANAGEAPIKEY captures enum value "MANAGE_API_KEY" ROLEACTIONMANAGEAPIKEY ROLEACTION = "MANAGE_API_KEY" + + // ROLEACTIONMANAGEKMSCLUSTER captures enum value "MANAGE_KMS_CLUSTER" + ROLEACTIONMANAGEKMSCLUSTER ROLEACTION = "MANAGE_KMS_CLUSTER" + + // ROLEACTIONMANAGECLUSTERSTORAGEENCRYPTION captures enum value "MANAGE_CLUSTER_STORAGE_ENCRYPTION" + ROLEACTIONMANAGECLUSTERSTORAGEENCRYPTION ROLEACTION = "MANAGE_CLUSTER_STORAGE_ENCRYPTION" + + // ROLEACTIONMANAGESSOLOGIN captures enum value "MANAGE_SSO_LOGIN" + ROLEACTIONMANAGESSOLOGIN ROLEACTION = "MANAGE_SSO_LOGIN" ) // for schema @@ -510,7 +531,7 @@ var rOLEACTIONEnum []interface{} func init() { var res []ROLEACTION - if err := json.Unmarshal([]byte(`["*","MANAGE_DATA_CENTER","MANAGE_CLUSTER_CONNECTION","MANAGE_STORAGE_CLUSTER_CONNECTION","MANAGE_HOST","MANAGE_NIC_MTU","MANAGE_DISK","MANAGE_HARDWARE_TOPO","MANAGE_USB_DEVICE","MANAGE_GPU_DEVICE","MANAGE_VDS","MANAGE_VLAN","MANAGE_SYSTEM_VLAN","MANAGE_ISCSI_DATA_STORE","MANAGE_NFS_DATA_STORE","MANAGE_NVMF_DATA_STORE","CREATE_VM","UPDATE_VM","DELETE_VM","UPDATE_VM_ADVANCED_SETTING","UPDATE_VM_GUEST","VM_OPERATION_OPEN_TERMINAL","VM_OPERATION_MIGRATE","VM_OPERATION_VM_FOLDER","VM_OPERATION_VM_POWER","VM_OPERATION_CLONE","VM_OPERATION_INSTALL_TOOLS","VM_IMPORT_EXPORT","CREATE_VM_TEMPLATE","MANAGE_VM_TEMPLATE","VM_TEMPLATE_IMPORT_EXPORT","MANAGE_VM_SNAPSHOT","MANAGE_VM_VOLUME","VM_VOLUME_IMPORT_EXPORT","MANAGE_ISO","DOWNLOAD_ISO","QUERY_SENSITIVE_RESOURCE_LIST","QUERY_SENSITIVE_RESOURCE","MANAGE_SENSITIVE_RESOURCE","MANAGE_VM_PLACEMENT_GROUP","MANAGE_SNAPSHOT_PLAN","MANAGE_ALERT","MANAGE_MONITOR_VIEW","MANAGE_ENTITY_FILTER","MANAGE_CLUSTER_BASIC_INFO","MANAGE_CLUSTER_LICENCE","MANAGE_CLUSTER_SNMP_TRANSPORT","MANAGE_SNMP_TRAP","MANAGE_CLUSTER_VIP","MANAGE_CLUSTER_MANAGEMENT_IP","MANAGE_DNS_SERVER","MANAGE_NTP_SERVER","MANAGE_IPMI","MANAGE_CLUSTER_VM_CPU_MODEL","MANAGE_CLUSTER_VM_TOOLS","MANAGE_CLUSTER_HOT_MIGRATION","MANAGE_CLUSTER_HA","MANAGE_SSL_CERTIFICATE","MANAGE_LOG_COLLECTION","MANAGE_SYSLOG","MANAGE_LOG_FIND","MANAGE_LABEL","MANAGE_USER_AND_ROLE","MANAGE_PASSWORD_SETTINGS","MANAGE_ACCESS_CONTROL","MANAGE_SESSION_EXPIRATION","MANAGE_VCENTER_ASSOCIATION","MANAGE_ESXI_ASSOCIATION","MANAGE_AUDIT_LOG","MANAGE_ALERT_EMAIL_SETTING","MANAGE_SMTP_SERVER","MANAGE_UPGRADE_CENTER","MANAGE_VM_RECYCLE_BIN_SETTING","MANAGE_REPORT","MANAGE_SHARING_VM_TOOLS","MANAGE_ADVANCED_MONITOR","MANAGE_THIRD_PARTY_DRIVER","MANAGE_ORGANIZATION_NAME","MANAGE_CLOUD_TOWER_LICENSE","MANAGE_CONSISTENCY_GROUP","MANAGE_NIC","MANAGE_CLUSTER_ISCSI","MANAGE_BACKUP_LICENSE","MANAGE_BACKUP_PACKAGE","MANAGE_BACKUP_SERVICE","MANAGE_BACKUP_STORE_REPOSITORY","MANAGE_BACKUP_PLAN","MANAGE_BACKUP_TASK","MANAGE_BACKUP_RESTORE_POINT","MANAGE_BACKUP_RESTORE_POINT_TASK","MANAGE_SECURITY_POLICY","MANAGE_SECURITY_GROUP","ISOLATE_VM","MANAGE_EVEROUTE_LICENSE","MANAGE_EVEROUTE_PACKAGE","DEPLOY_EVEROUTE_CLUSTER","UNDEPLOY_EVEROUTE_CLUSTER","UPDATE_EVEROUTE_CLUSTER","UPGRADE_EVEROUTE_CLUSTER","MANAGE_EVEROUTE_NETWORK_POLICY_RULE_SERVICE","MANAGE_EVEROUTE_CLUSTER_ASSOCIATION","MANAGE_EVEROUTE_CLUSTER_GLOBAL_POLICY","MANAGE_MICRO_SEGMENTATION","MANAGE_LOAD_BALANCER_RESOURCE","MANAGE_LOAD_BALANCER","MANAGE_LOAD_BALANCER_VNET_BOND","MANAGE_VIRTUAL_PRIVATE_CLOUD_SERVICE","MANAGE_VIRTUAL_PRIVATE_CLOUD_CLUSTER_BINDING","MANAGE_VIRTUAL_PRIVATE_CLOUD_EDGE_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_EXTERNAL_SUBNET","MANAGE_VIRTUAL_PRIVATE_CLOUD_BASIC_RESOURCE","MANAGE_VIRTUAL_PRIVATE_CLOUD_SECURITY_GROUP","MANAGE_VIRTUAL_PRIVATE_CLOUD_SECURITY_POLICY","MANAGE_VIRTUAL_PRIVATE_CLOUD_ISOLATION_POLICY","MANAGE_VIRTUAL_PRIVATE_CLOUD_FLOATING_IP","MANAGE_VIRTUAL_PRIVATE_CLOUD_ROUTER_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_NAT_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_LAYER2_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_PEERING","MANAGE_VIRTUAL_PRIVATE_CLOUD_LOAD_BALANCER_RESOURCE","MANAGE_LDAP_AD_CONFIG","MANAGE_MFA_CONFIG","MANAGE_DEFAULT_LOGIN_OPTION","MANAGE_CLUSTER_STORAGE_POLICY","MANAGE_SKS_SERVICE","MANAGE_SKS_LICENSE","CONFIGURE_SKS_SERVICE","CREATE_SKS_WORKLOAD_CLUSTER","DELETE_SKS_WORKLOAD_CLUSTER","UPDATE_SKS_WORKLOAD_CLUSTER","MANAGE_CONTAINER_REGISTRY","DOWNLOAD_SKS_WORKLOAD_CLUSTER_KUBECONFIG","DOWNLOAD_SKS_WORKLOAD_SPEC_FILE","MANAGE_SKS_WORKLOAD_CLUSTER_RECONCILE","MANAGE_OBSERVABILITY_PACKAGE","MANAGE_OBSERVABILITY_SERVICE","CONFIG_DYNAMIC_RESOURCE_SCHEDULE","GENERATE_DRS_PROPOSALS","APPLY_DRS_PROPOSAL","MANAGE_AGENT_MESH","MANAGE_REPLICATION_SERVICE","MANAGE_REPLICATION_RESTORE_POINT","MANAGE_REPLICATION_PLAN","MANAGE_REPLICATION_TASK","MANAGE_REPLICATION_FAULT_TASK","MANAGE_REPLICA_OBJECT","MANAGE_CLUSTER_PRIORITIZED","SMTX_INSPECTOR","MANAGE_SFS_LICENSE","MANAGE_SFS_IMAGE","MANAGE_SFS_FILE_STORAGE_CLUSTER","MANAGE_SFS_FILE_SYSTEM_CONFIG","MANAGE_SFS_FILE_SYSTEM_ACCESSIBILITY","MANAGE_SFS_SNAPSHOT","MANAGE_CLOUDTOWER_SNMP_TRANSPORT","MANAGE_CLOUD_TOWER_NTP","MANAGE_CLOUDTOWER_WEBHOOK_NOTIFIER","MANAGE_API_KEY"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["*","MANAGE_DATA_CENTER","MANAGE_CLUSTER_CONNECTION","MANAGE_STORAGE_CLUSTER_CONNECTION","MANAGE_PORT_ACCESS_CONTROL","MANAGE_HOST","MANAGE_NIC_MTU","MANAGE_DISK","MANAGE_HARDWARE_TOPO","MANAGE_USB_DEVICE","MANAGE_GPU_DEVICE","MANAGE_VDS","MANAGE_VLAN","MANAGE_SYSTEM_VLAN","MANAGE_ISCSI_DATA_STORE","MANAGE_NFS_DATA_STORE","MANAGE_NVMF_DATA_STORE","CREATE_VM","UPDATE_VM","DELETE_VM","UPDATE_VM_ADVANCED_SETTING","UPDATE_VM_GUEST","VM_OPERATION_OPEN_TERMINAL","VM_OPERATION_MIGRATE","VM_OPERATION_VM_FOLDER","VM_OPERATION_VM_POWER","VM_OPERATION_CLONE","VM_OPERATION_INSTALL_TOOLS","VM_IMPORT_EXPORT","CREATE_VM_TEMPLATE","MANAGE_VM_TEMPLATE","VM_TEMPLATE_IMPORT_EXPORT","MANAGE_VM_SNAPSHOT","MANAGE_VM_VOLUME","VM_VOLUME_IMPORT_EXPORT","MANAGE_ISO","DOWNLOAD_ISO","QUERY_SENSITIVE_RESOURCE_LIST","QUERY_SENSITIVE_RESOURCE","MANAGE_SENSITIVE_RESOURCE","MANAGE_VM_PLACEMENT_GROUP","MANAGE_SNAPSHOT_PLAN","MANAGE_ALERT","MANAGE_MONITOR_VIEW","MANAGE_ENTITY_FILTER","MANAGE_CLUSTER_BASIC_INFO","MANAGE_CLUSTER_LICENCE","MANAGE_CLUSTER_SNMP_TRANSPORT","MANAGE_SNMP_TRAP","MANAGE_CLUSTER_VIP","MANAGE_CLUSTER_MANAGEMENT_IP","MANAGE_DNS_SERVER","MANAGE_NTP_SERVER","MANAGE_IPMI","MANAGE_CLUSTER_VM_CPU_MODEL","MANAGE_CLUSTER_VM_TOOLS","MANAGE_CLUSTER_HOT_MIGRATION","MANAGE_CLUSTER_HA","MANAGE_SSL_CERTIFICATE","MANAGE_LOG_COLLECTION","MANAGE_SYSLOG","MANAGE_LOG_FIND","MANAGE_LABEL","MANAGE_USER_AND_ROLE","MANAGE_PASSWORD_SETTINGS","MANAGE_ACCESS_CONTROL","MANAGE_SESSION_EXPIRATION","MANAGE_VCENTER_ASSOCIATION","MANAGE_ESXI_ASSOCIATION","MANAGE_AUDIT_LOG","MANAGE_ALERT_EMAIL_SETTING","MANAGE_SMTP_SERVER","MANAGE_UPGRADE_CENTER","MANAGE_CLUSTER_UPGRADE","MANAGE_ALERT_NOTIFIER","MANAGE_VM_RECYCLE_BIN_SETTING","MANAGE_REPORT","MANAGE_SHARING_VM_TOOLS","MANAGE_ADVANCED_MONITOR","MANAGE_THIRD_PARTY_DRIVER","MANAGE_ORGANIZATION_NAME","MANAGE_CLOUD_TOWER_LICENSE","MANAGE_CONSISTENCY_GROUP","MANAGE_NIC","MANAGE_CLUSTER_ISCSI","MANAGE_BACKUP_LICENSE","MANAGE_BACKUP_PACKAGE","MANAGE_BACKUP_SERVICE","MANAGE_BACKUP_STORE_REPOSITORY","MANAGE_BACKUP_PLAN","MANAGE_BACKUP_TASK","MANAGE_BACKUP_RESTORE_POINT","MANAGE_BACKUP_RESTORE_POINT_TASK","MANAGE_SECURITY_POLICY","MANAGE_SECURITY_GROUP","ISOLATE_VM","MANAGE_EVEROUTE_LICENSE","MANAGE_EVEROUTE_PACKAGE","DEPLOY_EVEROUTE_CLUSTER","UNDEPLOY_EVEROUTE_CLUSTER","UPDATE_EVEROUTE_CLUSTER","UPGRADE_EVEROUTE_CLUSTER","MANAGE_EVEROUTE_NETWORK_POLICY_RULE_SERVICE","MANAGE_EVEROUTE_CLUSTER_ASSOCIATION","MANAGE_EVEROUTE_CLUSTER_GLOBAL_POLICY","MANAGE_MICRO_SEGMENTATION","MANAGE_LOAD_BALANCER_RESOURCE","MANAGE_LOAD_BALANCER","MANAGE_LOAD_BALANCER_VNET_BOND","MANAGE_VIRTUAL_PRIVATE_CLOUD_SERVICE","MANAGE_VIRTUAL_PRIVATE_CLOUD_CLUSTER_BINDING","MANAGE_VIRTUAL_PRIVATE_CLOUD_EDGE_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_EXTERNAL_SUBNET","MANAGE_VIRTUAL_PRIVATE_CLOUD_BASIC_RESOURCE","MANAGE_VIRTUAL_PRIVATE_CLOUD_SECURITY_GROUP","MANAGE_VIRTUAL_PRIVATE_CLOUD_SECURITY_POLICY","MANAGE_VIRTUAL_PRIVATE_CLOUD_ISOLATION_POLICY","MANAGE_VIRTUAL_PRIVATE_CLOUD_FLOATING_IP","MANAGE_VIRTUAL_PRIVATE_CLOUD_ROUTER_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_NAT_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_LAYER2_GATEWAY","MANAGE_VIRTUAL_PRIVATE_CLOUD_PEERING","MANAGE_VIRTUAL_PRIVATE_CLOUD_LOAD_BALANCER_RESOURCE","MANAGE_LDAP_AD_CONFIG","MANAGE_MFA_CONFIG","MANAGE_DEFAULT_LOGIN_OPTION","MANAGE_CLUSTER_STORAGE_POLICY","MANAGE_SKS_SERVICE","MANAGE_SKS_LICENSE","CONFIGURE_SKS_SERVICE","CREATE_SKS_WORKLOAD_CLUSTER","DELETE_SKS_WORKLOAD_CLUSTER","UPDATE_SKS_WORKLOAD_CLUSTER","MANAGE_CONTAINER_REGISTRY","DOWNLOAD_SKS_WORKLOAD_CLUSTER_KUBECONFIG","DOWNLOAD_SKS_WORKLOAD_SPEC_FILE","MANAGE_SKS_WORKLOAD_CLUSTER_RECONCILE","MANAGE_OBSERVABILITY_PACKAGE","MANAGE_OBSERVABILITY_SERVICE","CONFIG_DYNAMIC_RESOURCE_SCHEDULE","GENERATE_DRS_PROPOSALS","APPLY_DRS_PROPOSAL","MANAGE_AGENT_MESH","MANAGE_REPLICATION_SERVICE","MANAGE_REPLICATION_RESTORE_POINT","MANAGE_REPLICATION_PLAN","MANAGE_REPLICATION_TASK","MANAGE_REPLICATION_FAULT_TASK","MANAGE_REPLICA_OBJECT","MANAGE_CLUSTER_PRIORITIZED","SMTX_INSPECTOR","MANAGE_SFS_LICENSE","MANAGE_SFS_IMAGE","MANAGE_SFS_FILE_STORAGE_CLUSTER","MANAGE_SFS_FILE_SYSTEM_CONFIG","MANAGE_SFS_FILE_SYSTEM_ACCESSIBILITY","MANAGE_SFS_FS_CONTROLLER","MANAGE_SFS_SNAPSHOT","MANAGE_CLOUDTOWER_SNMP_TRANSPORT","MANAGE_CLOUD_TOWER_NTP","MANAGE_CLOUDTOWER_WEBHOOK_NOTIFIER","MANAGE_API_KEY","MANAGE_KMS_CLUSTER","MANAGE_CLUSTER_STORAGE_ENCRYPTION","MANAGE_SSO_LOGIN"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/replica_num.go b/models/replica_num.go new file mode 100644 index 00000000..b8bcb8ee --- /dev/null +++ b/models/replica_num.go @@ -0,0 +1,42 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReplicaNum replica num +// +// swagger:model ReplicaNum +type ReplicaNum int32 + +// Validate validates this replica num +func (m ReplicaNum) Validate(formats strfmt.Registry) error { + var res []error + + if err := validate.MinimumInt("", "body", int64(m), 2, false); err != nil { + return err + } + + if err := validate.MaximumInt("", "body", int64(m), 3, false); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this replica num based on context it is used +func (m ReplicaNum) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/models/security_policy.go b/models/security_policy.go index fd2ead40..88035c66 100644 --- a/models/security_policy.go +++ b/models/security_policy.go @@ -42,6 +42,10 @@ type SecurityPolicy struct { // ingress Ingress []*NestedNetworkPolicyRule `json:"ingress,omitempty"` + // is blocklist + // Required: true + IsBlocklist *bool `json:"is_blocklist"` + // name // Required: true Name *string `json:"name"` @@ -78,6 +82,10 @@ func (m *SecurityPolicy) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateIsBlocklist(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -209,6 +217,15 @@ func (m *SecurityPolicy) validateIngress(formats strfmt.Registry) error { return nil } +func (m *SecurityPolicy) validateIsBlocklist(formats strfmt.Registry) error { + + if err := validate.Required("is_blocklist", "body", m.IsBlocklist); err != nil { + return err + } + + return nil +} + func (m *SecurityPolicy) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/models/security_policy_order_by_input.go b/models/security_policy_order_by_input.go index a73da237..e830e98e 100644 --- a/models/security_policy_order_by_input.go +++ b/models/security_policy_order_by_input.go @@ -60,6 +60,12 @@ const ( // SecurityPolicyOrderByInputIngressDESC captures enum value "ingress_DESC" SecurityPolicyOrderByInputIngressDESC SecurityPolicyOrderByInput = "ingress_DESC" + // SecurityPolicyOrderByInputIsBlocklistASC captures enum value "is_blocklist_ASC" + SecurityPolicyOrderByInputIsBlocklistASC SecurityPolicyOrderByInput = "is_blocklist_ASC" + + // SecurityPolicyOrderByInputIsBlocklistDESC captures enum value "is_blocklist_DESC" + SecurityPolicyOrderByInputIsBlocklistDESC SecurityPolicyOrderByInput = "is_blocklist_DESC" + // SecurityPolicyOrderByInputNameASC captures enum value "name_ASC" SecurityPolicyOrderByInputNameASC SecurityPolicyOrderByInput = "name_ASC" @@ -78,7 +84,7 @@ var securityPolicyOrderByInputEnum []interface{} func init() { var res []SecurityPolicyOrderByInput - if err := json.Unmarshal([]byte(`["apply_to_ASC","apply_to_DESC","description_ASC","description_DESC","egress_ASC","egress_DESC","id_ASC","id_DESC","ingress_ASC","ingress_DESC","name_ASC","name_DESC","policy_mode_ASC","policy_mode_DESC"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["apply_to_ASC","apply_to_DESC","description_ASC","description_DESC","egress_ASC","egress_DESC","id_ASC","id_DESC","ingress_ASC","ingress_DESC","is_blocklist_ASC","is_blocklist_DESC","name_ASC","name_DESC","policy_mode_ASC","policy_mode_DESC"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/security_policy_where_input.go b/models/security_policy_where_input.go index 99616e4d..e6d030fa 100644 --- a/models/security_policy_where_input.go +++ b/models/security_policy_where_input.go @@ -115,6 +115,12 @@ type SecurityPolicyWhereInput struct { // id starts with IDStartsWith *string `json:"id_starts_with,omitempty"` + // is blocklist + IsBlocklist *bool `json:"is_blocklist,omitempty"` + + // is blocklist not + IsBlocklistNot *bool `json:"is_blocklist_not,omitempty"` + // name Name *string `json:"name,omitempty"` diff --git a/models/task_creation_params.go b/models/task_creation_params.go index 8169660d..92878041 100644 --- a/models/task_creation_params.go +++ b/models/task_creation_params.go @@ -30,6 +30,9 @@ type TaskCreationParams struct { // Required: true Description *TaskDescription `json:"description"` + // finished at + FinishedAt *string `json:"finished_at,omitempty"` + // internal Internal *bool `json:"internal,omitempty"` @@ -49,6 +52,9 @@ type TaskCreationParams struct { // Min Length: 1 ResourceType *string `json:"resource_type"` + // started at + StartedAt *string `json:"started_at,omitempty"` + // steps Steps []*TaskStepCreationParams `json:"steps,omitempty"` diff --git a/models/task_update_params.go b/models/task_update_params.go index bfdc3929..7ff63a80 100644 --- a/models/task_update_params.go +++ b/models/task_update_params.go @@ -167,7 +167,7 @@ type TaskUpdateParamsData struct { ClusterID *string `json:"cluster_id,omitempty"` // description - Description *string `json:"description,omitempty"` + Description *TaskDescription `json:"description,omitempty"` // error code ErrorCode *string `json:"error_code,omitempty"` @@ -175,6 +175,9 @@ type TaskUpdateParamsData struct { // error message ErrorMessage *string `json:"error_message,omitempty"` + // finished at + FinishedAt *string `json:"finished_at,omitempty"` + // key Key *string `json:"key,omitempty"` @@ -202,6 +205,9 @@ type TaskUpdateParamsData struct { // snapshot Snapshot *string `json:"snapshot,omitempty"` + // started at + StartedAt *string `json:"started_at,omitempty"` + // status Status *TaskStatus `json:"status,omitempty"` @@ -219,6 +225,10 @@ type TaskUpdateParamsData struct { func (m *TaskUpdateParamsData) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateStatus(formats); err != nil { res = append(res, err) } @@ -237,6 +247,25 @@ func (m *TaskUpdateParamsData) Validate(formats strfmt.Registry) error { return nil } +func (m *TaskUpdateParamsData) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if m.Description != nil { + if err := m.Description.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "description") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + "description") + } + return err + } + } + + return nil +} + func (m *TaskUpdateParamsData) validateStatus(formats strfmt.Registry) error { if swag.IsZero(m.Status) { // not required return nil @@ -305,6 +334,10 @@ func (m *TaskUpdateParamsData) validateType(formats strfmt.Registry) error { func (m *TaskUpdateParamsData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDescription(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateStatus(ctx, formats); err != nil { res = append(res, err) } @@ -323,6 +356,22 @@ func (m *TaskUpdateParamsData) ContextValidate(ctx context.Context, formats strf return nil } +func (m *TaskUpdateParamsData) contextValidateDescription(ctx context.Context, formats strfmt.Registry) error { + + if m.Description != nil { + if err := m.Description.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "description") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + "description") + } + return err + } + } + + return nil +} + func (m *TaskUpdateParamsData) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { diff --git a/models/user_source.go b/models/user_source.go index 95095b29..5368fc8e 100644 --- a/models/user_source.go +++ b/models/user_source.go @@ -38,6 +38,9 @@ const ( // UserSourceLOCAL captures enum value "LOCAL" UserSourceLOCAL UserSource = "LOCAL" + + // UserSourceSSO captures enum value "SSO" + UserSourceSSO UserSource = "SSO" ) // for schema @@ -45,7 +48,7 @@ var userSourceEnum []interface{} func init() { var res []UserSource - if err := json.Unmarshal([]byte(`["AUTHN","LDAP","LOCAL"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AUTHN","LDAP","LOCAL","SSO"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/virtual_private_cloud.go b/models/virtual_private_cloud.go index 61fda0d4..f5fec7cb 100644 --- a/models/virtual_private_cloud.go +++ b/models/virtual_private_cloud.go @@ -58,6 +58,10 @@ type VirtualPrivateCloud struct { // subnets Subnets []*NestedVirtualPrivateCloudSubnet `json:"subnets,omitempty"` + + // vpc service + // Required: true + VpcService *NestedVirtualPrivateCloudService `json:"vpc_service"` } // Validate validates this virtual private cloud @@ -100,6 +104,10 @@ func (m *VirtualPrivateCloud) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpcService(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -282,6 +290,26 @@ func (m *VirtualPrivateCloud) validateSubnets(formats strfmt.Registry) error { return nil } +func (m *VirtualPrivateCloud) validateVpcService(formats strfmt.Registry) error { + + if err := validate.Required("vpc_service", "body", m.VpcService); err != nil { + return err + } + + if m.VpcService != nil { + if err := m.VpcService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // ContextValidate validate this virtual private cloud based on the context it is used func (m *VirtualPrivateCloud) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -310,6 +338,10 @@ func (m *VirtualPrivateCloud) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateVpcService(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -432,6 +464,22 @@ func (m *VirtualPrivateCloud) contextValidateSubnets(ctx context.Context, format return nil } +func (m *VirtualPrivateCloud) contextValidateVpcService(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcService != nil { + if err := m.VpcService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VirtualPrivateCloud) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/virtual_private_cloud_cluster_binding.go b/models/virtual_private_cloud_cluster_binding.go index b2d5ce10..891b5e18 100644 --- a/models/virtual_private_cloud_cluster_binding.go +++ b/models/virtual_private_cloud_cluster_binding.go @@ -40,6 +40,10 @@ type VirtualPrivateCloudClusterBinding struct { // vlan id // Required: true VlanID *int32 `json:"vlan_id"` + + // vpc service + // Required: true + VpcService *NestedVirtualPrivateCloudService `json:"vpc_service"` } // Validate validates this virtual private cloud cluster binding @@ -66,6 +70,10 @@ func (m *VirtualPrivateCloudClusterBinding) Validate(formats strfmt.Registry) er res = append(res, err) } + if err := m.validateVpcService(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -149,6 +157,26 @@ func (m *VirtualPrivateCloudClusterBinding) validateVlanID(formats strfmt.Regist return nil } +func (m *VirtualPrivateCloudClusterBinding) validateVpcService(formats strfmt.Registry) error { + + if err := validate.Required("vpc_service", "body", m.VpcService); err != nil { + return err + } + + if m.VpcService != nil { + if err := m.VpcService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // ContextValidate validate this virtual private cloud cluster binding based on the context it is used func (m *VirtualPrivateCloudClusterBinding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -165,6 +193,10 @@ func (m *VirtualPrivateCloudClusterBinding) ContextValidate(ctx context.Context, res = append(res, err) } + if err := m.contextValidateVpcService(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -219,6 +251,22 @@ func (m *VirtualPrivateCloudClusterBinding) contextValidateVds(ctx context.Conte return nil } +func (m *VirtualPrivateCloudClusterBinding) contextValidateVpcService(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcService != nil { + if err := m.VpcService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VirtualPrivateCloudClusterBinding) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/virtual_private_cloud_cluster_binding_where_input.go b/models/virtual_private_cloud_cluster_binding_where_input.go index 8c6d9d8a..e2948ea2 100644 --- a/models/virtual_private_cloud_cluster_binding_where_input.go +++ b/models/virtual_private_cloud_cluster_binding_where_input.go @@ -135,6 +135,9 @@ type VirtualPrivateCloudClusterBindingWhereInput struct { // vlan id not in VlanIDNotIn []int32 `json:"vlan_id_not_in,omitempty"` + + // vpc service + VpcService *VirtualPrivateCloudServiceWhereInput `json:"vpc_service,omitempty"` } // Validate validates this virtual private cloud cluster binding where input @@ -177,6 +180,10 @@ func (m *VirtualPrivateCloudClusterBindingWhereInput) Validate(formats strfmt.Re res = append(res, err) } + if err := m.validateVpcService(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -379,6 +386,25 @@ func (m *VirtualPrivateCloudClusterBindingWhereInput) validateVds(formats strfmt return nil } +func (m *VirtualPrivateCloudClusterBindingWhereInput) validateVpcService(formats strfmt.Registry) error { + if swag.IsZero(m.VpcService) { // not required + return nil + } + + if m.VpcService != nil { + if err := m.VpcService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // ContextValidate validate this virtual private cloud cluster binding where input based on the context it is used func (m *VirtualPrivateCloudClusterBindingWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -419,6 +445,10 @@ func (m *VirtualPrivateCloudClusterBindingWhereInput) ContextValidate(ctx contex res = append(res, err) } + if err := m.contextValidateVpcService(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -585,6 +615,22 @@ func (m *VirtualPrivateCloudClusterBindingWhereInput) contextValidateVds(ctx con return nil } +func (m *VirtualPrivateCloudClusterBindingWhereInput) contextValidateVpcService(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcService != nil { + if err := m.VpcService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VirtualPrivateCloudClusterBindingWhereInput) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/virtual_private_cloud_edge_gateway_group_where_input.go b/models/virtual_private_cloud_edge_gateway_group_where_input.go new file mode 100644 index 00000000..eb1fa7c6 --- /dev/null +++ b/models/virtual_private_cloud_edge_gateway_group_where_input.go @@ -0,0 +1,978 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VirtualPrivateCloudEdgeGatewayGroupWhereInput virtual private cloud edge gateway group where input +// +// swagger:model VirtualPrivateCloudEdgeGatewayGroupWhereInput +type VirtualPrivateCloudEdgeGatewayGroupWhereInput struct { + + // a n d + AND []*VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"AND,omitempty"` + + // n o t + NOT []*VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"NOT,omitempty"` + + // o r + OR []*VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"OR,omitempty"` + + // created at + CreatedAt *string `json:"createdAt,omitempty"` + + // created at gt + CreatedAtGt *string `json:"createdAt_gt,omitempty"` + + // created at gte + CreatedAtGte *string `json:"createdAt_gte,omitempty"` + + // created at in + CreatedAtIn []string `json:"createdAt_in,omitempty"` + + // created at lt + CreatedAtLt *string `json:"createdAt_lt,omitempty"` + + // created at lte + CreatedAtLte *string `json:"createdAt_lte,omitempty"` + + // created at not + CreatedAtNot *string `json:"createdAt_not,omitempty"` + + // created at not in + CreatedAtNotIn []string `json:"createdAt_not_in,omitempty"` + + // description + Description *string `json:"description,omitempty"` + + // description contains + DescriptionContains *string `json:"description_contains,omitempty"` + + // description ends with + DescriptionEndsWith *string `json:"description_ends_with,omitempty"` + + // description gt + DescriptionGt *string `json:"description_gt,omitempty"` + + // description gte + DescriptionGte *string `json:"description_gte,omitempty"` + + // description in + DescriptionIn []string `json:"description_in,omitempty"` + + // description lt + DescriptionLt *string `json:"description_lt,omitempty"` + + // description lte + DescriptionLte *string `json:"description_lte,omitempty"` + + // description not + DescriptionNot *string `json:"description_not,omitempty"` + + // description not contains + DescriptionNotContains *string `json:"description_not_contains,omitempty"` + + // description not ends with + DescriptionNotEndsWith *string `json:"description_not_ends_with,omitempty"` + + // description not in + DescriptionNotIn []string `json:"description_not_in,omitempty"` + + // description not starts with + DescriptionNotStartsWith *string `json:"description_not_starts_with,omitempty"` + + // description starts with + DescriptionStartsWith *string `json:"description_starts_with,omitempty"` + + // edge gateways every + EdgeGatewaysEvery *VirtualPrivateCloudEdgeGatewayWhereInput `json:"edge_gateways_every,omitempty"` + + // edge gateways none + EdgeGatewaysNone *VirtualPrivateCloudEdgeGatewayWhereInput `json:"edge_gateways_none,omitempty"` + + // edge gateways some + EdgeGatewaysSome *VirtualPrivateCloudEdgeGatewayWhereInput `json:"edge_gateways_some,omitempty"` + + // entity async status + EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` + + // entity async status in + EntityAsyncStatusIn []EntityAsyncStatus `json:"entityAsyncStatus_in,omitempty"` + + // entity async status not + EntityAsyncStatusNot *EntityAsyncStatus `json:"entityAsyncStatus_not,omitempty"` + + // entity async status not in + EntityAsyncStatusNotIn []EntityAsyncStatus `json:"entityAsyncStatus_not_in,omitempty"` + + // external subnet groups every + ExternalSubnetGroupsEvery *VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"external_subnet_groups_every,omitempty"` + + // external subnet groups none + ExternalSubnetGroupsNone *VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"external_subnet_groups_none,omitempty"` + + // external subnet groups some + ExternalSubnetGroupsSome *VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"external_subnet_groups_some,omitempty"` + + // id + ID *string `json:"id,omitempty"` + + // id contains + IDContains *string `json:"id_contains,omitempty"` + + // id ends with + IDEndsWith *string `json:"id_ends_with,omitempty"` + + // id gt + IDGt *string `json:"id_gt,omitempty"` + + // id gte + IDGte *string `json:"id_gte,omitempty"` + + // id in + IDIn []string `json:"id_in,omitempty"` + + // id lt + IDLt *string `json:"id_lt,omitempty"` + + // id lte + IDLte *string `json:"id_lte,omitempty"` + + // id not + IDNot *string `json:"id_not,omitempty"` + + // id not contains + IDNotContains *string `json:"id_not_contains,omitempty"` + + // id not ends with + IDNotEndsWith *string `json:"id_not_ends_with,omitempty"` + + // id not in + IDNotIn []string `json:"id_not_in,omitempty"` + + // id not starts with + IDNotStartsWith *string `json:"id_not_starts_with,omitempty"` + + // id starts with + IDStartsWith *string `json:"id_starts_with,omitempty"` + + // local id + LocalID *string `json:"local_id,omitempty"` + + // local id contains + LocalIDContains *string `json:"local_id_contains,omitempty"` + + // local id ends with + LocalIDEndsWith *string `json:"local_id_ends_with,omitempty"` + + // local id gt + LocalIDGt *string `json:"local_id_gt,omitempty"` + + // local id gte + LocalIDGte *string `json:"local_id_gte,omitempty"` + + // local id in + LocalIDIn []string `json:"local_id_in,omitempty"` + + // local id lt + LocalIDLt *string `json:"local_id_lt,omitempty"` + + // local id lte + LocalIDLte *string `json:"local_id_lte,omitempty"` + + // local id not + LocalIDNot *string `json:"local_id_not,omitempty"` + + // local id not contains + LocalIDNotContains *string `json:"local_id_not_contains,omitempty"` + + // local id not ends with + LocalIDNotEndsWith *string `json:"local_id_not_ends_with,omitempty"` + + // local id not in + LocalIDNotIn []string `json:"local_id_not_in,omitempty"` + + // local id not starts with + LocalIDNotStartsWith *string `json:"local_id_not_starts_with,omitempty"` + + // local id starts with + LocalIDStartsWith *string `json:"local_id_starts_with,omitempty"` + + // name + Name *string `json:"name,omitempty"` + + // name contains + NameContains *string `json:"name_contains,omitempty"` + + // name ends with + NameEndsWith *string `json:"name_ends_with,omitempty"` + + // name gt + NameGt *string `json:"name_gt,omitempty"` + + // name gte + NameGte *string `json:"name_gte,omitempty"` + + // name in + NameIn []string `json:"name_in,omitempty"` + + // name lt + NameLt *string `json:"name_lt,omitempty"` + + // name lte + NameLte *string `json:"name_lte,omitempty"` + + // name not + NameNot *string `json:"name_not,omitempty"` + + // name not contains + NameNotContains *string `json:"name_not_contains,omitempty"` + + // name not ends with + NameNotEndsWith *string `json:"name_not_ends_with,omitempty"` + + // name not in + NameNotIn []string `json:"name_not_in,omitempty"` + + // name not starts with + NameNotStartsWith *string `json:"name_not_starts_with,omitempty"` + + // name starts with + NameStartsWith *string `json:"name_starts_with,omitempty"` + + // primary edge gateway id + PrimaryEdgeGatewayID *string `json:"primary_edge_gateway_id,omitempty"` + + // primary edge gateway id contains + PrimaryEdgeGatewayIDContains *string `json:"primary_edge_gateway_id_contains,omitempty"` + + // primary edge gateway id ends with + PrimaryEdgeGatewayIDEndsWith *string `json:"primary_edge_gateway_id_ends_with,omitempty"` + + // primary edge gateway id gt + PrimaryEdgeGatewayIDGt *string `json:"primary_edge_gateway_id_gt,omitempty"` + + // primary edge gateway id gte + PrimaryEdgeGatewayIDGte *string `json:"primary_edge_gateway_id_gte,omitempty"` + + // primary edge gateway id in + PrimaryEdgeGatewayIDIn []string `json:"primary_edge_gateway_id_in,omitempty"` + + // primary edge gateway id lt + PrimaryEdgeGatewayIDLt *string `json:"primary_edge_gateway_id_lt,omitempty"` + + // primary edge gateway id lte + PrimaryEdgeGatewayIDLte *string `json:"primary_edge_gateway_id_lte,omitempty"` + + // primary edge gateway id not + PrimaryEdgeGatewayIDNot *string `json:"primary_edge_gateway_id_not,omitempty"` + + // primary edge gateway id not contains + PrimaryEdgeGatewayIDNotContains *string `json:"primary_edge_gateway_id_not_contains,omitempty"` + + // primary edge gateway id not ends with + PrimaryEdgeGatewayIDNotEndsWith *string `json:"primary_edge_gateway_id_not_ends_with,omitempty"` + + // primary edge gateway id not in + PrimaryEdgeGatewayIDNotIn []string `json:"primary_edge_gateway_id_not_in,omitempty"` + + // primary edge gateway id not starts with + PrimaryEdgeGatewayIDNotStartsWith *string `json:"primary_edge_gateway_id_not_starts_with,omitempty"` + + // primary edge gateway id starts with + PrimaryEdgeGatewayIDStartsWith *string `json:"primary_edge_gateway_id_starts_with,omitempty"` + + // vpc service + VpcService *VirtualPrivateCloudServiceWhereInput `json:"vpc_service,omitempty"` +} + +// Validate validates this virtual private cloud edge gateway group where input +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAND(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNOT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOR(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewaysEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewaysNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewaysSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusNotIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalSubnetGroupsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalSubnetGroupsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalSubnetGroupsSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVpcService(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateAND(formats strfmt.Registry) error { + if swag.IsZero(m.AND) { // not required + return nil + } + + for i := 0; i < len(m.AND); i++ { + if swag.IsZero(m.AND[i]) { // not required + continue + } + + if m.AND[i] != nil { + if err := m.AND[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AND" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AND" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateNOT(formats strfmt.Registry) error { + if swag.IsZero(m.NOT) { // not required + return nil + } + + for i := 0; i < len(m.NOT); i++ { + if swag.IsZero(m.NOT[i]) { // not required + continue + } + + if m.NOT[i] != nil { + if err := m.NOT[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NOT" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NOT" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateOR(formats strfmt.Registry) error { + if swag.IsZero(m.OR) { // not required + return nil + } + + for i := 0; i < len(m.OR); i++ { + if swag.IsZero(m.OR[i]) { // not required + continue + } + + if m.OR[i] != nil { + if err := m.OR[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("OR" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("OR" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEdgeGatewaysEvery(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewaysEvery) { // not required + return nil + } + + if m.EdgeGatewaysEvery != nil { + if err := m.EdgeGatewaysEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEdgeGatewaysNone(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewaysNone) { // not required + return nil + } + + if m.EdgeGatewaysNone != nil { + if err := m.EdgeGatewaysNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEdgeGatewaysSome(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewaysSome) { // not required + return nil + } + + if m.EdgeGatewaysSome != nil { + if err := m.EdgeGatewaysSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatus) { // not required + return nil + } + + if m.EntityAsyncStatus != nil { + if err := m.EntityAsyncStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEntityAsyncStatusIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + + if err := m.EntityAsyncStatusIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEntityAsyncStatusNot(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNot) { // not required + return nil + } + + if m.EntityAsyncStatusNot != nil { + if err := m.EntityAsyncStatusNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateEntityAsyncStatusNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNotIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { + + if err := m.EntityAsyncStatusNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateExternalSubnetGroupsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalSubnetGroupsEvery) { // not required + return nil + } + + if m.ExternalSubnetGroupsEvery != nil { + if err := m.ExternalSubnetGroupsEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateExternalSubnetGroupsNone(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalSubnetGroupsNone) { // not required + return nil + } + + if m.ExternalSubnetGroupsNone != nil { + if err := m.ExternalSubnetGroupsNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateExternalSubnetGroupsSome(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalSubnetGroupsSome) { // not required + return nil + } + + if m.ExternalSubnetGroupsSome != nil { + if err := m.ExternalSubnetGroupsSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) validateVpcService(formats strfmt.Registry) error { + if swag.IsZero(m.VpcService) { // not required + return nil + } + + if m.VpcService != nil { + if err := m.VpcService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this virtual private cloud edge gateway group where input based on the context it is used +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAND(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNOT(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOR(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewaysEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewaysNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewaysSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternalSubnetGroupsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternalSubnetGroupsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternalSubnetGroupsSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpcService(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateAND(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AND); i++ { + + if m.AND[i] != nil { + if err := m.AND[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AND" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AND" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateNOT(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NOT); i++ { + + if m.NOT[i] != nil { + if err := m.NOT[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NOT" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NOT" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateOR(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OR); i++ { + + if m.OR[i] != nil { + if err := m.OR[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("OR" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("OR" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEdgeGatewaysEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewaysEvery != nil { + if err := m.EdgeGatewaysEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEdgeGatewaysNone(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewaysNone != nil { + if err := m.EdgeGatewaysNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEdgeGatewaysSome(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewaysSome != nil { + if err := m.EdgeGatewaysSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.EntityAsyncStatus != nil { + if err := m.EntityAsyncStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEntityAsyncStatusIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + + if err := m.EntityAsyncStatusIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEntityAsyncStatusNot(ctx context.Context, formats strfmt.Registry) error { + + if m.EntityAsyncStatusNot != nil { + if err := m.EntityAsyncStatusNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateEntityAsyncStatusNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { + + if err := m.EntityAsyncStatusNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateExternalSubnetGroupsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.ExternalSubnetGroupsEvery != nil { + if err := m.ExternalSubnetGroupsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateExternalSubnetGroupsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.ExternalSubnetGroupsNone != nil { + if err := m.ExternalSubnetGroupsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateExternalSubnetGroupsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.ExternalSubnetGroupsSome != nil { + if err := m.ExternalSubnetGroupsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_subnet_groups_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_subnet_groups_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) contextValidateVpcService(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcService != nil { + if err := m.VpcService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualPrivateCloudEdgeGatewayGroupWhereInput) UnmarshalBinary(b []byte) error { + var res VirtualPrivateCloudEdgeGatewayGroupWhereInput + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/virtual_private_cloud_edge_gateway_where_input.go b/models/virtual_private_cloud_edge_gateway_where_input.go index b6e3fe34..9f9a0fb5 100644 --- a/models/virtual_private_cloud_edge_gateway_where_input.go +++ b/models/virtual_private_cloud_edge_gateway_where_input.go @@ -55,6 +55,30 @@ type VirtualPrivateCloudEdgeGatewayWhereInput struct { // cpu number not in CPUNumberNotIn []int32 `json:"cpu_number_not_in,omitempty"` + // created at + CreatedAt *string `json:"createdAt,omitempty"` + + // created at gt + CreatedAtGt *string `json:"createdAt_gt,omitempty"` + + // created at gte + CreatedAtGte *string `json:"createdAt_gte,omitempty"` + + // created at in + CreatedAtIn []string `json:"createdAt_in,omitempty"` + + // created at lt + CreatedAtLt *string `json:"createdAt_lt,omitempty"` + + // created at lte + CreatedAtLte *string `json:"createdAt_lte,omitempty"` + + // created at not + CreatedAtNot *string `json:"createdAt_not,omitempty"` + + // created at not in + CreatedAtNotIn []string `json:"createdAt_not_in,omitempty"` + // data volume size DataVolumeSize *int32 `json:"data_volume_size,omitempty"` @@ -121,6 +145,9 @@ type VirtualPrivateCloudEdgeGatewayWhereInput struct { // description starts with DescriptionStartsWith *string `json:"description_starts_with,omitempty"` + // edge gateway group + EdgeGatewayGroup *VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"edge_gateway_group,omitempty"` + // entity async status EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` @@ -379,6 +406,10 @@ func (m *VirtualPrivateCloudEdgeGatewayWhereInput) Validate(formats strfmt.Regis res = append(res, err) } + if err := m.validateEdgeGatewayGroup(formats); err != nil { + res = append(res, err) + } + if err := m.validateEntityAsyncStatus(formats); err != nil { res = append(res, err) } @@ -542,6 +573,25 @@ func (m *VirtualPrivateCloudEdgeGatewayWhereInput) validateCluster(formats strfm return nil } +func (m *VirtualPrivateCloudEdgeGatewayWhereInput) validateEdgeGatewayGroup(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewayGroup) { // not required + return nil + } + + if m.EdgeGatewayGroup != nil { + if err := m.EdgeGatewayGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_group") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudEdgeGatewayWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { if swag.IsZero(m.EntityAsyncStatus) { // not required return nil @@ -855,6 +905,10 @@ func (m *VirtualPrivateCloudEdgeGatewayWhereInput) ContextValidate(ctx context.C res = append(res, err) } + if err := m.contextValidateEdgeGatewayGroup(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } @@ -997,6 +1051,22 @@ func (m *VirtualPrivateCloudEdgeGatewayWhereInput) contextValidateCluster(ctx co return nil } +func (m *VirtualPrivateCloudEdgeGatewayWhereInput) contextValidateEdgeGatewayGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewayGroup != nil { + if err := m.EdgeGatewayGroup.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_group") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudEdgeGatewayWhereInput) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { diff --git a/models/virtual_private_cloud_external_subnet.go b/models/virtual_private_cloud_external_subnet.go index 0b4b7e81..6c107729 100644 --- a/models/virtual_private_cloud_external_subnet.go +++ b/models/virtual_private_cloud_external_subnet.go @@ -27,9 +27,16 @@ type VirtualPrivateCloudExternalSubnet struct { // description Description *string `json:"description,omitempty"` + // edge gateway + EdgeGateway *NestedVirtualPrivateCloudEdgeGateway `json:"edge_gateway,omitempty"` + // entity async status EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` + // exclusive + // Required: true + Exclusive *bool `json:"exclusive"` + // floating ip cidr FloatingIPCidr *string `json:"floating_ip_cidr,omitempty"` @@ -80,10 +87,18 @@ func (m *VirtualPrivateCloudExternalSubnet) Validate(formats strfmt.Registry) er res = append(res, err) } + if err := m.validateEdgeGateway(formats); err != nil { + res = append(res, err) + } + if err := m.validateEntityAsyncStatus(formats); err != nil { res = append(res, err) } + if err := m.validateExclusive(formats); err != nil { + res = append(res, err) + } + if err := m.validateFloatingIps(formats); err != nil { res = append(res, err) } @@ -135,6 +150,25 @@ func (m *VirtualPrivateCloudExternalSubnet) validateCidr(formats strfmt.Registry return nil } +func (m *VirtualPrivateCloudExternalSubnet) validateEdgeGateway(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGateway) { // not required + return nil + } + + if m.EdgeGateway != nil { + if err := m.EdgeGateway.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudExternalSubnet) validateEntityAsyncStatus(formats strfmt.Registry) error { if swag.IsZero(m.EntityAsyncStatus) { // not required return nil @@ -154,6 +188,15 @@ func (m *VirtualPrivateCloudExternalSubnet) validateEntityAsyncStatus(formats st return nil } +func (m *VirtualPrivateCloudExternalSubnet) validateExclusive(formats strfmt.Registry) error { + + if err := validate.Required("exclusive", "body", m.Exclusive); err != nil { + return err + } + + return nil +} + func (m *VirtualPrivateCloudExternalSubnet) validateFloatingIps(formats strfmt.Registry) error { if swag.IsZero(m.FloatingIps) { // not required return nil @@ -311,6 +354,10 @@ func (m *VirtualPrivateCloudExternalSubnet) validateVpc(formats strfmt.Registry) func (m *VirtualPrivateCloudExternalSubnet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateEdgeGateway(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } @@ -341,6 +388,22 @@ func (m *VirtualPrivateCloudExternalSubnet) ContextValidate(ctx context.Context, return nil } +func (m *VirtualPrivateCloudExternalSubnet) contextValidateEdgeGateway(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGateway != nil { + if err := m.EdgeGateway.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudExternalSubnet) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { diff --git a/models/virtual_private_cloud_external_subnet_group_where_input.go b/models/virtual_private_cloud_external_subnet_group_where_input.go new file mode 100644 index 00000000..1bc75ba6 --- /dev/null +++ b/models/virtual_private_cloud_external_subnet_group_where_input.go @@ -0,0 +1,1132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VirtualPrivateCloudExternalSubnetGroupWhereInput virtual private cloud external subnet group where input +// +// swagger:model VirtualPrivateCloudExternalSubnetGroupWhereInput +type VirtualPrivateCloudExternalSubnetGroupWhereInput struct { + + // a n d + AND []*VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"AND,omitempty"` + + // n o t + NOT []*VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"NOT,omitempty"` + + // o r + OR []*VirtualPrivateCloudExternalSubnetGroupWhereInput `json:"OR,omitempty"` + + // created at + CreatedAt *string `json:"createdAt,omitempty"` + + // created at gt + CreatedAtGt *string `json:"createdAt_gt,omitempty"` + + // created at gte + CreatedAtGte *string `json:"createdAt_gte,omitempty"` + + // created at in + CreatedAtIn []string `json:"createdAt_in,omitempty"` + + // created at lt + CreatedAtLt *string `json:"createdAt_lt,omitempty"` + + // created at lte + CreatedAtLte *string `json:"createdAt_lte,omitempty"` + + // created at not + CreatedAtNot *string `json:"createdAt_not,omitempty"` + + // created at not in + CreatedAtNotIn []string `json:"createdAt_not_in,omitempty"` + + // description + Description *string `json:"description,omitempty"` + + // description contains + DescriptionContains *string `json:"description_contains,omitempty"` + + // description ends with + DescriptionEndsWith *string `json:"description_ends_with,omitempty"` + + // description gt + DescriptionGt *string `json:"description_gt,omitempty"` + + // description gte + DescriptionGte *string `json:"description_gte,omitempty"` + + // description in + DescriptionIn []string `json:"description_in,omitempty"` + + // description lt + DescriptionLt *string `json:"description_lt,omitempty"` + + // description lte + DescriptionLte *string `json:"description_lte,omitempty"` + + // description not + DescriptionNot *string `json:"description_not,omitempty"` + + // description not contains + DescriptionNotContains *string `json:"description_not_contains,omitempty"` + + // description not ends with + DescriptionNotEndsWith *string `json:"description_not_ends_with,omitempty"` + + // description not in + DescriptionNotIn []string `json:"description_not_in,omitempty"` + + // description not starts with + DescriptionNotStartsWith *string `json:"description_not_starts_with,omitempty"` + + // description starts with + DescriptionStartsWith *string `json:"description_starts_with,omitempty"` + + // edge gateway group + EdgeGatewayGroup *VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"edge_gateway_group,omitempty"` + + // entity async status + EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` + + // entity async status in + EntityAsyncStatusIn []EntityAsyncStatus `json:"entityAsyncStatus_in,omitempty"` + + // entity async status not + EntityAsyncStatusNot *EntityAsyncStatus `json:"entityAsyncStatus_not,omitempty"` + + // entity async status not in + EntityAsyncStatusNotIn []EntityAsyncStatus `json:"entityAsyncStatus_not_in,omitempty"` + + // exclusive + Exclusive *bool `json:"exclusive,omitempty"` + + // exclusive not + ExclusiveNot *bool `json:"exclusive_not,omitempty"` + + // floating ips every + FloatingIpsEvery *VirtualPrivateCloudFloatingIPWhereInput `json:"floating_ips_every,omitempty"` + + // floating ips none + FloatingIpsNone *VirtualPrivateCloudFloatingIPWhereInput `json:"floating_ips_none,omitempty"` + + // floating ips some + FloatingIpsSome *VirtualPrivateCloudFloatingIPWhereInput `json:"floating_ips_some,omitempty"` + + // id + ID *string `json:"id,omitempty"` + + // id contains + IDContains *string `json:"id_contains,omitempty"` + + // id ends with + IDEndsWith *string `json:"id_ends_with,omitempty"` + + // id gt + IDGt *string `json:"id_gt,omitempty"` + + // id gte + IDGte *string `json:"id_gte,omitempty"` + + // id in + IDIn []string `json:"id_in,omitempty"` + + // id lt + IDLt *string `json:"id_lt,omitempty"` + + // id lte + IDLte *string `json:"id_lte,omitempty"` + + // id not + IDNot *string `json:"id_not,omitempty"` + + // id not contains + IDNotContains *string `json:"id_not_contains,omitempty"` + + // id not ends with + IDNotEndsWith *string `json:"id_not_ends_with,omitempty"` + + // id not in + IDNotIn []string `json:"id_not_in,omitempty"` + + // id not starts with + IDNotStartsWith *string `json:"id_not_starts_with,omitempty"` + + // id starts with + IDStartsWith *string `json:"id_starts_with,omitempty"` + + // local id + LocalID *string `json:"local_id,omitempty"` + + // local id contains + LocalIDContains *string `json:"local_id_contains,omitempty"` + + // local id ends with + LocalIDEndsWith *string `json:"local_id_ends_with,omitempty"` + + // local id gt + LocalIDGt *string `json:"local_id_gt,omitempty"` + + // local id gte + LocalIDGte *string `json:"local_id_gte,omitempty"` + + // local id in + LocalIDIn []string `json:"local_id_in,omitempty"` + + // local id lt + LocalIDLt *string `json:"local_id_lt,omitempty"` + + // local id lte + LocalIDLte *string `json:"local_id_lte,omitempty"` + + // local id not + LocalIDNot *string `json:"local_id_not,omitempty"` + + // local id not contains + LocalIDNotContains *string `json:"local_id_not_contains,omitempty"` + + // local id not ends with + LocalIDNotEndsWith *string `json:"local_id_not_ends_with,omitempty"` + + // local id not in + LocalIDNotIn []string `json:"local_id_not_in,omitempty"` + + // local id not starts with + LocalIDNotStartsWith *string `json:"local_id_not_starts_with,omitempty"` + + // local id starts with + LocalIDStartsWith *string `json:"local_id_starts_with,omitempty"` + + // name + Name *string `json:"name,omitempty"` + + // name contains + NameContains *string `json:"name_contains,omitempty"` + + // name ends with + NameEndsWith *string `json:"name_ends_with,omitempty"` + + // name gt + NameGt *string `json:"name_gt,omitempty"` + + // name gte + NameGte *string `json:"name_gte,omitempty"` + + // name in + NameIn []string `json:"name_in,omitempty"` + + // name lt + NameLt *string `json:"name_lt,omitempty"` + + // name lte + NameLte *string `json:"name_lte,omitempty"` + + // name not + NameNot *string `json:"name_not,omitempty"` + + // name not contains + NameNotContains *string `json:"name_not_contains,omitempty"` + + // name not ends with + NameNotEndsWith *string `json:"name_not_ends_with,omitempty"` + + // name not in + NameNotIn []string `json:"name_not_in,omitempty"` + + // name not starts with + NameNotStartsWith *string `json:"name_not_starts_with,omitempty"` + + // name starts with + NameStartsWith *string `json:"name_starts_with,omitempty"` + + // nat gateways every + NatGatewaysEvery *VirtualPrivateCloudNatGatewayWhereInput `json:"nat_gateways_every,omitempty"` + + // nat gateways none + NatGatewaysNone *VirtualPrivateCloudNatGatewayWhereInput `json:"nat_gateways_none,omitempty"` + + // nat gateways some + NatGatewaysSome *VirtualPrivateCloudNatGatewayWhereInput `json:"nat_gateways_some,omitempty"` + + // router gateways every + RouterGatewaysEvery *VirtualPrivateCloudRouterGatewayWhereInput `json:"router_gateways_every,omitempty"` + + // router gateways none + RouterGatewaysNone *VirtualPrivateCloudRouterGatewayWhereInput `json:"router_gateways_none,omitempty"` + + // router gateways some + RouterGatewaysSome *VirtualPrivateCloudRouterGatewayWhereInput `json:"router_gateways_some,omitempty"` + + // shared in edge gateway group + SharedInEdgeGatewayGroup *bool `json:"shared_in_edge_gateway_group,omitempty"` + + // shared in edge gateway group not + SharedInEdgeGatewayGroupNot *bool `json:"shared_in_edge_gateway_group_not,omitempty"` + + // vpc + Vpc *VirtualPrivateCloudWhereInput `json:"vpc,omitempty"` +} + +// Validate validates this virtual private cloud external subnet group where input +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAND(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNOT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOR(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewayGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusNot(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityAsyncStatusNotIn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFloatingIpsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFloatingIpsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFloatingIpsSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatGatewaysEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatGatewaysNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatGatewaysSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouterGatewaysEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouterGatewaysNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouterGatewaysSome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVpc(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateAND(formats strfmt.Registry) error { + if swag.IsZero(m.AND) { // not required + return nil + } + + for i := 0; i < len(m.AND); i++ { + if swag.IsZero(m.AND[i]) { // not required + continue + } + + if m.AND[i] != nil { + if err := m.AND[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AND" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AND" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateNOT(formats strfmt.Registry) error { + if swag.IsZero(m.NOT) { // not required + return nil + } + + for i := 0; i < len(m.NOT); i++ { + if swag.IsZero(m.NOT[i]) { // not required + continue + } + + if m.NOT[i] != nil { + if err := m.NOT[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NOT" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NOT" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateOR(formats strfmt.Registry) error { + if swag.IsZero(m.OR) { // not required + return nil + } + + for i := 0; i < len(m.OR); i++ { + if swag.IsZero(m.OR[i]) { // not required + continue + } + + if m.OR[i] != nil { + if err := m.OR[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("OR" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("OR" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateEdgeGatewayGroup(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewayGroup) { // not required + return nil + } + + if m.EdgeGatewayGroup != nil { + if err := m.EdgeGatewayGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_group") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatus) { // not required + return nil + } + + if m.EntityAsyncStatus != nil { + if err := m.EntityAsyncStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateEntityAsyncStatusIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + + if err := m.EntityAsyncStatusIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateEntityAsyncStatusNot(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNot) { // not required + return nil + } + + if m.EntityAsyncStatusNot != nil { + if err := m.EntityAsyncStatusNot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateEntityAsyncStatusNotIn(formats strfmt.Registry) error { + if swag.IsZero(m.EntityAsyncStatusNotIn) { // not required + return nil + } + + for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { + + if err := m.EntityAsyncStatusNotIn[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateFloatingIpsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.FloatingIpsEvery) { // not required + return nil + } + + if m.FloatingIpsEvery != nil { + if err := m.FloatingIpsEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateFloatingIpsNone(formats strfmt.Registry) error { + if swag.IsZero(m.FloatingIpsNone) { // not required + return nil + } + + if m.FloatingIpsNone != nil { + if err := m.FloatingIpsNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateFloatingIpsSome(formats strfmt.Registry) error { + if swag.IsZero(m.FloatingIpsSome) { // not required + return nil + } + + if m.FloatingIpsSome != nil { + if err := m.FloatingIpsSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateNatGatewaysEvery(formats strfmt.Registry) error { + if swag.IsZero(m.NatGatewaysEvery) { // not required + return nil + } + + if m.NatGatewaysEvery != nil { + if err := m.NatGatewaysEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateNatGatewaysNone(formats strfmt.Registry) error { + if swag.IsZero(m.NatGatewaysNone) { // not required + return nil + } + + if m.NatGatewaysNone != nil { + if err := m.NatGatewaysNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateNatGatewaysSome(formats strfmt.Registry) error { + if swag.IsZero(m.NatGatewaysSome) { // not required + return nil + } + + if m.NatGatewaysSome != nil { + if err := m.NatGatewaysSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateRouterGatewaysEvery(formats strfmt.Registry) error { + if swag.IsZero(m.RouterGatewaysEvery) { // not required + return nil + } + + if m.RouterGatewaysEvery != nil { + if err := m.RouterGatewaysEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateRouterGatewaysNone(formats strfmt.Registry) error { + if swag.IsZero(m.RouterGatewaysNone) { // not required + return nil + } + + if m.RouterGatewaysNone != nil { + if err := m.RouterGatewaysNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateRouterGatewaysSome(formats strfmt.Registry) error { + if swag.IsZero(m.RouterGatewaysSome) { // not required + return nil + } + + if m.RouterGatewaysSome != nil { + if err := m.RouterGatewaysSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) validateVpc(formats strfmt.Registry) error { + if swag.IsZero(m.Vpc) { // not required + return nil + } + + if m.Vpc != nil { + if err := m.Vpc.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this virtual private cloud external subnet group where input based on the context it is used +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAND(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNOT(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOR(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewayGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNot(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntityAsyncStatusNotIn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFloatingIpsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFloatingIpsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFloatingIpsSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNatGatewaysEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNatGatewaysNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNatGatewaysSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRouterGatewaysEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRouterGatewaysNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRouterGatewaysSome(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpc(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateAND(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AND); i++ { + + if m.AND[i] != nil { + if err := m.AND[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AND" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AND" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateNOT(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NOT); i++ { + + if m.NOT[i] != nil { + if err := m.NOT[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NOT" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NOT" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateOR(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OR); i++ { + + if m.OR[i] != nil { + if err := m.OR[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("OR" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("OR" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateEdgeGatewayGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewayGroup != nil { + if err := m.EdgeGatewayGroup.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_group") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.EntityAsyncStatus != nil { + if err := m.EntityAsyncStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateEntityAsyncStatusIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EntityAsyncStatusIn); i++ { + + if err := m.EntityAsyncStatusIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateEntityAsyncStatusNot(ctx context.Context, formats strfmt.Registry) error { + + if m.EntityAsyncStatusNot != nil { + if err := m.EntityAsyncStatusNot.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateEntityAsyncStatusNotIn(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EntityAsyncStatusNotIn); i++ { + + if err := m.EntityAsyncStatusNotIn[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entityAsyncStatus_not_in" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateFloatingIpsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.FloatingIpsEvery != nil { + if err := m.FloatingIpsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateFloatingIpsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.FloatingIpsNone != nil { + if err := m.FloatingIpsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateFloatingIpsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.FloatingIpsSome != nil { + if err := m.FloatingIpsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("floating_ips_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("floating_ips_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateNatGatewaysEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.NatGatewaysEvery != nil { + if err := m.NatGatewaysEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateNatGatewaysNone(ctx context.Context, formats strfmt.Registry) error { + + if m.NatGatewaysNone != nil { + if err := m.NatGatewaysNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateNatGatewaysSome(ctx context.Context, formats strfmt.Registry) error { + + if m.NatGatewaysSome != nil { + if err := m.NatGatewaysSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nat_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateRouterGatewaysEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.RouterGatewaysEvery != nil { + if err := m.RouterGatewaysEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateRouterGatewaysNone(ctx context.Context, formats strfmt.Registry) error { + + if m.RouterGatewaysNone != nil { + if err := m.RouterGatewaysNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateRouterGatewaysSome(ctx context.Context, formats strfmt.Registry) error { + + if m.RouterGatewaysSome != nil { + if err := m.RouterGatewaysSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("router_gateways_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("router_gateways_some") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { + + if m.Vpc != nil { + if err := m.Vpc.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualPrivateCloudExternalSubnetGroupWhereInput) UnmarshalBinary(b []byte) error { + var res VirtualPrivateCloudExternalSubnetGroupWhereInput + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/virtual_private_cloud_external_subnet_order_by_input.go b/models/virtual_private_cloud_external_subnet_order_by_input.go index 2908221f..f7f70367 100644 --- a/models/virtual_private_cloud_external_subnet_order_by_input.go +++ b/models/virtual_private_cloud_external_subnet_order_by_input.go @@ -48,6 +48,12 @@ const ( // VirtualPrivateCloudExternalSubnetOrderByInputEntityAsyncStatusDESC captures enum value "entityAsyncStatus_DESC" VirtualPrivateCloudExternalSubnetOrderByInputEntityAsyncStatusDESC VirtualPrivateCloudExternalSubnetOrderByInput = "entityAsyncStatus_DESC" + // VirtualPrivateCloudExternalSubnetOrderByInputExclusiveASC captures enum value "exclusive_ASC" + VirtualPrivateCloudExternalSubnetOrderByInputExclusiveASC VirtualPrivateCloudExternalSubnetOrderByInput = "exclusive_ASC" + + // VirtualPrivateCloudExternalSubnetOrderByInputExclusiveDESC captures enum value "exclusive_DESC" + VirtualPrivateCloudExternalSubnetOrderByInputExclusiveDESC VirtualPrivateCloudExternalSubnetOrderByInput = "exclusive_DESC" + // VirtualPrivateCloudExternalSubnetOrderByInputFloatingIPCidrASC captures enum value "floating_ip_cidr_ASC" VirtualPrivateCloudExternalSubnetOrderByInputFloatingIPCidrASC VirtualPrivateCloudExternalSubnetOrderByInput = "floating_ip_cidr_ASC" @@ -96,7 +102,7 @@ var virtualPrivateCloudExternalSubnetOrderByInputEnum []interface{} func init() { var res []VirtualPrivateCloudExternalSubnetOrderByInput - if err := json.Unmarshal([]byte(`["cidr_ASC","cidr_DESC","description_ASC","description_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","floating_ip_cidr_ASC","floating_ip_cidr_DESC","gateway_ASC","gateway_DESC","id_ASC","id_DESC","local_id_ASC","local_id_DESC","name_ASC","name_DESC","nat_gateway_cidr_ASC","nat_gateway_cidr_DESC","router_gateway_cidr_ASC","router_gateway_cidr_DESC"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["cidr_ASC","cidr_DESC","description_ASC","description_DESC","entityAsyncStatus_ASC","entityAsyncStatus_DESC","exclusive_ASC","exclusive_DESC","floating_ip_cidr_ASC","floating_ip_cidr_DESC","gateway_ASC","gateway_DESC","id_ASC","id_DESC","local_id_ASC","local_id_DESC","name_ASC","name_DESC","nat_gateway_cidr_ASC","nat_gateway_cidr_DESC","router_gateway_cidr_ASC","router_gateway_cidr_DESC"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/models/virtual_private_cloud_external_subnet_where_input.go b/models/virtual_private_cloud_external_subnet_where_input.go index 405be6e5..703eefd9 100644 --- a/models/virtual_private_cloud_external_subnet_where_input.go +++ b/models/virtual_private_cloud_external_subnet_where_input.go @@ -112,6 +112,9 @@ type VirtualPrivateCloudExternalSubnetWhereInput struct { // description starts with DescriptionStartsWith *string `json:"description_starts_with,omitempty"` + // edge gateway + EdgeGateway *VirtualPrivateCloudEdgeGatewayWhereInput `json:"edge_gateway,omitempty"` + // entity async status EntityAsyncStatus *EntityAsyncStatus `json:"entityAsyncStatus,omitempty"` @@ -124,6 +127,12 @@ type VirtualPrivateCloudExternalSubnetWhereInput struct { // entity async status not in EntityAsyncStatusNotIn []EntityAsyncStatus `json:"entityAsyncStatus_not_in,omitempty"` + // exclusive + Exclusive *bool `json:"exclusive,omitempty"` + + // exclusive not + ExclusiveNot *bool `json:"exclusive_not,omitempty"` + // floating ip cidr FloatingIPCidr *string `json:"floating_ip_cidr,omitempty"` @@ -468,6 +477,10 @@ func (m *VirtualPrivateCloudExternalSubnetWhereInput) Validate(formats strfmt.Re res = append(res, err) } + if err := m.validateEdgeGateway(formats); err != nil { + res = append(res, err) + } + if err := m.validateEntityAsyncStatus(formats); err != nil { res = append(res, err) } @@ -612,6 +625,25 @@ func (m *VirtualPrivateCloudExternalSubnetWhereInput) validateOR(formats strfmt. return nil } +func (m *VirtualPrivateCloudExternalSubnetWhereInput) validateEdgeGateway(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGateway) { // not required + return nil + } + + if m.EdgeGateway != nil { + if err := m.EdgeGateway.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudExternalSubnetWhereInput) validateEntityAsyncStatus(formats strfmt.Registry) error { if swag.IsZero(m.EntityAsyncStatus) { // not required return nil @@ -917,6 +949,10 @@ func (m *VirtualPrivateCloudExternalSubnetWhereInput) ContextValidate(ctx contex res = append(res, err) } + if err := m.contextValidateEdgeGateway(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEntityAsyncStatus(ctx, formats); err != nil { res = append(res, err) } @@ -1043,6 +1079,22 @@ func (m *VirtualPrivateCloudExternalSubnetWhereInput) contextValidateOR(ctx cont return nil } +func (m *VirtualPrivateCloudExternalSubnetWhereInput) contextValidateEdgeGateway(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGateway != nil { + if err := m.EdgeGateway.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudExternalSubnetWhereInput) contextValidateEntityAsyncStatus(ctx context.Context, formats strfmt.Registry) error { if m.EntityAsyncStatus != nil { diff --git a/models/virtual_private_cloud_floating_ip.go b/models/virtual_private_cloud_floating_ip.go index 350738b6..576ec613 100644 --- a/models/virtual_private_cloud_floating_ip.go +++ b/models/virtual_private_cloud_floating_ip.go @@ -26,8 +26,7 @@ type VirtualPrivateCloudFloatingIP struct { ExternalIP *string `json:"external_ip,omitempty"` // external subnet - // Required: true - ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet"` + ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet,omitempty"` // id // Required: true @@ -92,9 +91,8 @@ func (m *VirtualPrivateCloudFloatingIP) validateEntityAsyncStatus(formats strfmt } func (m *VirtualPrivateCloudFloatingIP) validateExternalSubnet(formats strfmt.Registry) error { - - if err := validate.Required("external_subnet", "body", m.ExternalSubnet); err != nil { - return err + if swag.IsZero(m.ExternalSubnet) { // not required + return nil } if m.ExternalSubnet != nil { diff --git a/models/virtual_private_cloud_nat_gateway.go b/models/virtual_private_cloud_nat_gateway.go index 2ebc8b53..5894c1ff 100644 --- a/models/virtual_private_cloud_nat_gateway.go +++ b/models/virtual_private_cloud_nat_gateway.go @@ -36,8 +36,7 @@ type VirtualPrivateCloudNatGateway struct { ExternalIP *string `json:"external_ip,omitempty"` // external subnet - // Required: true - ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet"` + ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet,omitempty"` // id // Required: true @@ -140,9 +139,8 @@ func (m *VirtualPrivateCloudNatGateway) validateEntityAsyncStatus(formats strfmt } func (m *VirtualPrivateCloudNatGateway) validateExternalSubnet(formats strfmt.Registry) error { - - if err := validate.Required("external_subnet", "body", m.ExternalSubnet); err != nil { - return err + if swag.IsZero(m.ExternalSubnet) { // not required + return nil } if m.ExternalSubnet != nil { diff --git a/models/virtual_private_cloud_router_gateway.go b/models/virtual_private_cloud_router_gateway.go index d0a86937..0a45d0d0 100644 --- a/models/virtual_private_cloud_router_gateway.go +++ b/models/virtual_private_cloud_router_gateway.go @@ -30,8 +30,7 @@ type VirtualPrivateCloudRouterGateway struct { ExternalIP *string `json:"external_ip,omitempty"` // external subnet - // Required: true - ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet"` + ExternalSubnet *NestedVirtualPrivateCloudExternalSubnet `json:"external_subnet,omitempty"` // id // Required: true @@ -145,9 +144,8 @@ func (m *VirtualPrivateCloudRouterGateway) validateEntityAsyncStatus(formats str } func (m *VirtualPrivateCloudRouterGateway) validateExternalSubnet(formats strfmt.Registry) error { - - if err := validate.Required("external_subnet", "body", m.ExternalSubnet); err != nil { - return err + if swag.IsZero(m.ExternalSubnet) { // not required + return nil } if m.ExternalSubnet != nil { diff --git a/models/virtual_private_cloud_service_where_input.go b/models/virtual_private_cloud_service_where_input.go index 2c737421..624afbdf 100644 --- a/models/virtual_private_cloud_service_where_input.go +++ b/models/virtual_private_cloud_service_where_input.go @@ -37,6 +37,15 @@ type VirtualPrivateCloudServiceWhereInput struct { // cluster bindings some ClusterBindingsSome *VirtualPrivateCloudClusterBindingWhereInput `json:"cluster_bindings_some,omitempty"` + // edge gateway groups every + EdgeGatewayGroupsEvery *VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"edge_gateway_groups_every,omitempty"` + + // edge gateway groups none + EdgeGatewayGroupsNone *VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"edge_gateway_groups_none,omitempty"` + + // edge gateway groups some + EdgeGatewayGroupsSome *VirtualPrivateCloudEdgeGatewayGroupWhereInput `json:"edge_gateway_groups_some,omitempty"` + // edge gateways every EdgeGatewaysEvery *VirtualPrivateCloudEdgeGatewayWhereInput `json:"edge_gateways_every,omitempty"` @@ -204,6 +213,18 @@ func (m *VirtualPrivateCloudServiceWhereInput) Validate(formats strfmt.Registry) res = append(res, err) } + if err := m.validateEdgeGatewayGroupsEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewayGroupsNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdgeGatewayGroupsSome(formats); err != nil { + res = append(res, err) + } + if err := m.validateEdgeGatewaysEvery(formats); err != nil { res = append(res, err) } @@ -417,6 +438,63 @@ func (m *VirtualPrivateCloudServiceWhereInput) validateClusterBindingsSome(forma return nil } +func (m *VirtualPrivateCloudServiceWhereInput) validateEdgeGatewayGroupsEvery(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewayGroupsEvery) { // not required + return nil + } + + if m.EdgeGatewayGroupsEvery != nil { + if err := m.EdgeGatewayGroupsEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudServiceWhereInput) validateEdgeGatewayGroupsNone(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewayGroupsNone) { // not required + return nil + } + + if m.EdgeGatewayGroupsNone != nil { + if err := m.EdgeGatewayGroupsNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudServiceWhereInput) validateEdgeGatewayGroupsSome(formats strfmt.Registry) error { + if swag.IsZero(m.EdgeGatewayGroupsSome) { // not required + return nil + } + + if m.EdgeGatewayGroupsSome != nil { + if err := m.EdgeGatewayGroupsSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_some") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudServiceWhereInput) validateEdgeGatewaysEvery(formats strfmt.Registry) error { if swag.IsZero(m.EdgeGatewaysEvery) { // not required return nil @@ -795,6 +873,18 @@ func (m *VirtualPrivateCloudServiceWhereInput) ContextValidate(ctx context.Conte res = append(res, err) } + if err := m.contextValidateEdgeGatewayGroupsEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewayGroupsNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEdgeGatewayGroupsSome(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEdgeGatewaysEvery(ctx, formats); err != nil { res = append(res, err) } @@ -981,6 +1071,54 @@ func (m *VirtualPrivateCloudServiceWhereInput) contextValidateClusterBindingsSom return nil } +func (m *VirtualPrivateCloudServiceWhereInput) contextValidateEdgeGatewayGroupsEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewayGroupsEvery != nil { + if err := m.EdgeGatewayGroupsEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_every") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudServiceWhereInput) contextValidateEdgeGatewayGroupsNone(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewayGroupsNone != nil { + if err := m.EdgeGatewayGroupsNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_none") + } + return err + } + } + + return nil +} + +func (m *VirtualPrivateCloudServiceWhereInput) contextValidateEdgeGatewayGroupsSome(ctx context.Context, formats strfmt.Registry) error { + + if m.EdgeGatewayGroupsSome != nil { + if err := m.EdgeGatewayGroupsSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("edge_gateway_groups_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("edge_gateway_groups_some") + } + return err + } + } + + return nil +} + func (m *VirtualPrivateCloudServiceWhereInput) contextValidateEdgeGatewaysEvery(ctx context.Context, formats strfmt.Registry) error { if m.EdgeGatewaysEvery != nil { diff --git a/models/virtual_private_cloud_where_input.go b/models/virtual_private_cloud_where_input.go index 4945a3b5..ffd8e24a 100644 --- a/models/virtual_private_cloud_where_input.go +++ b/models/virtual_private_cloud_where_input.go @@ -300,6 +300,9 @@ type VirtualPrivateCloudWhereInput struct { // subnets some SubnetsSome *VirtualPrivateCloudSubnetWhereInput `json:"subnets_some,omitempty"` + + // vpc service + VpcService *VirtualPrivateCloudServiceWhereInput `json:"vpc_service,omitempty"` } // Validate validates this virtual private cloud where input @@ -394,6 +397,10 @@ func (m *VirtualPrivateCloudWhereInput) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateVpcService(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -843,6 +850,25 @@ func (m *VirtualPrivateCloudWhereInput) validateSubnetsSome(formats strfmt.Regis return nil } +func (m *VirtualPrivateCloudWhereInput) validateVpcService(formats strfmt.Registry) error { + if swag.IsZero(m.VpcService) { // not required + return nil + } + + if m.VpcService != nil { + if err := m.VpcService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // ContextValidate validate this virtual private cloud where input based on the context it is used func (m *VirtualPrivateCloudWhereInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -935,6 +961,10 @@ func (m *VirtualPrivateCloudWhereInput) ContextValidate(ctx context.Context, for res = append(res, err) } + if err := m.contextValidateVpcService(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -1309,6 +1339,22 @@ func (m *VirtualPrivateCloudWhereInput) contextValidateSubnetsSome(ctx context.C return nil } +func (m *VirtualPrivateCloudWhereInput) contextValidateVpcService(ctx context.Context, formats strfmt.Registry) error { + + if m.VpcService != nil { + if err := m.VpcService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc_service") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VirtualPrivateCloudWhereInput) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/models/vm.go b/models/vm.go index b85f4165..51fe2ad2 100644 --- a/models/vm.go +++ b/models/vm.go @@ -20,6 +20,9 @@ import ( // swagger:model Vm type VM struct { + // backup plans + BackupPlans []*NestedBackupPlan `json:"backup_plans,omitempty"` + // bios uuid BiosUUID *string `json:"bios_uuid,omitempty"` @@ -241,6 +244,10 @@ type VM struct { func (m *VM) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBackupPlans(formats); err != nil { + res = append(res, err) + } + if err := m.validateClockOffset(formats); err != nil { res = append(res, err) } @@ -415,6 +422,32 @@ func (m *VM) Validate(formats strfmt.Registry) error { return nil } +func (m *VM) validateBackupPlans(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlans) { // not required + return nil + } + + for i := 0; i < len(m.BackupPlans); i++ { + if swag.IsZero(m.BackupPlans[i]) { // not required + continue + } + + if m.BackupPlans[i] != nil { + if err := m.BackupPlans[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *VM) validateClockOffset(formats strfmt.Registry) error { if err := validate.Required("clock_offset", "body", m.ClockOffset); err != nil { @@ -1141,6 +1174,10 @@ func (m *VM) validateWinOpt(formats strfmt.Registry) error { func (m *VM) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBackupPlans(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateClockOffset(ctx, formats); err != nil { res = append(res, err) } @@ -1251,6 +1288,26 @@ func (m *VM) ContextValidate(ctx context.Context, formats strfmt.Registry) error return nil } +func (m *VM) contextValidateBackupPlans(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BackupPlans); i++ { + + if m.BackupPlans[i] != nil { + if err := m.BackupPlans[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *VM) contextValidateClockOffset(ctx context.Context, formats strfmt.Registry) error { if m.ClockOffset != nil { diff --git a/models/vm_disk_meta_data.go b/models/vm_disk_meta_data.go new file mode 100644 index 00000000..8fa2f342 --- /dev/null +++ b/models/vm_disk_meta_data.go @@ -0,0 +1,318 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VMDiskMetaData Vm disk meta data +// +// swagger:model VmDiskMetaData +type VMDiskMetaData struct { + + // boot + Boot *int32 `json:"boot,omitempty"` + + // bus + Bus *Bus `json:"bus,omitempty"` + + // disabled + Disabled *bool `json:"disabled,omitempty"` + + // max bandwidth + MaxBandwidth *float64 `json:"max_bandwidth,omitempty"` + + // max bandwidth policy + MaxBandwidthPolicy *VMDiskIoRestrictType `json:"max_bandwidth_policy,omitempty"` + + // max iops + MaxIops *int32 `json:"max_iops,omitempty"` + + // max iops policy + MaxIopsPolicy *VMDiskIoRestrictType `json:"max_iops_policy,omitempty"` + + // type + Type *VMDiskType `json:"type,omitempty"` + + // vm volume elf storage policy + VMVolumeElfStoragePolicy *VMVolumeElfStoragePolicyType `json:"vm_volume_elf_storage_policy,omitempty"` + + // vm volume lun zbs volume id + VMVolumeLunZbsVolumeID *string `json:"vm_volume_lun_zbs_volume_id,omitempty"` + + // vm volume mounting + VMVolumeMounting *bool `json:"vm_volume_mounting,omitempty"` + + // vm volume name + VMVolumeName *string `json:"vm_volume_name,omitempty"` + + // vm volume path + VMVolumePath *string `json:"vm_volume_path,omitempty"` + + // vm volume sharing + VMVolumeSharing *bool `json:"vm_volume_sharing,omitempty"` + + // vm volume size + VMVolumeSize *float64 `json:"vm_volume_size,omitempty"` +} + +// Validate validates this Vm disk meta data +func (m *VMDiskMetaData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVMVolumeElfStoragePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMDiskMetaData) validateBus(formats strfmt.Registry) error { + if swag.IsZero(m.Bus) { // not required + return nil + } + + if m.Bus != nil { + if err := m.Bus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bus") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) validateMaxBandwidthPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicy) { // not required + return nil + } + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) validateMaxIopsPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicy) { // not required + return nil + } + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) validateVMVolumeElfStoragePolicy(formats strfmt.Registry) error { + if swag.IsZero(m.VMVolumeElfStoragePolicy) { // not required + return nil + } + + if m.VMVolumeElfStoragePolicy != nil { + if err := m.VMVolumeElfStoragePolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_volume_elf_storage_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_volume_elf_storage_policy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this Vm disk meta data based on the context it is used +func (m *VMDiskMetaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxBandwidthPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxIopsPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMVolumeElfStoragePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMDiskMetaData) contextValidateBus(ctx context.Context, formats strfmt.Registry) error { + + if m.Bus != nil { + if err := m.Bus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bus") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) contextValidateMaxBandwidthPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) contextValidateMaxIopsPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *VMDiskMetaData) contextValidateVMVolumeElfStoragePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.VMVolumeElfStoragePolicy != nil { + if err := m.VMVolumeElfStoragePolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_volume_elf_storage_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_volume_elf_storage_policy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VMDiskMetaData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMDiskMetaData) UnmarshalBinary(b []byte) error { + var res VMDiskMetaData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/vm_ha_priority.go b/models/vm_ha_priority.go new file mode 100644 index 00000000..6f2a4558 --- /dev/null +++ b/models/vm_ha_priority.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// VMHaPriority Vm ha priority +// +// swagger:model VmHaPriority +type VMHaPriority string + +func NewVMHaPriority(value VMHaPriority) *VMHaPriority { + return &value +} + +// Pointer returns a pointer to a freshly-allocated VMHaPriority. +func (m VMHaPriority) Pointer() *VMHaPriority { + return &m +} + +const ( + + // VMHaPriorityLEVEL1LOW captures enum value "LEVEL_1_LOW" + VMHaPriorityLEVEL1LOW VMHaPriority = "LEVEL_1_LOW" + + // VMHaPriorityLEVEL2MEDIUM captures enum value "LEVEL_2_MEDIUM" + VMHaPriorityLEVEL2MEDIUM VMHaPriority = "LEVEL_2_MEDIUM" + + // VMHaPriorityLEVEL3HIGH captures enum value "LEVEL_3_HIGH" + VMHaPriorityLEVEL3HIGH VMHaPriority = "LEVEL_3_HIGH" +) + +// for schema +var vmHaPriorityEnum []interface{} + +func init() { + var res []VMHaPriority + if err := json.Unmarshal([]byte(`["LEVEL_1_LOW","LEVEL_2_MEDIUM","LEVEL_3_HIGH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + vmHaPriorityEnum = append(vmHaPriorityEnum, v) + } +} + +func (m VMHaPriority) validateVMHaPriorityEnum(path, location string, value VMHaPriority) error { + if err := validate.EnumCase(path, location, value, vmHaPriorityEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this Vm ha priority +func (m VMHaPriority) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateVMHaPriorityEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this Vm ha priority based on context it is used +func (m VMHaPriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/models/vm_meta_data.go b/models/vm_meta_data.go new file mode 100644 index 00000000..7f38a104 --- /dev/null +++ b/models/vm_meta_data.go @@ -0,0 +1,745 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VMMetaData Vm meta data +// +// swagger:model VmMetaData +type VMMetaData struct { + + // boot with host + BootWithHost *bool `json:"boot_with_host,omitempty"` + + // clock offset + ClockOffset *VMClockOffset `json:"clock_offset,omitempty"` + + // cluster architecture + ClusterArchitecture *Architecture `json:"cluster_architecture,omitempty"` + + // cluster local id + ClusterLocalID *string `json:"cluster_local_id,omitempty"` + + // cluster type + ClusterType *ClusterType `json:"cluster_type,omitempty"` + + // cluster version + ClusterVersion *string `json:"cluster_version,omitempty"` + + // cluster vhost enabled + ClusterVhostEnabled *bool `json:"cluster_vhost_enabled,omitempty"` + + // cpu cores + CPUCores *int32 `json:"cpu_cores,omitempty"` + + // cpu exclusive expected enabled + CPUExclusiveExpectedEnabled *bool `json:"cpu_exclusive_expected_enabled,omitempty"` + + // cpu model + CPUModel *string `json:"cpu_model,omitempty"` + + // cpu sockets + CPUSockets *int32 `json:"cpu_sockets,omitempty"` + + // description + Description *string `json:"description,omitempty"` + + // firmware + Firmware *VMFirmware `json:"firmware,omitempty"` + + // guest os type + GuestOsType *VMGuestsOperationSystem `json:"guest_os_type,omitempty"` + + // ha + Ha *bool `json:"ha,omitempty"` + + // ha priority + HaPriority *VMHaPriority `json:"ha_priority,omitempty"` + + // host local id + HostLocalID *string `json:"host_local_id,omitempty"` + + // internal + Internal *bool `json:"internal,omitempty"` + + // io policy + IoPolicy *VMDiskIoPolicy `json:"io_policy,omitempty"` + + // local id + LocalID *string `json:"local_id,omitempty"` + + // max bandwidth + MaxBandwidth *float64 `json:"max_bandwidth,omitempty"` + + // max bandwidth policy + MaxBandwidthPolicy *VMDiskIoRestrictType `json:"max_bandwidth_policy,omitempty"` + + // max iops + MaxIops *int32 `json:"max_iops,omitempty"` + + // max iops policy + MaxIopsPolicy *VMDiskIoRestrictType `json:"max_iops_policy,omitempty"` + + // memory + Memory *float64 `json:"memory,omitempty"` + + // name + Name *string `json:"name,omitempty"` + + // nested virtualization + NestedVirtualization *bool `json:"nested_virtualization,omitempty"` + + // protected + Protected *bool `json:"protected,omitempty"` + + // sync vm time on resume + SyncVMTimeOnResume *bool `json:"sync_vm_time_on_resume,omitempty"` + + // vcpu + Vcpu *int32 `json:"vcpu,omitempty"` + + // video type + VideoType *VMVideoType `json:"video_type,omitempty"` + + // vm disks + VMDisks []*VMDiskMetaData `json:"vm_disks,omitempty"` + + // vm nics + VMNics []*VMNicMetaData `json:"vm_nics,omitempty"` + + // vm tools status + VMToolsStatus *VMToolsStatus `json:"vm_tools_status,omitempty"` + + // win opt + WinOpt *bool `json:"win_opt,omitempty"` +} + +// Validate validates this Vm meta data +func (m *VMMetaData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClockOffset(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirmware(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGuestOsType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHaPriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIoPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxBandwidthPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxIopsPolicy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVideoType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVMDisks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVMNics(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVMToolsStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMMetaData) validateClockOffset(formats strfmt.Registry) error { + if swag.IsZero(m.ClockOffset) { // not required + return nil + } + + if m.ClockOffset != nil { + if err := m.ClockOffset.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateClusterArchitecture(formats strfmt.Registry) error { + if swag.IsZero(m.ClusterArchitecture) { // not required + return nil + } + + if m.ClusterArchitecture != nil { + if err := m.ClusterArchitecture.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster_architecture") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster_architecture") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateClusterType(formats strfmt.Registry) error { + if swag.IsZero(m.ClusterType) { // not required + return nil + } + + if m.ClusterType != nil { + if err := m.ClusterType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateFirmware(formats strfmt.Registry) error { + if swag.IsZero(m.Firmware) { // not required + return nil + } + + if m.Firmware != nil { + if err := m.Firmware.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateGuestOsType(formats strfmt.Registry) error { + if swag.IsZero(m.GuestOsType) { // not required + return nil + } + + if m.GuestOsType != nil { + if err := m.GuestOsType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("guest_os_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("guest_os_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateHaPriority(formats strfmt.Registry) error { + if swag.IsZero(m.HaPriority) { // not required + return nil + } + + if m.HaPriority != nil { + if err := m.HaPriority.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ha_priority") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ha_priority") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateIoPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.IoPolicy) { // not required + return nil + } + + if m.IoPolicy != nil { + if err := m.IoPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateMaxBandwidthPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxBandwidthPolicy) { // not required + return nil + } + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateMaxIopsPolicy(formats strfmt.Registry) error { + if swag.IsZero(m.MaxIopsPolicy) { // not required + return nil + } + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateVideoType(formats strfmt.Registry) error { + if swag.IsZero(m.VideoType) { // not required + return nil + } + + if m.VideoType != nil { + if err := m.VideoType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("video_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("video_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) validateVMDisks(formats strfmt.Registry) error { + if swag.IsZero(m.VMDisks) { // not required + return nil + } + + for i := 0; i < len(m.VMDisks); i++ { + if swag.IsZero(m.VMDisks[i]) { // not required + continue + } + + if m.VMDisks[i] != nil { + if err := m.VMDisks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMMetaData) validateVMNics(formats strfmt.Registry) error { + if swag.IsZero(m.VMNics) { // not required + return nil + } + + for i := 0; i < len(m.VMNics); i++ { + if swag.IsZero(m.VMNics[i]) { // not required + continue + } + + if m.VMNics[i] != nil { + if err := m.VMNics[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMMetaData) validateVMToolsStatus(formats strfmt.Registry) error { + if swag.IsZero(m.VMToolsStatus) { // not required + return nil + } + + if m.VMToolsStatus != nil { + if err := m.VMToolsStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_tools_status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_tools_status") + } + return err + } + } + + return nil +} + +// ContextValidate validate this Vm meta data based on the context it is used +func (m *VMMetaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClockOffset(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClusterArchitecture(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateClusterType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirmware(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGuestOsType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHaPriority(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIoPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxBandwidthPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxIopsPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVideoType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMDisks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMNics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVMToolsStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMMetaData) contextValidateClockOffset(ctx context.Context, formats strfmt.Registry) error { + + if m.ClockOffset != nil { + if err := m.ClockOffset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clock_offset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clock_offset") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateClusterArchitecture(ctx context.Context, formats strfmt.Registry) error { + + if m.ClusterArchitecture != nil { + if err := m.ClusterArchitecture.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster_architecture") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster_architecture") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateClusterType(ctx context.Context, formats strfmt.Registry) error { + + if m.ClusterType != nil { + if err := m.ClusterType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateFirmware(ctx context.Context, formats strfmt.Registry) error { + + if m.Firmware != nil { + if err := m.Firmware.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("firmware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("firmware") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateGuestOsType(ctx context.Context, formats strfmt.Registry) error { + + if m.GuestOsType != nil { + if err := m.GuestOsType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("guest_os_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("guest_os_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateHaPriority(ctx context.Context, formats strfmt.Registry) error { + + if m.HaPriority != nil { + if err := m.HaPriority.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ha_priority") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ha_priority") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateIoPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.IoPolicy != nil { + if err := m.IoPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("io_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("io_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateMaxBandwidthPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxBandwidthPolicy != nil { + if err := m.MaxBandwidthPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_bandwidth_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_bandwidth_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateMaxIopsPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxIopsPolicy != nil { + if err := m.MaxIopsPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("max_iops_policy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("max_iops_policy") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateVideoType(ctx context.Context, formats strfmt.Registry) error { + + if m.VideoType != nil { + if err := m.VideoType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("video_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("video_type") + } + return err + } + } + + return nil +} + +func (m *VMMetaData) contextValidateVMDisks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VMDisks); i++ { + + if m.VMDisks[i] != nil { + if err := m.VMDisks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_disks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMMetaData) contextValidateVMNics(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VMNics); i++ { + + if m.VMNics[i] != nil { + if err := m.VMNics[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_nics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMMetaData) contextValidateVMToolsStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.VMToolsStatus != nil { + if err := m.VMToolsStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vm_tools_status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vm_tools_status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VMMetaData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMMetaData) UnmarshalBinary(b []byte) error { + var res VMMetaData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/vm_nic_meta_data.go b/models/vm_nic_meta_data.go new file mode 100644 index 00000000..39768325 --- /dev/null +++ b/models/vm_nic_meta_data.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VMNicMetaData Vm nic meta data +// +// swagger:model VmNicMetaData +type VMNicMetaData struct { + + // egress rate limit burst in bit + EgressRateLimitBurstInBit *float64 `json:"egress_rate_limit_burst_in_bit,omitempty"` + + // egress rate limit enabled + EgressRateLimitEnabled *bool `json:"egress_rate_limit_enabled,omitempty"` + + // egress rate limit max rate in bitps + EgressRateLimitMaxRateInBitps *float64 `json:"egress_rate_limit_max_rate_in_bitps,omitempty"` + + // enabled + Enabled *bool `json:"enabled,omitempty"` + + // ingress rate limit burst in bit + IngressRateLimitBurstInBit *float64 `json:"ingress_rate_limit_burst_in_bit,omitempty"` + + // ingress rate limit enabled + IngressRateLimitEnabled *bool `json:"ingress_rate_limit_enabled,omitempty"` + + // ingress rate limit max rate in bitps + IngressRateLimitMaxRateInBitps *float64 `json:"ingress_rate_limit_max_rate_in_bitps,omitempty"` + + // local id + LocalID *string `json:"local_id,omitempty"` + + // mac address + MacAddress *string `json:"mac_address,omitempty"` + + // mirror + Mirror *bool `json:"mirror,omitempty"` + + // model + Model *string `json:"model,omitempty"` + + // vlan local id + VlanLocalID *string `json:"vlan_local_id,omitempty"` + + // vlan mode type + VlanModeType *VlanModeType `json:"vlan_mode_type,omitempty"` + + // vlan name + VlanName *string `json:"vlan_name,omitempty"` +} + +// Validate validates this Vm nic meta data +func (m *VMNicMetaData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVlanModeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMNicMetaData) validateVlanModeType(formats strfmt.Registry) error { + if swag.IsZero(m.VlanModeType) { // not required + return nil + } + + if m.VlanModeType != nil { + if err := m.VlanModeType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan_mode_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan_mode_type") + } + return err + } + } + + return nil +} + +// ContextValidate validate this Vm nic meta data based on the context it is used +func (m *VMNicMetaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVlanModeType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMNicMetaData) contextValidateVlanModeType(ctx context.Context, formats strfmt.Registry) error { + + if m.VlanModeType != nil { + if err := m.VlanModeType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan_mode_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan_mode_type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VMNicMetaData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMNicMetaData) UnmarshalBinary(b []byte) error { + var res VMNicMetaData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/vm_where_input.go b/models/vm_where_input.go index 57357aa2..d9301991 100644 --- a/models/vm_where_input.go +++ b/models/vm_where_input.go @@ -28,6 +28,15 @@ type VMWhereInput struct { // o r OR []*VMWhereInput `json:"OR,omitempty"` + // backup plans every + BackupPlansEvery *BackupPlanWhereInput `json:"backup_plans_every,omitempty"` + + // backup plans none + BackupPlansNone *BackupPlanWhereInput `json:"backup_plans_none,omitempty"` + + // backup plans some + BackupPlansSome *BackupPlanWhereInput `json:"backup_plans_some,omitempty"` + // bios uuid BiosUUID *string `json:"bios_uuid,omitempty"` @@ -1329,6 +1338,18 @@ func (m *VMWhereInput) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateBackupPlansEvery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlansNone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupPlansSome(formats); err != nil { + res = append(res, err) + } + if err := m.validateClockOffset(formats); err != nil { res = append(res, err) } @@ -1717,6 +1738,63 @@ func (m *VMWhereInput) validateOR(formats strfmt.Registry) error { return nil } +func (m *VMWhereInput) validateBackupPlansEvery(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlansEvery) { // not required + return nil + } + + if m.BackupPlansEvery != nil { + if err := m.BackupPlansEvery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_every") + } + return err + } + } + + return nil +} + +func (m *VMWhereInput) validateBackupPlansNone(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlansNone) { // not required + return nil + } + + if m.BackupPlansNone != nil { + if err := m.BackupPlansNone.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_none") + } + return err + } + } + + return nil +} + +func (m *VMWhereInput) validateBackupPlansSome(formats strfmt.Registry) error { + if swag.IsZero(m.BackupPlansSome) { // not required + return nil + } + + if m.BackupPlansSome != nil { + if err := m.BackupPlansSome.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_some") + } + return err + } + } + + return nil +} + func (m *VMWhereInput) validateClockOffset(formats strfmt.Registry) error { if swag.IsZero(m.ClockOffset) { // not required return nil @@ -3221,6 +3299,18 @@ func (m *VMWhereInput) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateBackupPlansEvery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlansNone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupPlansSome(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateClockOffset(ctx, formats); err != nil { res = append(res, err) } @@ -3591,6 +3681,54 @@ func (m *VMWhereInput) contextValidateOR(ctx context.Context, formats strfmt.Reg return nil } +func (m *VMWhereInput) contextValidateBackupPlansEvery(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlansEvery != nil { + if err := m.BackupPlansEvery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_every") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_every") + } + return err + } + } + + return nil +} + +func (m *VMWhereInput) contextValidateBackupPlansNone(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlansNone != nil { + if err := m.BackupPlansNone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_none") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_none") + } + return err + } + } + + return nil +} + +func (m *VMWhereInput) contextValidateBackupPlansSome(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupPlansSome != nil { + if err := m.BackupPlansSome.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_plans_some") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_plans_some") + } + return err + } + } + + return nil +} + func (m *VMWhereInput) contextValidateClockOffset(ctx context.Context, formats strfmt.Registry) error { if m.ClockOffset != nil {