diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_parameters.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_parameters.go new file mode 100644 index 00000000..b8b1acd7 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_parameters.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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" +) + +// NewGetReplicationStatusParams creates a new GetReplicationStatusParams object +// with the default values initialized. +func NewGetReplicationStatusParams() *GetReplicationStatusParams { + var () + return &GetReplicationStatusParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetReplicationStatusParamsWithTimeout creates a new GetReplicationStatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetReplicationStatusParamsWithTimeout(timeout time.Duration) *GetReplicationStatusParams { + var () + return &GetReplicationStatusParams{ + + timeout: timeout, + } +} + +// NewGetReplicationStatusParamsWithContext creates a new GetReplicationStatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetReplicationStatusParamsWithContext(ctx context.Context) *GetReplicationStatusParams { + var () + return &GetReplicationStatusParams{ + + Context: ctx, + } +} + +// NewGetReplicationStatusParamsWithHTTPClient creates a new GetReplicationStatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetReplicationStatusParamsWithHTTPClient(client *http.Client) *GetReplicationStatusParams { + var () + return &GetReplicationStatusParams{ + HTTPClient: client, + } +} + +/*GetReplicationStatusParams contains all the parameters to send to the API endpoint +for the get replication status operation typically these are written to a http.Request +*/ +type GetReplicationStatusParams struct { + + /*ClusterID*/ + ClusterID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get replication status params +func (o *GetReplicationStatusParams) WithTimeout(timeout time.Duration) *GetReplicationStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get replication status params +func (o *GetReplicationStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get replication status params +func (o *GetReplicationStatusParams) WithContext(ctx context.Context) *GetReplicationStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get replication status params +func (o *GetReplicationStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get replication status params +func (o *GetReplicationStatusParams) WithHTTPClient(client *http.Client) *GetReplicationStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get replication status params +func (o *GetReplicationStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get replication status params +func (o *GetReplicationStatusParams) WithClusterID(clusterID string) *GetReplicationStatusParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get replication status params +func (o *GetReplicationStatusParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get replication status params +func (o *GetReplicationStatusParams) WithLocationOrganizationID(locationOrganizationID string) *GetReplicationStatusParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get replication status params +func (o *GetReplicationStatusParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get replication status params +func (o *GetReplicationStatusParams) WithLocationProjectID(locationProjectID string) *GetReplicationStatusParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get replication status params +func (o *GetReplicationStatusParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get replication status params +func (o *GetReplicationStatusParams) WithLocationRegionProvider(locationRegionProvider *string) *GetReplicationStatusParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get replication status params +func (o *GetReplicationStatusParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get replication status params +func (o *GetReplicationStatusParams) WithLocationRegionRegion(locationRegionRegion *string) *GetReplicationStatusParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get replication status params +func (o *GetReplicationStatusParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetReplicationStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_responses.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_responses.go new file mode 100644 index 00000000..f14cc952 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/get_replication_status_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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" + + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/models" +) + +// GetReplicationStatusReader is a Reader for the GetReplicationStatus structure. +type GetReplicationStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetReplicationStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetReplicationStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetReplicationStatusDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetReplicationStatusOK creates a GetReplicationStatusOK with default headers values +func NewGetReplicationStatusOK() *GetReplicationStatusOK { + return &GetReplicationStatusOK{} +} + +/*GetReplicationStatusOK handles this case with default header values. + +A successful response. +*/ +type GetReplicationStatusOK struct { + Payload *models.HashicorpCloudVault20201125GetReplicationStatusResponse +} + +func (o *GetReplicationStatusOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/replication-status][%d] getReplicationStatusOK %+v", 200, o.Payload) +} + +func (o *GetReplicationStatusOK) GetPayload() *models.HashicorpCloudVault20201125GetReplicationStatusResponse { + return o.Payload +} + +func (o *GetReplicationStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetReplicationStatusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetReplicationStatusDefault creates a GetReplicationStatusDefault with default headers values +func NewGetReplicationStatusDefault(code int) *GetReplicationStatusDefault { + return &GetReplicationStatusDefault{ + _statusCode: code, + } +} + +/*GetReplicationStatusDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetReplicationStatusDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get replication status default response +func (o *GetReplicationStatusDefault) Code() int { + return o._statusCode +} + +func (o *GetReplicationStatusDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/replication-status][%d] GetReplicationStatus default %+v", o._statusCode, o.Payload) +} + +func (o *GetReplicationStatusDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetReplicationStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_parameters.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_parameters.go new file mode 100644 index 00000000..19fa7336 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/models" +) + +// NewUpdateMajorVersionUpgradeConfigParams creates a new UpdateMajorVersionUpgradeConfigParams object +// with the default values initialized. +func NewUpdateMajorVersionUpgradeConfigParams() *UpdateMajorVersionUpgradeConfigParams { + var () + return &UpdateMajorVersionUpgradeConfigParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMajorVersionUpgradeConfigParamsWithTimeout creates a new UpdateMajorVersionUpgradeConfigParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateMajorVersionUpgradeConfigParamsWithTimeout(timeout time.Duration) *UpdateMajorVersionUpgradeConfigParams { + var () + return &UpdateMajorVersionUpgradeConfigParams{ + + timeout: timeout, + } +} + +// NewUpdateMajorVersionUpgradeConfigParamsWithContext creates a new UpdateMajorVersionUpgradeConfigParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateMajorVersionUpgradeConfigParamsWithContext(ctx context.Context) *UpdateMajorVersionUpgradeConfigParams { + var () + return &UpdateMajorVersionUpgradeConfigParams{ + + Context: ctx, + } +} + +// NewUpdateMajorVersionUpgradeConfigParamsWithHTTPClient creates a new UpdateMajorVersionUpgradeConfigParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateMajorVersionUpgradeConfigParamsWithHTTPClient(client *http.Client) *UpdateMajorVersionUpgradeConfigParams { + var () + return &UpdateMajorVersionUpgradeConfigParams{ + HTTPClient: client, + } +} + +/*UpdateMajorVersionUpgradeConfigParams contains all the parameters to send to the API endpoint +for the update major version upgrade config operation typically these are written to a http.Request +*/ +type UpdateMajorVersionUpgradeConfigParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest + /*ClusterID*/ + ClusterID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithTimeout(timeout time.Duration) *UpdateMajorVersionUpgradeConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithContext(ctx context.Context) *UpdateMajorVersionUpgradeConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithHTTPClient(client *http.Client) *UpdateMajorVersionUpgradeConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithBody(body *models.HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) *UpdateMajorVersionUpgradeConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetBody(body *models.HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithClusterID(clusterID string) *UpdateMajorVersionUpgradeConfigParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithLocationOrganizationID(locationOrganizationID string) *UpdateMajorVersionUpgradeConfigParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) WithLocationProjectID(locationProjectID string) *UpdateMajorVersionUpgradeConfigParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the update major version upgrade config params +func (o *UpdateMajorVersionUpgradeConfigParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMajorVersionUpgradeConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_responses.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_responses.go new file mode 100644 index 00000000..931da03c --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/update_major_version_upgrade_config_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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" + + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/models" +) + +// UpdateMajorVersionUpgradeConfigReader is a Reader for the UpdateMajorVersionUpgradeConfig structure. +type UpdateMajorVersionUpgradeConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMajorVersionUpgradeConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMajorVersionUpgradeConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateMajorVersionUpgradeConfigDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateMajorVersionUpgradeConfigOK creates a UpdateMajorVersionUpgradeConfigOK with default headers values +func NewUpdateMajorVersionUpgradeConfigOK() *UpdateMajorVersionUpgradeConfigOK { + return &UpdateMajorVersionUpgradeConfigOK{} +} + +/*UpdateMajorVersionUpgradeConfigOK handles this case with default header values. + +A successful response. +*/ +type UpdateMajorVersionUpgradeConfigOK struct { + Payload models.HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigResponse +} + +func (o *UpdateMajorVersionUpgradeConfigOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version-upgrade-config/update][%d] updateMajorVersionUpgradeConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateMajorVersionUpgradeConfigOK) GetPayload() models.HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigResponse { + return o.Payload +} + +func (o *UpdateMajorVersionUpgradeConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMajorVersionUpgradeConfigDefault creates a UpdateMajorVersionUpgradeConfigDefault with default headers values +func NewUpdateMajorVersionUpgradeConfigDefault(code int) *UpdateMajorVersionUpgradeConfigDefault { + return &UpdateMajorVersionUpgradeConfigDefault{ + _statusCode: code, + } +} + +/*UpdateMajorVersionUpgradeConfigDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdateMajorVersionUpgradeConfigDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update major version upgrade config default response +func (o *UpdateMajorVersionUpgradeConfigDefault) Code() int { + return o._statusCode +} + +func (o *UpdateMajorVersionUpgradeConfigDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version-upgrade-config/update][%d] UpdateMajorVersionUpgradeConfig default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateMajorVersionUpgradeConfigDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdateMajorVersionUpgradeConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_parameters.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_parameters.go new file mode 100644 index 00000000..22fa9e37 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/models" +) + +// NewUpgradeMajorVersionParams creates a new UpgradeMajorVersionParams object +// with the default values initialized. +func NewUpgradeMajorVersionParams() *UpgradeMajorVersionParams { + var () + return &UpgradeMajorVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpgradeMajorVersionParamsWithTimeout creates a new UpgradeMajorVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpgradeMajorVersionParamsWithTimeout(timeout time.Duration) *UpgradeMajorVersionParams { + var () + return &UpgradeMajorVersionParams{ + + timeout: timeout, + } +} + +// NewUpgradeMajorVersionParamsWithContext creates a new UpgradeMajorVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpgradeMajorVersionParamsWithContext(ctx context.Context) *UpgradeMajorVersionParams { + var () + return &UpgradeMajorVersionParams{ + + Context: ctx, + } +} + +// NewUpgradeMajorVersionParamsWithHTTPClient creates a new UpgradeMajorVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpgradeMajorVersionParamsWithHTTPClient(client *http.Client) *UpgradeMajorVersionParams { + var () + return &UpgradeMajorVersionParams{ + HTTPClient: client, + } +} + +/*UpgradeMajorVersionParams contains all the parameters to send to the API endpoint +for the upgrade major version operation typically these are written to a http.Request +*/ +type UpgradeMajorVersionParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UpgradeMajorVersionRequest + /*ClusterID*/ + ClusterID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithTimeout(timeout time.Duration) *UpgradeMajorVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithContext(ctx context.Context) *UpgradeMajorVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithHTTPClient(client *http.Client) *UpgradeMajorVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithBody(body *models.HashicorpCloudVault20201125UpgradeMajorVersionRequest) *UpgradeMajorVersionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetBody(body *models.HashicorpCloudVault20201125UpgradeMajorVersionRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithClusterID(clusterID string) *UpgradeMajorVersionParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithLocationOrganizationID(locationOrganizationID string) *UpgradeMajorVersionParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the upgrade major version params +func (o *UpgradeMajorVersionParams) WithLocationProjectID(locationProjectID string) *UpgradeMajorVersionParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the upgrade major version params +func (o *UpgradeMajorVersionParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpgradeMajorVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_responses.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_responses.go new file mode 100644 index 00000000..8be0e395 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/upgrade_major_version_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_service + +// 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" + + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/models" +) + +// UpgradeMajorVersionReader is a Reader for the UpgradeMajorVersion structure. +type UpgradeMajorVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpgradeMajorVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpgradeMajorVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpgradeMajorVersionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpgradeMajorVersionOK creates a UpgradeMajorVersionOK with default headers values +func NewUpgradeMajorVersionOK() *UpgradeMajorVersionOK { + return &UpgradeMajorVersionOK{} +} + +/*UpgradeMajorVersionOK handles this case with default header values. + +A successful response. +*/ +type UpgradeMajorVersionOK struct { + Payload *models.HashicorpCloudVault20201125UpgradeMajorVersionResponse +} + +func (o *UpgradeMajorVersionOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version/upgrade][%d] upgradeMajorVersionOK %+v", 200, o.Payload) +} + +func (o *UpgradeMajorVersionOK) GetPayload() *models.HashicorpCloudVault20201125UpgradeMajorVersionResponse { + return o.Payload +} + +func (o *UpgradeMajorVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125UpgradeMajorVersionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpgradeMajorVersionDefault creates a UpgradeMajorVersionDefault with default headers values +func NewUpgradeMajorVersionDefault(code int) *UpgradeMajorVersionDefault { + return &UpgradeMajorVersionDefault{ + _statusCode: code, + } +} + +/*UpgradeMajorVersionDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpgradeMajorVersionDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the upgrade major version default response +func (o *UpgradeMajorVersionDefault) Code() int { + return o._statusCode +} + +func (o *UpgradeMajorVersionDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version/upgrade][%d] UpgradeMajorVersion default %+v", o._statusCode, o.Payload) +} + +func (o *UpgradeMajorVersionDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpgradeMajorVersionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/vault_service_client.go b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/vault_service_client.go index 38e866a4..41802ba3 100644 --- a/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/vault_service_client.go +++ b/clients/cloud-vault-service/stable/2020-11-25/client/vault_service/vault_service_client.go @@ -49,6 +49,8 @@ type ClientService interface { GetClientCounts(params *GetClientCountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetClientCountsOK, error) + GetReplicationStatus(params *GetReplicationStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetReplicationStatusOK, error) + GetSnapshot(params *GetSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*GetSnapshotOK, error) GetUtilization(params *GetUtilizationParams, authInfo runtime.ClientAuthInfoWriter) (*GetUtilizationOK, error) @@ -69,6 +71,8 @@ type ClientService interface { UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCORSConfigOK, error) + UpdateMajorVersionUpgradeConfig(params *UpdateMajorVersionUpgradeConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateMajorVersionUpgradeConfigOK, error) + UpdatePathsFilter(params *UpdatePathsFilterParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePathsFilterOK, error) UpdatePublicIps(params *UpdatePublicIpsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePublicIpsOK, error) @@ -77,6 +81,8 @@ type ClientService interface { UpdateVersion(params *UpdateVersionParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateVersionOK, error) + UpgradeMajorVersion(params *UpgradeMajorVersionParams, authInfo runtime.ClientAuthInfoWriter) (*UpgradeMajorVersionOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -488,6 +494,40 @@ func (a *Client) GetClientCounts(params *GetClientCountsParams, authInfo runtime return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + GetReplicationStatus get replication status API +*/ +func (a *Client) GetReplicationStatus(params *GetReplicationStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetReplicationStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetReplicationStatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetReplicationStatus", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/replication-status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetReplicationStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetReplicationStatusOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetReplicationStatusDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetSnapshot get snapshot API */ @@ -828,6 +868,40 @@ func (a *Client) UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runti return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + UpdateMajorVersionUpgradeConfig update major version upgrade config API +*/ +func (a *Client) UpdateMajorVersionUpgradeConfig(params *UpdateMajorVersionUpgradeConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateMajorVersionUpgradeConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMajorVersionUpgradeConfigParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateMajorVersionUpgradeConfig", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version-upgrade-config/update", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMajorVersionUpgradeConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMajorVersionUpgradeConfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateMajorVersionUpgradeConfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdatePathsFilter update paths filter API */ @@ -964,6 +1038,40 @@ func (a *Client) UpdateVersion(params *UpdateVersionParams, authInfo runtime.Cli return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + UpgradeMajorVersion upgrade major version API +*/ +func (a *Client) UpgradeMajorVersion(params *UpgradeMajorVersionParams, authInfo runtime.ClientAuthInfoWriter) (*UpgradeMajorVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpgradeMajorVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpgradeMajorVersion", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/major-version/upgrade", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpgradeMajorVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpgradeMajorVersionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpgradeMajorVersionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go index a123721b..d59b3604 100644 --- a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -25,7 +27,7 @@ type HashicorpCloudVault20201125Cluster struct { // Format: date-time CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - // currently_deployed_version is the version of the currrent Vault deployment. + // currently_deployed_version is the version of the current Vault deployment. CurrentVersion string `json:"current_version,omitempty"` // DNSNames holds all of the cluster's DNS names. @@ -37,6 +39,9 @@ type HashicorpCloudVault20201125Cluster struct { // location is the location of the cluster. Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + // notifications is the list of notifications currently valid for the cluster. + Notifications []*HashicorpCloudVault20201125ClusterNotification `json:"notifications"` + // performance_replication_info contains the performance replication information. PerformanceReplicationInfo *HashicorpCloudVault20201125ClusterPerformanceReplicationInfo `json:"performance_replication_info,omitempty"` @@ -67,6 +72,10 @@ func (m *HashicorpCloudVault20201125Cluster) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := m.validateNotifications(formats); err != nil { + res = append(res, err) + } + if err := m.validatePerformanceReplicationInfo(formats); err != nil { res = append(res, err) } @@ -148,6 +157,31 @@ func (m *HashicorpCloudVault20201125Cluster) validateLocation(formats strfmt.Reg return nil } +func (m *HashicorpCloudVault20201125Cluster) validateNotifications(formats strfmt.Registry) error { + + if swag.IsZero(m.Notifications) { // not required + return nil + } + + for i := 0; i < len(m.Notifications); i++ { + if swag.IsZero(m.Notifications[i]) { // not required + continue + } + + if m.Notifications[i] != nil { + if err := m.Notifications[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("notifications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *HashicorpCloudVault20201125Cluster) validatePerformanceReplicationInfo(formats strfmt.Registry) error { if swag.IsZero(m.PerformanceReplicationInfo) { // not required diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go index f02b105b..be2d3de4 100644 --- a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go @@ -28,6 +28,9 @@ type HashicorpCloudVault20201125ClusterConfig struct { // maintenance config MaintenanceConfig HashicorpCloudVault20201125MaintenanceConfig `json:"maintenance_config,omitempty"` + // major version upgrade config + MajorVersionUpgradeConfig *HashicorpCloudVault20201125MajorVersionUpgradeConfig `json:"major_version_upgrade_config,omitempty"` + // metrics config MetricsConfig *HashicorpCloudVault20201125ObservabilityConfig `json:"metrics_config,omitempty"` @@ -63,6 +66,10 @@ func (m *HashicorpCloudVault20201125ClusterConfig) Validate(formats strfmt.Regis res = append(res, err) } + if err := m.validateMajorVersionUpgradeConfig(formats); err != nil { + res = append(res, err) + } + if err := m.validateMetricsConfig(formats); err != nil { res = append(res, err) } @@ -147,6 +154,24 @@ func (m *HashicorpCloudVault20201125ClusterConfig) validateCapacityConfig(format return nil } +func (m *HashicorpCloudVault20201125ClusterConfig) validateMajorVersionUpgradeConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.MajorVersionUpgradeConfig) { // not required + return nil + } + + if m.MajorVersionUpgradeConfig != nil { + if err := m.MajorVersionUpgradeConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("major_version_upgrade_config") + } + return err + } + } + + return nil +} + func (m *HashicorpCloudVault20201125ClusterConfig) validateMetricsConfig(formats strfmt.Registry) error { if swag.IsZero(m.MetricsConfig) { // not required diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification.go new file mode 100644 index 00000000..7878d38c --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification.go @@ -0,0 +1,73 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125ClusterNotification Notification holds the relevant information for sending a notification via the UI or email +// +// swagger:model hashicorp.cloud.vault_20201125.Cluster.Notification +type HashicorpCloudVault20201125ClusterNotification struct { + + // meta_data holds key-value pairs used to build the content of the notification + // struct is a proto representation of a JSON object + MetaData interface{} `json:"meta_data,omitempty"` + + // topic is the reason for the notification + Topic HashicorpCloudVault20201125ClusterNotificationTopic `json:"topic,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 cluster notification +func (m *HashicorpCloudVault20201125ClusterNotification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTopic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125ClusterNotification) validateTopic(formats strfmt.Registry) error { + + if swag.IsZero(m.Topic) { // not required + return nil + } + + if err := m.Topic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("topic") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterNotification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterNotification) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125ClusterNotification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification_topic.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification_topic.go new file mode 100644 index 00000000..99db06d5 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_notification_topic.go @@ -0,0 +1,75 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125ClusterNotificationTopic Topic describes the event that triggered the notification +// +// swagger:model hashicorp.cloud.vault_20201125.Cluster.Notification.Topic +type HashicorpCloudVault20201125ClusterNotificationTopic string + +const ( + + // HashicorpCloudVault20201125ClusterNotificationTopicCLUSTERNOTIFICATIONTOPICINVALID captures enum value "CLUSTER_NOTIFICATION_TOPIC_INVALID" + HashicorpCloudVault20201125ClusterNotificationTopicCLUSTERNOTIFICATIONTOPICINVALID HashicorpCloudVault20201125ClusterNotificationTopic = "CLUSTER_NOTIFICATION_TOPIC_INVALID" + + // HashicorpCloudVault20201125ClusterNotificationTopicNEWMAJORVERSIONAVAILABLE captures enum value "NEW_MAJOR_VERSION_AVAILABLE" + HashicorpCloudVault20201125ClusterNotificationTopicNEWMAJORVERSIONAVAILABLE HashicorpCloudVault20201125ClusterNotificationTopic = "NEW_MAJOR_VERSION_AVAILABLE" + + // HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEINPROGRESS captures enum value "MAJOR_VERSION_UPGRADE_IN_PROGRESS" + HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEINPROGRESS HashicorpCloudVault20201125ClusterNotificationTopic = "MAJOR_VERSION_UPGRADE_IN_PROGRESS" + + // HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADECOMPLETED captures enum value "MAJOR_VERSION_UPGRADE_COMPLETED" + HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADECOMPLETED HashicorpCloudVault20201125ClusterNotificationTopic = "MAJOR_VERSION_UPGRADE_COMPLETED" + + // HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEFAILED captures enum value "MAJOR_VERSION_UPGRADE_FAILED" + HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEFAILED HashicorpCloudVault20201125ClusterNotificationTopic = "MAJOR_VERSION_UPGRADE_FAILED" + + // HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEMANUALREMINDER captures enum value "MAJOR_VERSION_UPGRADE_MANUAL_REMINDER" + HashicorpCloudVault20201125ClusterNotificationTopicMAJORVERSIONUPGRADEMANUALREMINDER HashicorpCloudVault20201125ClusterNotificationTopic = "MAJOR_VERSION_UPGRADE_MANUAL_REMINDER" +) + +// for schema +var hashicorpCloudVault20201125ClusterNotificationTopicEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125ClusterNotificationTopic + if err := json.Unmarshal([]byte(`["CLUSTER_NOTIFICATION_TOPIC_INVALID","NEW_MAJOR_VERSION_AVAILABLE","MAJOR_VERSION_UPGRADE_IN_PROGRESS","MAJOR_VERSION_UPGRADE_COMPLETED","MAJOR_VERSION_UPGRADE_FAILED","MAJOR_VERSION_UPGRADE_MANUAL_REMINDER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125ClusterNotificationTopicEnum = append(hashicorpCloudVault20201125ClusterNotificationTopicEnum, v) + } +} + +func (m HashicorpCloudVault20201125ClusterNotificationTopic) validateHashicorpCloudVault20201125ClusterNotificationTopicEnum(path, location string, value HashicorpCloudVault20201125ClusterNotificationTopic) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125ClusterNotificationTopicEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 cluster notification topic +func (m HashicorpCloudVault20201125ClusterNotificationTopic) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125ClusterNotificationTopicEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response.go new file mode 100644 index 00000000..bd14cad6 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response.go @@ -0,0 +1,92 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetReplicationStatusResponse hashicorp cloud vault 20201125 get replication status response +// +// swagger:model hashicorp.cloud.vault_20201125.GetReplicationStatusResponse +type HashicorpCloudVault20201125GetReplicationStatusResponse struct { + + // connection status + ConnectionStatus HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus `json:"connection_status,omitempty"` + + // sync progress + SyncProgress HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress `json:"sync_progress,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get replication status response +func (m *HashicorpCloudVault20201125GetReplicationStatusResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSyncProgress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125GetReplicationStatusResponse) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125GetReplicationStatusResponse) validateSyncProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.SyncProgress) { // not required + return nil + } + + if err := m.SyncProgress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sync_progress") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetReplicationStatusResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetReplicationStatusResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetReplicationStatusResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_connection_status.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_connection_status.go new file mode 100644 index 00000000..e7be571e --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_connection_status.go @@ -0,0 +1,66 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus hashicorp cloud vault 20201125 get replication status response connection status +// +// swagger:model hashicorp.cloud.vault_20201125.GetReplicationStatusResponse.ConnectionStatus +type HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus string + +const ( + + // HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusGETREPLICATIONSTATUSRESPONSECONNECTIONSTATUSINVALID captures enum value "GET_REPLICATION_STATUS_RESPONSE_CONNECTION_STATUS_INVALID" + HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusGETREPLICATIONSTATUSRESPONSECONNECTIONSTATUSINVALID HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus = "GET_REPLICATION_STATUS_RESPONSE_CONNECTION_STATUS_INVALID" + + // HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusDISCONNECTED captures enum value "DISCONNECTED" + HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusDISCONNECTED HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus = "DISCONNECTED" + + // HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusCONNECTED captures enum value "CONNECTED" + HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusCONNECTED HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus = "CONNECTED" +) + +// for schema +var hashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus + if err := json.Unmarshal([]byte(`["GET_REPLICATION_STATUS_RESPONSE_CONNECTION_STATUS_INVALID","DISCONNECTED","CONNECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum = append(hashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum, v) + } +} + +func (m HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus) validateHashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum(path, location string, value HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 get replication status response connection status +func (m HashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125GetReplicationStatusResponseConnectionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_sync_progress.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_sync_progress.go new file mode 100644 index 00000000..b94c1065 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_get_replication_status_response_sync_progress.go @@ -0,0 +1,69 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress hashicorp cloud vault 20201125 get replication status response sync progress +// +// swagger:model hashicorp.cloud.vault_20201125.GetReplicationStatusResponse.SyncProgress +type HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress string + +const ( + + // HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressGETREPLICATIONSTATUSRESPONSESYNCPROGRESSINVALID captures enum value "GET_REPLICATION_STATUS_RESPONSE_SYNC_PROGRESS_INVALID" + HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressGETREPLICATIONSTATUSRESPONSESYNCPROGRESSINVALID HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress = "GET_REPLICATION_STATUS_RESPONSE_SYNC_PROGRESS_INVALID" + + // HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressSTREAMING captures enum value "STREAMING" + HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressSTREAMING HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress = "STREAMING" + + // HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressINPROGRESS captures enum value "IN_PROGRESS" + HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressINPROGRESS HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress = "IN_PROGRESS" + + // HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressIDLE captures enum value "IDLE" + HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressIDLE HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress = "IDLE" +) + +// for schema +var hashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress + if err := json.Unmarshal([]byte(`["GET_REPLICATION_STATUS_RESPONSE_SYNC_PROGRESS_INVALID","STREAMING","IN_PROGRESS","IDLE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum = append(hashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum, v) + } +} + +func (m HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress) validateHashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum(path, location string, value HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 get replication status response sync progress +func (m HashicorpCloudVault20201125GetReplicationStatusResponseSyncProgress) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125GetReplicationStatusResponseSyncProgressEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config.go new file mode 100644 index 00000000..43973a13 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config.go @@ -0,0 +1,94 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125MajorVersionUpgradeConfig MajorVersionUpgradeConfig is the major version upgrade configuration for the cluster +// +// swagger:model hashicorp.cloud.vault_20201125.MajorVersionUpgradeConfig +type HashicorpCloudVault20201125MajorVersionUpgradeConfig struct { + + // maintenance_window is the time window in which upgrades will occur, if upgrade_type is scheduled + MaintenanceWindow *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow `json:"maintenance_window,omitempty"` + + // upgrade_type is the upgrade method that will be used + UpgradeType HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType `json:"upgrade_type,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 major version upgrade config +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMaintenanceWindow(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpgradeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfig) validateMaintenanceWindow(formats strfmt.Registry) error { + + if swag.IsZero(m.MaintenanceWindow) { // not required + return nil + } + + if m.MaintenanceWindow != nil { + if err := m.MaintenanceWindow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maintenance_window") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfig) validateUpgradeType(formats strfmt.Registry) error { + + if swag.IsZero(m.UpgradeType) { // not required + return nil + } + + if err := m.UpgradeType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upgrade_type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125MajorVersionUpgradeConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window.go new file mode 100644 index 00000000..8664e8be --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window.go @@ -0,0 +1,92 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow hashicorp cloud vault 20201125 major version upgrade config maintenance window +// +// swagger:model hashicorp.cloud.vault_20201125.MajorVersionUpgradeConfig.MaintenanceWindow +type HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow struct { + + // day of week + DayOfWeek HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"` + + // time window utc + TimeWindowUtc HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC `json:"time_window_utc,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 major version upgrade config maintenance window +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDayOfWeek(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeWindowUtc(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow) validateDayOfWeek(formats strfmt.Registry) error { + + if swag.IsZero(m.DayOfWeek) { // not required + return nil + } + + if err := m.DayOfWeek.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("day_of_week") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow) validateTimeWindowUtc(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeWindowUtc) { // not required + return nil + } + + if err := m.TimeWindowUtc.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("time_window_utc") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_day_of_week.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_day_of_week.go new file mode 100644 index 00000000..61644331 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_day_of_week.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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek hashicorp cloud vault 20201125 major version upgrade config maintenance window day of week +// +// swagger:model hashicorp.cloud.vault_20201125.MajorVersionUpgradeConfig.MaintenanceWindow.DayOfWeek +type HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek string + +const ( + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekDAYOFWEEKINVALID captures enum value "DAY_OF_WEEK_INVALID" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekDAYOFWEEKINVALID HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "DAY_OF_WEEK_INVALID" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekMONDAY captures enum value "MONDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekMONDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "MONDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekTUESDAY captures enum value "TUESDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekTUESDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "TUESDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekWEDNESDAY captures enum value "WEDNESDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekWEDNESDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "WEDNESDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekTHURSDAY captures enum value "THURSDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekTHURSDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "THURSDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekFRIDAY captures enum value "FRIDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekFRIDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "FRIDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekSATURDAY captures enum value "SATURDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekSATURDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "SATURDAY" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekSUNDAY captures enum value "SUNDAY" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekSUNDAY HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek = "SUNDAY" +) + +// for schema +var hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek + if err := json.Unmarshal([]byte(`["DAY_OF_WEEK_INVALID","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum = append(hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum, v) + } +} + +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek) validateHashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum(path, location string, value HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 major version upgrade config maintenance window day of week +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeek) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowDayOfWeekEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_time_window_u_t_c.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_time_window_u_t_c.go new file mode 100644 index 00000000..1bcb8037 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_maintenance_window_time_window_u_t_c.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC hashicorp cloud vault 20201125 major version upgrade config maintenance window time window u t c +// +// swagger:model hashicorp.cloud.vault_20201125.MajorVersionUpgradeConfig.MaintenanceWindow.TimeWindowUTC +type HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC string + +const ( + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCTIMEWINDOWUTCINVALID captures enum value "TIME_WINDOW_UTC_INVALID" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCTIMEWINDOWUTCINVALID HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC = "TIME_WINDOW_UTC_INVALID" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW12AM4AM captures enum value "WINDOW_12AM_4AM" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW12AM4AM HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC = "WINDOW_12AM_4AM" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW6AM10AM captures enum value "WINDOW_6AM_10AM" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW6AM10AM HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC = "WINDOW_6AM_10AM" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW12PM4PM captures enum value "WINDOW_12PM_4PM" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW12PM4PM HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC = "WINDOW_12PM_4PM" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW6PM10PM captures enum value "WINDOW_6PM_10PM" + HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCWINDOW6PM10PM HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC = "WINDOW_6PM_10PM" +) + +// for schema +var hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC + if err := json.Unmarshal([]byte(`["TIME_WINDOW_UTC_INVALID","WINDOW_12AM_4AM","WINDOW_6AM_10AM","WINDOW_12PM_4PM","WINDOW_6PM_10PM"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum = append(hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum, v) + } +} + +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC) validateHashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum(path, location string, value HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 major version upgrade config maintenance window time window u t c +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTC) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindowTimeWindowUTCEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_upgrade_type.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_upgrade_type.go new file mode 100644 index 00000000..2f757379 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_major_version_upgrade_config_upgrade_type.go @@ -0,0 +1,69 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType hashicorp cloud vault 20201125 major version upgrade config upgrade type +// +// swagger:model hashicorp.cloud.vault_20201125.MajorVersionUpgradeConfig.UpgradeType +type HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType string + +const ( + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeMAJORVERSIONUPGRADECONFIGUPGRADETYPEINVALID captures enum value "MAJOR_VERSION_UPGRADE_CONFIG_UPGRADE_TYPE_INVALID" + HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeMAJORVERSIONUPGRADECONFIGUPGRADETYPEINVALID HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType = "MAJOR_VERSION_UPGRADE_CONFIG_UPGRADE_TYPE_INVALID" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeAUTOMATIC captures enum value "AUTOMATIC" + HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeAUTOMATIC HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType = "AUTOMATIC" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeSCHEDULED captures enum value "SCHEDULED" + HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeSCHEDULED HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType = "SCHEDULED" + + // HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeMANUAL captures enum value "MANUAL" + HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeMANUAL HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType = "MANUAL" +) + +// for schema +var hashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType + if err := json.Unmarshal([]byte(`["MAJOR_VERSION_UPGRADE_CONFIG_UPGRADE_TYPE_INVALID","AUTOMATIC","SCHEDULED","MANUAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum = append(hashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum, v) + } +} + +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType) validateHashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum(path, location string, value HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 major version upgrade config upgrade type +func (m HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_request.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_request.go new file mode 100644 index 00000000..d2fe41d2 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_request.go @@ -0,0 +1,123 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest hashicorp cloud vault 20201125 update major version upgrade config request +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateMajorVersionUpgradeConfigRequest +type HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // maintenance window + MaintenanceWindow *HashicorpCloudVault20201125MajorVersionUpgradeConfigMaintenanceWindow `json:"maintenance_window,omitempty"` + + // upgrade type + UpgradeType HashicorpCloudVault20201125MajorVersionUpgradeConfigUpgradeType `json:"upgrade_type,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update major version upgrade config request +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaintenanceWindow(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpgradeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) validateMaintenanceWindow(formats strfmt.Registry) error { + + if swag.IsZero(m.MaintenanceWindow) { // not required + return nil + } + + if m.MaintenanceWindow != nil { + if err := m.MaintenanceWindow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maintenance_window") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) validateUpgradeType(formats strfmt.Registry) error { + + if swag.IsZero(m.UpgradeType) { // not required + return nil + } + + if err := m.UpgradeType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upgrade_type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_response.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_response.go new file mode 100644 index 00000000..86f85b40 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_update_major_version_upgrade_config_response.go @@ -0,0 +1,11 @@ +// 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 + +// HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigResponse hashicorp cloud vault 20201125 update major version upgrade config response +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateMajorVersionUpgradeConfigResponse +type HashicorpCloudVault20201125UpdateMajorVersionUpgradeConfigResponse interface{} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_request.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_request.go new file mode 100644 index 00000000..d474c677 --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_request.go @@ -0,0 +1,75 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125UpgradeMajorVersionRequest hashicorp cloud vault 20201125 upgrade major version request +// +// swagger:model hashicorp.cloud.vault_20201125.UpgradeMajorVersionRequest +type HashicorpCloudVault20201125UpgradeMajorVersionRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 upgrade major version request +func (m *HashicorpCloudVault20201125UpgradeMajorVersionRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125UpgradeMajorVersionRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpgradeMajorVersionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpgradeMajorVersionRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpgradeMajorVersionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_response.go b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_response.go new file mode 100644 index 00000000..ea2c7dae --- /dev/null +++ b/clients/cloud-vault-service/stable/2020-11-25/models/hashicorp_cloud_vault20201125_upgrade_major_version_response.go @@ -0,0 +1,72 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125UpgradeMajorVersionResponse hashicorp cloud vault 20201125 upgrade major version response +// +// swagger:model hashicorp.cloud.vault_20201125.UpgradeMajorVersionResponse +type HashicorpCloudVault20201125UpgradeMajorVersionResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 upgrade major version response +func (m *HashicorpCloudVault20201125UpgradeMajorVersionResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125UpgradeMajorVersionResponse) validateOperation(formats strfmt.Registry) error { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpgradeMajorVersionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpgradeMajorVersionResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpgradeMajorVersionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}