diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/cloud_vault_service_client.go b/clients/cloud-vault-service/preview/2020-04-20/client/cloud_vault_service_client.go new file mode 100644 index 00000000..0071797a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/cloud_vault_service_client.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// 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/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/preview/2020-04-20/client/vault_service" +) + +// Default cloud vault service HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "api.cloud.hashicorp.com" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new cloud vault service HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudVaultService { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud vault service HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudVaultService { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new cloud vault service client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudVaultService { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudVaultService) + cli.Transport = transport + cli.VaultService = vault_service.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// CloudVaultService is a client for cloud vault service +type CloudVaultService struct { + VaultService vault_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudVaultService) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.VaultService.SetTransport(transport) +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_parameters.go new file mode 100644 index 00000000..58bcc3ae --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_parameters.go @@ -0,0 +1,177 @@ +// 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/preview/2020-04-20/models" +) + +// NewCreateParams creates a new CreateParams object +// with the default values initialized. +func NewCreateParams() *CreateParams { + var () + return &CreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateParamsWithTimeout creates a new CreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateParamsWithTimeout(timeout time.Duration) *CreateParams { + var () + return &CreateParams{ + + timeout: timeout, + } +} + +// NewCreateParamsWithContext creates a new CreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateParamsWithContext(ctx context.Context) *CreateParams { + var () + return &CreateParams{ + + Context: ctx, + } +} + +// NewCreateParamsWithHTTPClient creates a new CreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateParamsWithHTTPClient(client *http.Client) *CreateParams { + var () + return &CreateParams{ + HTTPClient: client, + } +} + +/*CreateParams contains all the parameters to send to the API endpoint +for the create operation typically these are written to a http.Request +*/ +type CreateParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420CreateRequest + /*ClusterLocationOrganizationID + organization_id is the id of the organization. + + */ + ClusterLocationOrganizationID string + /*ClusterLocationProjectID + project_id is the projects id. + + */ + ClusterLocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create params +func (o *CreateParams) WithTimeout(timeout time.Duration) *CreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create params +func (o *CreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create params +func (o *CreateParams) WithContext(ctx context.Context) *CreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create params +func (o *CreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create params +func (o *CreateParams) WithHTTPClient(client *http.Client) *CreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create params +func (o *CreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create params +func (o *CreateParams) WithBody(body *models.HashicorpCloudVault20200420CreateRequest) *CreateParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create params +func (o *CreateParams) SetBody(body *models.HashicorpCloudVault20200420CreateRequest) { + o.Body = body +} + +// WithClusterLocationOrganizationID adds the clusterLocationOrganizationID to the create params +func (o *CreateParams) WithClusterLocationOrganizationID(clusterLocationOrganizationID string) *CreateParams { + o.SetClusterLocationOrganizationID(clusterLocationOrganizationID) + return o +} + +// SetClusterLocationOrganizationID adds the clusterLocationOrganizationId to the create params +func (o *CreateParams) SetClusterLocationOrganizationID(clusterLocationOrganizationID string) { + o.ClusterLocationOrganizationID = clusterLocationOrganizationID +} + +// WithClusterLocationProjectID adds the clusterLocationProjectID to the create params +func (o *CreateParams) WithClusterLocationProjectID(clusterLocationProjectID string) *CreateParams { + o.SetClusterLocationProjectID(clusterLocationProjectID) + return o +} + +// SetClusterLocationProjectID adds the clusterLocationProjectId to the create params +func (o *CreateParams) SetClusterLocationProjectID(clusterLocationProjectID string) { + o.ClusterLocationProjectID = clusterLocationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateParams) 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.location.organization_id + if err := r.SetPathParam("cluster.location.organization_id", o.ClusterLocationOrganizationID); err != nil { + return err + } + + // path param cluster.location.project_id + if err := r.SetPathParam("cluster.location.project_id", o.ClusterLocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_responses.go new file mode 100644 index 00000000..cf1615bc --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_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/preview/2020-04-20/models" +) + +// CreateReader is a Reader for the Create structure. +type CreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateDefault(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 + } +} + +// NewCreateOK creates a CreateOK with default headers values +func NewCreateOK() *CreateOK { + return &CreateOK{} +} + +/*CreateOK handles this case with default header values. + +A successful response. +*/ +type CreateOK struct { + Payload *models.HashicorpCloudVault20200420CreateResponse +} + +func (o *CreateOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters][%d] createOK %+v", 200, o.Payload) +} + +func (o *CreateOK) GetPayload() *models.HashicorpCloudVault20200420CreateResponse { + return o.Payload +} + +func (o *CreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420CreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDefault creates a CreateDefault with default headers values +func NewCreateDefault(code int) *CreateDefault { + return &CreateDefault{ + _statusCode: code, + } +} + +/*CreateDefault handles this case with default header values. + +An unexpected error response. +*/ +type CreateDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the create default response +func (o *CreateDefault) Code() int { + return o._statusCode +} + +func (o *CreateDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters][%d] Create default %+v", o._statusCode, o.Payload) +} + +func (o *CreateDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *CreateDefault) 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/preview/2020-04-20/client/vault_service/create_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_snapshot_parameters.go new file mode 100644 index 00000000..950ce161 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_snapshot_parameters.go @@ -0,0 +1,177 @@ +// 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/preview/2020-04-20/models" +) + +// NewCreateSnapshotParams creates a new CreateSnapshotParams object +// with the default values initialized. +func NewCreateSnapshotParams() *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSnapshotParamsWithTimeout creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateSnapshotParamsWithTimeout(timeout time.Duration) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + timeout: timeout, + } +} + +// NewCreateSnapshotParamsWithContext creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateSnapshotParamsWithContext(ctx context.Context) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + Context: ctx, + } +} + +// NewCreateSnapshotParamsWithHTTPClient creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateSnapshotParamsWithHTTPClient(client *http.Client) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + HTTPClient: client, + } +} + +/*CreateSnapshotParams contains all the parameters to send to the API endpoint +for the create snapshot operation typically these are written to a http.Request +*/ +type CreateSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420CreateSnapshotRequest + /*ResourceLocationOrganizationID + organization_id is the id of the organization. + + */ + ResourceLocationOrganizationID string + /*ResourceLocationProjectID + project_id is the projects id. + + */ + ResourceLocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create snapshot params +func (o *CreateSnapshotParams) WithTimeout(timeout time.Duration) *CreateSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create snapshot params +func (o *CreateSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create snapshot params +func (o *CreateSnapshotParams) WithContext(ctx context.Context) *CreateSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create snapshot params +func (o *CreateSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create snapshot params +func (o *CreateSnapshotParams) WithHTTPClient(client *http.Client) *CreateSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create snapshot params +func (o *CreateSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create snapshot params +func (o *CreateSnapshotParams) WithBody(body *models.HashicorpCloudVault20200420CreateSnapshotRequest) *CreateSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create snapshot params +func (o *CreateSnapshotParams) SetBody(body *models.HashicorpCloudVault20200420CreateSnapshotRequest) { + o.Body = body +} + +// WithResourceLocationOrganizationID adds the resourceLocationOrganizationID to the create snapshot params +func (o *CreateSnapshotParams) WithResourceLocationOrganizationID(resourceLocationOrganizationID string) *CreateSnapshotParams { + o.SetResourceLocationOrganizationID(resourceLocationOrganizationID) + return o +} + +// SetResourceLocationOrganizationID adds the resourceLocationOrganizationId to the create snapshot params +func (o *CreateSnapshotParams) SetResourceLocationOrganizationID(resourceLocationOrganizationID string) { + o.ResourceLocationOrganizationID = resourceLocationOrganizationID +} + +// WithResourceLocationProjectID adds the resourceLocationProjectID to the create snapshot params +func (o *CreateSnapshotParams) WithResourceLocationProjectID(resourceLocationProjectID string) *CreateSnapshotParams { + o.SetResourceLocationProjectID(resourceLocationProjectID) + return o +} + +// SetResourceLocationProjectID adds the resourceLocationProjectId to the create snapshot params +func (o *CreateSnapshotParams) SetResourceLocationProjectID(resourceLocationProjectID string) { + o.ResourceLocationProjectID = resourceLocationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSnapshotParams) 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 resource.location.organization_id + if err := r.SetPathParam("resource.location.organization_id", o.ResourceLocationOrganizationID); err != nil { + return err + } + + // path param resource.location.project_id + if err := r.SetPathParam("resource.location.project_id", o.ResourceLocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_snapshot_responses.go new file mode 100644 index 00000000..8ea81a84 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/create_snapshot_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/preview/2020-04-20/models" +) + +// CreateSnapshotReader is a Reader for the CreateSnapshot structure. +type CreateSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateSnapshotDefault(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 + } +} + +// NewCreateSnapshotOK creates a CreateSnapshotOK with default headers values +func NewCreateSnapshotOK() *CreateSnapshotOK { + return &CreateSnapshotOK{} +} + +/*CreateSnapshotOK handles this case with default header values. + +A successful response. +*/ +type CreateSnapshotOK struct { + Payload *models.HashicorpCloudVault20200420CreateSnapshotResponse +} + +func (o *CreateSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] createSnapshotOK %+v", 200, o.Payload) +} + +func (o *CreateSnapshotOK) GetPayload() *models.HashicorpCloudVault20200420CreateSnapshotResponse { + return o.Payload +} + +func (o *CreateSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420CreateSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSnapshotDefault creates a CreateSnapshotDefault with default headers values +func NewCreateSnapshotDefault(code int) *CreateSnapshotDefault { + return &CreateSnapshotDefault{ + _statusCode: code, + } +} + +/*CreateSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type CreateSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the create snapshot default response +func (o *CreateSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *CreateSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] CreateSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *CreateSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *CreateSnapshotDefault) 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/preview/2020-04-20/client/vault_service/delete_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_parameters.go new file mode 100644 index 00000000..a16ce98e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_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" +) + +// NewDeleteParams creates a new DeleteParams object +// with the default values initialized. +func NewDeleteParams() *DeleteParams { + var () + return &DeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteParamsWithTimeout creates a new DeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { + var () + return &DeleteParams{ + + timeout: timeout, + } +} + +// NewDeleteParamsWithContext creates a new DeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { + var () + return &DeleteParams{ + + Context: ctx, + } +} + +// NewDeleteParamsWithHTTPClient creates a new DeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { + var () + return &DeleteParams{ + HTTPClient: client, + } +} + +/*DeleteParams contains all the parameters to send to the API endpoint +for the delete operation typically these are written to a http.Request +*/ +type DeleteParams 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 delete params +func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete params +func (o *DeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete params +func (o *DeleteParams) WithContext(ctx context.Context) *DeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete params +func (o *DeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) WithHTTPClient(client *http.Client) *DeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the delete params +func (o *DeleteParams) WithClusterID(clusterID string) *DeleteParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the delete params +func (o *DeleteParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the delete params +func (o *DeleteParams) WithLocationOrganizationID(locationOrganizationID string) *DeleteParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the delete params +func (o *DeleteParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the delete params +func (o *DeleteParams) WithLocationProjectID(locationProjectID string) *DeleteParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the delete params +func (o *DeleteParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the delete params +func (o *DeleteParams) WithLocationRegionProvider(locationRegionProvider *string) *DeleteParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the delete params +func (o *DeleteParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the delete params +func (o *DeleteParams) WithLocationRegionRegion(locationRegionRegion *string) *DeleteParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the delete params +func (o *DeleteParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteParams) 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/preview/2020-04-20/client/vault_service/delete_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_responses.go new file mode 100644 index 00000000..97aa0a45 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_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/preview/2020-04-20/models" +) + +// DeleteReader is a Reader for the Delete structure. +type DeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteDefault(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 + } +} + +// NewDeleteOK creates a DeleteOK with default headers values +func NewDeleteOK() *DeleteOK { + return &DeleteOK{} +} + +/*DeleteOK handles this case with default header values. + +A successful response. +*/ +type DeleteOK struct { + Payload *models.HashicorpCloudVault20200420DeleteResponse +} + +func (o *DeleteOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] deleteOK %+v", 200, o.Payload) +} + +func (o *DeleteOK) GetPayload() *models.HashicorpCloudVault20200420DeleteResponse { + return o.Payload +} + +func (o *DeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteDefault creates a DeleteDefault with default headers values +func NewDeleteDefault(code int) *DeleteDefault { + return &DeleteDefault{ + _statusCode: code, + } +} + +/*DeleteDefault handles this case with default header values. + +An unexpected error response. +*/ +type DeleteDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the delete default response +func (o *DeleteDefault) Code() int { + return o._statusCode +} + +func (o *DeleteDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] Delete default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DeleteDefault) 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/preview/2020-04-20/client/vault_service/delete_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_snapshot_parameters.go new file mode 100644 index 00000000..54bd0ff6 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_snapshot_parameters.go @@ -0,0 +1,241 @@ +// 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" +) + +// NewDeleteSnapshotParams creates a new DeleteSnapshotParams object +// with the default values initialized. +func NewDeleteSnapshotParams() *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSnapshotParamsWithTimeout creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSnapshotParamsWithTimeout(timeout time.Duration) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + timeout: timeout, + } +} + +// NewDeleteSnapshotParamsWithContext creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSnapshotParamsWithContext(ctx context.Context) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + Context: ctx, + } +} + +// NewDeleteSnapshotParamsWithHTTPClient creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSnapshotParamsWithHTTPClient(client *http.Client) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + HTTPClient: client, + } +} + +/*DeleteSnapshotParams contains all the parameters to send to the API endpoint +for the delete snapshot operation typically these are written to a http.Request +*/ +type DeleteSnapshotParams struct { + + /*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 + /*SnapshotID + snapshot_id represents the snapshot to delete. + + */ + SnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete snapshot params +func (o *DeleteSnapshotParams) WithTimeout(timeout time.Duration) *DeleteSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete snapshot params +func (o *DeleteSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete snapshot params +func (o *DeleteSnapshotParams) WithContext(ctx context.Context) *DeleteSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete snapshot params +func (o *DeleteSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete snapshot params +func (o *DeleteSnapshotParams) WithHTTPClient(client *http.Client) *DeleteSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete snapshot params +func (o *DeleteSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *DeleteSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationProjectID(locationProjectID string) *DeleteSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationRegionProvider(locationRegionProvider *string) *DeleteSnapshotParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationRegionRegion(locationRegionRegion *string) *DeleteSnapshotParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSnapshotID adds the snapshotID to the delete snapshot params +func (o *DeleteSnapshotParams) WithSnapshotID(snapshotID string) *DeleteSnapshotParams { + o.SetSnapshotID(snapshotID) + return o +} + +// SetSnapshotID adds the snapshotId to the delete snapshot params +func (o *DeleteSnapshotParams) SetSnapshotID(snapshotID string) { + o.SnapshotID = snapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 + } + } + + } + + // path param snapshot_id + if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_snapshot_responses.go new file mode 100644 index 00000000..9b32617e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/delete_snapshot_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/preview/2020-04-20/models" +) + +// DeleteSnapshotReader is a Reader for the DeleteSnapshot structure. +type DeleteSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteSnapshotDefault(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 + } +} + +// NewDeleteSnapshotOK creates a DeleteSnapshotOK with default headers values +func NewDeleteSnapshotOK() *DeleteSnapshotOK { + return &DeleteSnapshotOK{} +} + +/*DeleteSnapshotOK handles this case with default header values. + +A successful response. +*/ +type DeleteSnapshotOK struct { + Payload *models.HashicorpCloudVault20200420DeleteSnapshotResponse +} + +func (o *DeleteSnapshotOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] deleteSnapshotOK %+v", 200, o.Payload) +} + +func (o *DeleteSnapshotOK) GetPayload() *models.HashicorpCloudVault20200420DeleteSnapshotResponse { + return o.Payload +} + +func (o *DeleteSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420DeleteSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSnapshotDefault creates a DeleteSnapshotDefault with default headers values +func NewDeleteSnapshotDefault(code int) *DeleteSnapshotDefault { + return &DeleteSnapshotDefault{ + _statusCode: code, + } +} + +/*DeleteSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type DeleteSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the delete snapshot default response +func (o *DeleteSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *DeleteSnapshotDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] DeleteSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DeleteSnapshotDefault) 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/preview/2020-04-20/client/vault_service/disable_c_o_r_s_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/disable_c_o_r_s_parameters.go new file mode 100644 index 00000000..808b726e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/disable_c_o_r_s_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" +) + +// NewDisableCORSParams creates a new DisableCORSParams object +// with the default values initialized. +func NewDisableCORSParams() *DisableCORSParams { + var () + return &DisableCORSParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDisableCORSParamsWithTimeout creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDisableCORSParamsWithTimeout(timeout time.Duration) *DisableCORSParams { + var () + return &DisableCORSParams{ + + timeout: timeout, + } +} + +// NewDisableCORSParamsWithContext creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a context for a request +func NewDisableCORSParamsWithContext(ctx context.Context) *DisableCORSParams { + var () + return &DisableCORSParams{ + + Context: ctx, + } +} + +// NewDisableCORSParamsWithHTTPClient creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDisableCORSParamsWithHTTPClient(client *http.Client) *DisableCORSParams { + var () + return &DisableCORSParams{ + HTTPClient: client, + } +} + +/*DisableCORSParams contains all the parameters to send to the API endpoint +for the disable c o r s operation typically these are written to a http.Request +*/ +type DisableCORSParams 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 disable c o r s params +func (o *DisableCORSParams) WithTimeout(timeout time.Duration) *DisableCORSParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the disable c o r s params +func (o *DisableCORSParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the disable c o r s params +func (o *DisableCORSParams) WithContext(ctx context.Context) *DisableCORSParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the disable c o r s params +func (o *DisableCORSParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the disable c o r s params +func (o *DisableCORSParams) WithHTTPClient(client *http.Client) *DisableCORSParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the disable c o r s params +func (o *DisableCORSParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the disable c o r s params +func (o *DisableCORSParams) WithClusterID(clusterID string) *DisableCORSParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the disable c o r s params +func (o *DisableCORSParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the disable c o r s params +func (o *DisableCORSParams) WithLocationOrganizationID(locationOrganizationID string) *DisableCORSParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the disable c o r s params +func (o *DisableCORSParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the disable c o r s params +func (o *DisableCORSParams) WithLocationProjectID(locationProjectID string) *DisableCORSParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the disable c o r s params +func (o *DisableCORSParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the disable c o r s params +func (o *DisableCORSParams) WithLocationRegionProvider(locationRegionProvider *string) *DisableCORSParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the disable c o r s params +func (o *DisableCORSParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the disable c o r s params +func (o *DisableCORSParams) WithLocationRegionRegion(locationRegionRegion *string) *DisableCORSParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the disable c o r s params +func (o *DisableCORSParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *DisableCORSParams) 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/preview/2020-04-20/client/vault_service/disable_c_o_r_s_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/disable_c_o_r_s_responses.go new file mode 100644 index 00000000..038cf215 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/disable_c_o_r_s_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/preview/2020-04-20/models" +) + +// DisableCORSReader is a Reader for the DisableCORS structure. +type DisableCORSReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DisableCORSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDisableCORSOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDisableCORSDefault(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 + } +} + +// NewDisableCORSOK creates a DisableCORSOK with default headers values +func NewDisableCORSOK() *DisableCORSOK { + return &DisableCORSOK{} +} + +/*DisableCORSOK handles this case with default header values. + +A successful response. +*/ +type DisableCORSOK struct { + Payload models.HashicorpCloudVault20200420DisableCORSResponse +} + +func (o *DisableCORSOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors][%d] disableCORSOK %+v", 200, o.Payload) +} + +func (o *DisableCORSOK) GetPayload() models.HashicorpCloudVault20200420DisableCORSResponse { + return o.Payload +} + +func (o *DisableCORSOK) 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 +} + +// NewDisableCORSDefault creates a DisableCORSDefault with default headers values +func NewDisableCORSDefault(code int) *DisableCORSDefault { + return &DisableCORSDefault{ + _statusCode: code, + } +} + +/*DisableCORSDefault handles this case with default header values. + +An unexpected error response. +*/ +type DisableCORSDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the disable c o r s default response +func (o *DisableCORSDefault) Code() int { + return o._statusCode +} + +func (o *DisableCORSDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors][%d] DisableCORS default %+v", o._statusCode, o.Payload) +} + +func (o *DisableCORSDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DisableCORSDefault) 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/preview/2020-04-20/client/vault_service/fetch_audit_log_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/fetch_audit_log_parameters.go new file mode 100644 index 00000000..91fce421 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/fetch_audit_log_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/preview/2020-04-20/models" +) + +// NewFetchAuditLogParams creates a new FetchAuditLogParams object +// with the default values initialized. +func NewFetchAuditLogParams() *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFetchAuditLogParamsWithTimeout creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFetchAuditLogParamsWithTimeout(timeout time.Duration) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + timeout: timeout, + } +} + +// NewFetchAuditLogParamsWithContext creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a context for a request +func NewFetchAuditLogParamsWithContext(ctx context.Context) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + Context: ctx, + } +} + +// NewFetchAuditLogParamsWithHTTPClient creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFetchAuditLogParamsWithHTTPClient(client *http.Client) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + HTTPClient: client, + } +} + +/*FetchAuditLogParams contains all the parameters to send to the API endpoint +for the fetch audit log operation typically these are written to a http.Request +*/ +type FetchAuditLogParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420FetchAuditLogRequest + /*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 fetch audit log params +func (o *FetchAuditLogParams) WithTimeout(timeout time.Duration) *FetchAuditLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the fetch audit log params +func (o *FetchAuditLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the fetch audit log params +func (o *FetchAuditLogParams) WithContext(ctx context.Context) *FetchAuditLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the fetch audit log params +func (o *FetchAuditLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the fetch audit log params +func (o *FetchAuditLogParams) WithHTTPClient(client *http.Client) *FetchAuditLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the fetch audit log params +func (o *FetchAuditLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the fetch audit log params +func (o *FetchAuditLogParams) WithBody(body *models.HashicorpCloudVault20200420FetchAuditLogRequest) *FetchAuditLogParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the fetch audit log params +func (o *FetchAuditLogParams) SetBody(body *models.HashicorpCloudVault20200420FetchAuditLogRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the fetch audit log params +func (o *FetchAuditLogParams) WithClusterID(clusterID string) *FetchAuditLogParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the fetch audit log params +func (o *FetchAuditLogParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the fetch audit log params +func (o *FetchAuditLogParams) WithLocationOrganizationID(locationOrganizationID string) *FetchAuditLogParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the fetch audit log params +func (o *FetchAuditLogParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the fetch audit log params +func (o *FetchAuditLogParams) WithLocationProjectID(locationProjectID string) *FetchAuditLogParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the fetch audit log params +func (o *FetchAuditLogParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *FetchAuditLogParams) 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/preview/2020-04-20/client/vault_service/fetch_audit_log_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/fetch_audit_log_responses.go new file mode 100644 index 00000000..247ab1f3 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/fetch_audit_log_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/preview/2020-04-20/models" +) + +// FetchAuditLogReader is a Reader for the FetchAuditLog structure. +type FetchAuditLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FetchAuditLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFetchAuditLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFetchAuditLogDefault(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 + } +} + +// NewFetchAuditLogOK creates a FetchAuditLogOK with default headers values +func NewFetchAuditLogOK() *FetchAuditLogOK { + return &FetchAuditLogOK{} +} + +/*FetchAuditLogOK handles this case with default header values. + +A successful response. +*/ +type FetchAuditLogOK struct { + Payload *models.HashicorpCloudVault20200420FetchAuditLogResponse +} + +func (o *FetchAuditLogOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog][%d] fetchAuditLogOK %+v", 200, o.Payload) +} + +func (o *FetchAuditLogOK) GetPayload() *models.HashicorpCloudVault20200420FetchAuditLogResponse { + return o.Payload +} + +func (o *FetchAuditLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420FetchAuditLogResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFetchAuditLogDefault creates a FetchAuditLogDefault with default headers values +func NewFetchAuditLogDefault(code int) *FetchAuditLogDefault { + return &FetchAuditLogDefault{ + _statusCode: code, + } +} + +/*FetchAuditLogDefault handles this case with default header values. + +An unexpected error response. +*/ +type FetchAuditLogDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the fetch audit log default response +func (o *FetchAuditLogDefault) Code() int { + return o._statusCode +} + +func (o *FetchAuditLogDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog][%d] FetchAuditLog default %+v", o._statusCode, o.Payload) +} + +func (o *FetchAuditLogDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *FetchAuditLogDefault) 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/preview/2020-04-20/client/vault_service/get_admin_token_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_admin_token_parameters.go new file mode 100644 index 00000000..9d4bb39a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_admin_token_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" +) + +// NewGetAdminTokenParams creates a new GetAdminTokenParams object +// with the default values initialized. +func NewGetAdminTokenParams() *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAdminTokenParamsWithTimeout creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAdminTokenParamsWithTimeout(timeout time.Duration) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + timeout: timeout, + } +} + +// NewGetAdminTokenParamsWithContext creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAdminTokenParamsWithContext(ctx context.Context) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + Context: ctx, + } +} + +// NewGetAdminTokenParamsWithHTTPClient creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAdminTokenParamsWithHTTPClient(client *http.Client) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + HTTPClient: client, + } +} + +/*GetAdminTokenParams contains all the parameters to send to the API endpoint +for the get admin token operation typically these are written to a http.Request +*/ +type GetAdminTokenParams 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 admin token params +func (o *GetAdminTokenParams) WithTimeout(timeout time.Duration) *GetAdminTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get admin token params +func (o *GetAdminTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get admin token params +func (o *GetAdminTokenParams) WithContext(ctx context.Context) *GetAdminTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get admin token params +func (o *GetAdminTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get admin token params +func (o *GetAdminTokenParams) WithHTTPClient(client *http.Client) *GetAdminTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get admin token params +func (o *GetAdminTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get admin token params +func (o *GetAdminTokenParams) WithClusterID(clusterID string) *GetAdminTokenParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get admin token params +func (o *GetAdminTokenParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get admin token params +func (o *GetAdminTokenParams) WithLocationOrganizationID(locationOrganizationID string) *GetAdminTokenParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get admin token params +func (o *GetAdminTokenParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get admin token params +func (o *GetAdminTokenParams) WithLocationProjectID(locationProjectID string) *GetAdminTokenParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get admin token params +func (o *GetAdminTokenParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get admin token params +func (o *GetAdminTokenParams) WithLocationRegionProvider(locationRegionProvider *string) *GetAdminTokenParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get admin token params +func (o *GetAdminTokenParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get admin token params +func (o *GetAdminTokenParams) WithLocationRegionRegion(locationRegionRegion *string) *GetAdminTokenParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get admin token params +func (o *GetAdminTokenParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAdminTokenParams) 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/preview/2020-04-20/client/vault_service/get_admin_token_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_admin_token_responses.go new file mode 100644 index 00000000..1220741e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_admin_token_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/preview/2020-04-20/models" +) + +// GetAdminTokenReader is a Reader for the GetAdminToken structure. +type GetAdminTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAdminTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAdminTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAdminTokenDefault(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 + } +} + +// NewGetAdminTokenOK creates a GetAdminTokenOK with default headers values +func NewGetAdminTokenOK() *GetAdminTokenOK { + return &GetAdminTokenOK{} +} + +/*GetAdminTokenOK handles this case with default header values. + +A successful response. +*/ +type GetAdminTokenOK struct { + Payload *models.HashicorpCloudVault20200420GetAdminTokenResponse +} + +func (o *GetAdminTokenOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken][%d] getAdminTokenOK %+v", 200, o.Payload) +} + +func (o *GetAdminTokenOK) GetPayload() *models.HashicorpCloudVault20200420GetAdminTokenResponse { + return o.Payload +} + +func (o *GetAdminTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420GetAdminTokenResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAdminTokenDefault creates a GetAdminTokenDefault with default headers values +func NewGetAdminTokenDefault(code int) *GetAdminTokenDefault { + return &GetAdminTokenDefault{ + _statusCode: code, + } +} + +/*GetAdminTokenDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetAdminTokenDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get admin token default response +func (o *GetAdminTokenDefault) Code() int { + return o._statusCode +} + +func (o *GetAdminTokenDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken][%d] GetAdminToken default %+v", o._statusCode, o.Payload) +} + +func (o *GetAdminTokenDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetAdminTokenDefault) 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/preview/2020-04-20/client/vault_service/get_audit_log_status_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_audit_log_status_parameters.go new file mode 100644 index 00000000..1109cbd1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_audit_log_status_parameters.go @@ -0,0 +1,256 @@ +// 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" +) + +// NewGetAuditLogStatusParams creates a new GetAuditLogStatusParams object +// with the default values initialized. +func NewGetAuditLogStatusParams() *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAuditLogStatusParamsWithTimeout creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAuditLogStatusParamsWithTimeout(timeout time.Duration) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + timeout: timeout, + } +} + +// NewGetAuditLogStatusParamsWithContext creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAuditLogStatusParamsWithContext(ctx context.Context) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + Context: ctx, + } +} + +// NewGetAuditLogStatusParamsWithHTTPClient creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAuditLogStatusParamsWithHTTPClient(client *http.Client) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + HTTPClient: client, + } +} + +/*GetAuditLogStatusParams contains all the parameters to send to the API endpoint +for the get audit log status operation typically these are written to a http.Request +*/ +type GetAuditLogStatusParams 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 + /*LogID*/ + LogID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get audit log status params +func (o *GetAuditLogStatusParams) WithTimeout(timeout time.Duration) *GetAuditLogStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get audit log status params +func (o *GetAuditLogStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get audit log status params +func (o *GetAuditLogStatusParams) WithContext(ctx context.Context) *GetAuditLogStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get audit log status params +func (o *GetAuditLogStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get audit log status params +func (o *GetAuditLogStatusParams) WithHTTPClient(client *http.Client) *GetAuditLogStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get audit log status params +func (o *GetAuditLogStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get audit log status params +func (o *GetAuditLogStatusParams) WithClusterID(clusterID string) *GetAuditLogStatusParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get audit log status params +func (o *GetAuditLogStatusParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationOrganizationID(locationOrganizationID string) *GetAuditLogStatusParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationProjectID(locationProjectID string) *GetAuditLogStatusParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationRegionProvider(locationRegionProvider *string) *GetAuditLogStatusParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationRegionRegion(locationRegionRegion *string) *GetAuditLogStatusParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithLogID adds the logID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLogID(logID string) *GetAuditLogStatusParams { + o.SetLogID(logID) + return o +} + +// SetLogID adds the logId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLogID(logID string) { + o.LogID = logID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAuditLogStatusParams) 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 + } + } + + } + + // path param log_id + if err := r.SetPathParam("log_id", o.LogID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_audit_log_status_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_audit_log_status_responses.go new file mode 100644 index 00000000..a25c694a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_audit_log_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/preview/2020-04-20/models" +) + +// GetAuditLogStatusReader is a Reader for the GetAuditLogStatus structure. +type GetAuditLogStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAuditLogStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAuditLogStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAuditLogStatusDefault(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 + } +} + +// NewGetAuditLogStatusOK creates a GetAuditLogStatusOK with default headers values +func NewGetAuditLogStatusOK() *GetAuditLogStatusOK { + return &GetAuditLogStatusOK{} +} + +/*GetAuditLogStatusOK handles this case with default header values. + +A successful response. +*/ +type GetAuditLogStatusOK struct { + Payload *models.HashicorpCloudVault20200420GetAuditLogStatusResponse +} + +func (o *GetAuditLogStatusOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}][%d] getAuditLogStatusOK %+v", 200, o.Payload) +} + +func (o *GetAuditLogStatusOK) GetPayload() *models.HashicorpCloudVault20200420GetAuditLogStatusResponse { + return o.Payload +} + +func (o *GetAuditLogStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420GetAuditLogStatusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuditLogStatusDefault creates a GetAuditLogStatusDefault with default headers values +func NewGetAuditLogStatusDefault(code int) *GetAuditLogStatusDefault { + return &GetAuditLogStatusDefault{ + _statusCode: code, + } +} + +/*GetAuditLogStatusDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetAuditLogStatusDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get audit log status default response +func (o *GetAuditLogStatusDefault) Code() int { + return o._statusCode +} + +func (o *GetAuditLogStatusDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}][%d] GetAuditLogStatus default %+v", o._statusCode, o.Payload) +} + +func (o *GetAuditLogStatusDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetAuditLogStatusDefault) 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/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_parameters.go new file mode 100644 index 00000000..bf4c709e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_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" +) + +// NewGetCORSConfigParams creates a new GetCORSConfigParams object +// with the default values initialized. +func NewGetCORSConfigParams() *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCORSConfigParamsWithTimeout creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCORSConfigParamsWithTimeout(timeout time.Duration) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + timeout: timeout, + } +} + +// NewGetCORSConfigParamsWithContext creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCORSConfigParamsWithContext(ctx context.Context) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + Context: ctx, + } +} + +// NewGetCORSConfigParamsWithHTTPClient creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCORSConfigParamsWithHTTPClient(client *http.Client) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + HTTPClient: client, + } +} + +/*GetCORSConfigParams contains all the parameters to send to the API endpoint +for the get c o r s config operation typically these are written to a http.Request +*/ +type GetCORSConfigParams 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 c o r s config params +func (o *GetCORSConfigParams) WithTimeout(timeout time.Duration) *GetCORSConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get c o r s config params +func (o *GetCORSConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get c o r s config params +func (o *GetCORSConfigParams) WithContext(ctx context.Context) *GetCORSConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get c o r s config params +func (o *GetCORSConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get c o r s config params +func (o *GetCORSConfigParams) WithHTTPClient(client *http.Client) *GetCORSConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get c o r s config params +func (o *GetCORSConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get c o r s config params +func (o *GetCORSConfigParams) WithClusterID(clusterID string) *GetCORSConfigParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get c o r s config params +func (o *GetCORSConfigParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationOrganizationID(locationOrganizationID string) *GetCORSConfigParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationProjectID(locationProjectID string) *GetCORSConfigParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationRegionProvider(locationRegionProvider *string) *GetCORSConfigParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationRegionRegion(locationRegionRegion *string) *GetCORSConfigParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCORSConfigParams) 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/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_responses.go new file mode 100644 index 00000000..5592a1a0 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_c_o_r_s_config_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/preview/2020-04-20/models" +) + +// GetCORSConfigReader is a Reader for the GetCORSConfig structure. +type GetCORSConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCORSConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCORSConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetCORSConfigDefault(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 + } +} + +// NewGetCORSConfigOK creates a GetCORSConfigOK with default headers values +func NewGetCORSConfigOK() *GetCORSConfigOK { + return &GetCORSConfigOK{} +} + +/*GetCORSConfigOK handles this case with default header values. + +A successful response. +*/ +type GetCORSConfigOK struct { + Payload *models.HashicorpCloudVault20200420GetCORSConfigResponse +} + +func (o *GetCORSConfigOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config][%d] getCORSConfigOK %+v", 200, o.Payload) +} + +func (o *GetCORSConfigOK) GetPayload() *models.HashicorpCloudVault20200420GetCORSConfigResponse { + return o.Payload +} + +func (o *GetCORSConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420GetCORSConfigResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCORSConfigDefault creates a GetCORSConfigDefault with default headers values +func NewGetCORSConfigDefault(code int) *GetCORSConfigDefault { + return &GetCORSConfigDefault{ + _statusCode: code, + } +} + +/*GetCORSConfigDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetCORSConfigDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get c o r s config default response +func (o *GetCORSConfigDefault) Code() int { + return o._statusCode +} + +func (o *GetCORSConfigDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config][%d] GetCORSConfig default %+v", o._statusCode, o.Payload) +} + +func (o *GetCORSConfigDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetCORSConfigDefault) 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/preview/2020-04-20/client/vault_service/get_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_parameters.go new file mode 100644 index 00000000..db0ce6f1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_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" +) + +// NewGetParams creates a new GetParams object +// with the default values initialized. +func NewGetParams() *GetParams { + var () + return &GetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetParamsWithTimeout creates a new GetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { + var () + return &GetParams{ + + timeout: timeout, + } +} + +// NewGetParamsWithContext creates a new GetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetParamsWithContext(ctx context.Context) *GetParams { + var () + return &GetParams{ + + Context: ctx, + } +} + +// NewGetParamsWithHTTPClient creates a new GetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { + var () + return &GetParams{ + HTTPClient: client, + } +} + +/*GetParams contains all the parameters to send to the API endpoint +for the get operation typically these are written to a http.Request +*/ +type GetParams 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 params +func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get params +func (o *GetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get params +func (o *GetParams) WithContext(ctx context.Context) *GetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get params +func (o *GetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get params +func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get params +func (o *GetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get params +func (o *GetParams) WithClusterID(clusterID string) *GetParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get params +func (o *GetParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get params +func (o *GetParams) WithLocationOrganizationID(locationOrganizationID string) *GetParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get params +func (o *GetParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get params +func (o *GetParams) WithLocationProjectID(locationProjectID string) *GetParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get params +func (o *GetParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get params +func (o *GetParams) WithLocationRegionProvider(locationRegionProvider *string) *GetParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get params +func (o *GetParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get params +func (o *GetParams) WithLocationRegionRegion(locationRegionRegion *string) *GetParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get params +func (o *GetParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetParams) 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/preview/2020-04-20/client/vault_service/get_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_responses.go new file mode 100644 index 00000000..fbe3af47 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_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/preview/2020-04-20/models" +) + +// GetReader is a Reader for the Get structure. +type GetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetDefault(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 + } +} + +// NewGetOK creates a GetOK with default headers values +func NewGetOK() *GetOK { + return &GetOK{} +} + +/*GetOK handles this case with default header values. + +A successful response. +*/ +type GetOK struct { + Payload *models.HashicorpCloudVault20200420GetResponse +} + +func (o *GetOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] getOK %+v", 200, o.Payload) +} + +func (o *GetOK) GetPayload() *models.HashicorpCloudVault20200420GetResponse { + return o.Payload +} + +func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420GetResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDefault creates a GetDefault with default headers values +func NewGetDefault(code int) *GetDefault { + return &GetDefault{ + _statusCode: code, + } +} + +/*GetDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get default response +func (o *GetDefault) Code() int { + return o._statusCode +} + +func (o *GetDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] Get default %+v", o._statusCode, o.Payload) +} + +func (o *GetDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetDefault) 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/preview/2020-04-20/client/vault_service/get_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_snapshot_parameters.go new file mode 100644 index 00000000..04ba7097 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_snapshot_parameters.go @@ -0,0 +1,241 @@ +// 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" +) + +// NewGetSnapshotParams creates a new GetSnapshotParams object +// with the default values initialized. +func NewGetSnapshotParams() *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSnapshotParamsWithTimeout creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSnapshotParamsWithTimeout(timeout time.Duration) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + timeout: timeout, + } +} + +// NewGetSnapshotParamsWithContext creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSnapshotParamsWithContext(ctx context.Context) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + Context: ctx, + } +} + +// NewGetSnapshotParamsWithHTTPClient creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSnapshotParamsWithHTTPClient(client *http.Client) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + HTTPClient: client, + } +} + +/*GetSnapshotParams contains all the parameters to send to the API endpoint +for the get snapshot operation typically these are written to a http.Request +*/ +type GetSnapshotParams struct { + + /*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 + /*SnapshotID + snapshot_id represents the snapshot to get. + + */ + SnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get snapshot params +func (o *GetSnapshotParams) WithTimeout(timeout time.Duration) *GetSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get snapshot params +func (o *GetSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get snapshot params +func (o *GetSnapshotParams) WithContext(ctx context.Context) *GetSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get snapshot params +func (o *GetSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get snapshot params +func (o *GetSnapshotParams) WithHTTPClient(client *http.Client) *GetSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get snapshot params +func (o *GetSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get snapshot params +func (o *GetSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *GetSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get snapshot params +func (o *GetSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get snapshot params +func (o *GetSnapshotParams) WithLocationProjectID(locationProjectID string) *GetSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get snapshot params +func (o *GetSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get snapshot params +func (o *GetSnapshotParams) WithLocationRegionProvider(locationRegionProvider *string) *GetSnapshotParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get snapshot params +func (o *GetSnapshotParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get snapshot params +func (o *GetSnapshotParams) WithLocationRegionRegion(locationRegionRegion *string) *GetSnapshotParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get snapshot params +func (o *GetSnapshotParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSnapshotID adds the snapshotID to the get snapshot params +func (o *GetSnapshotParams) WithSnapshotID(snapshotID string) *GetSnapshotParams { + o.SetSnapshotID(snapshotID) + return o +} + +// SetSnapshotID adds the snapshotId to the get snapshot params +func (o *GetSnapshotParams) SetSnapshotID(snapshotID string) { + o.SnapshotID = snapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 + } + } + + } + + // path param snapshot_id + if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_snapshot_responses.go new file mode 100644 index 00000000..b44908af --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/get_snapshot_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/preview/2020-04-20/models" +) + +// GetSnapshotReader is a Reader for the GetSnapshot structure. +type GetSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetSnapshotDefault(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 + } +} + +// NewGetSnapshotOK creates a GetSnapshotOK with default headers values +func NewGetSnapshotOK() *GetSnapshotOK { + return &GetSnapshotOK{} +} + +/*GetSnapshotOK handles this case with default header values. + +A successful response. +*/ +type GetSnapshotOK struct { + Payload *models.HashicorpCloudVault20200420GetSnapshotResponse +} + +func (o *GetSnapshotOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] getSnapshotOK %+v", 200, o.Payload) +} + +func (o *GetSnapshotOK) GetPayload() *models.HashicorpCloudVault20200420GetSnapshotResponse { + return o.Payload +} + +func (o *GetSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420GetSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSnapshotDefault creates a GetSnapshotDefault with default headers values +func NewGetSnapshotDefault(code int) *GetSnapshotDefault { + return &GetSnapshotDefault{ + _statusCode: code, + } +} + +/*GetSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get snapshot default response +func (o *GetSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *GetSnapshotDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] GetSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *GetSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetSnapshotDefault) 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/preview/2020-04-20/client/vault_service/list_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_parameters.go new file mode 100644 index 00000000..90c2f185 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_parameters.go @@ -0,0 +1,324 @@ +// 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/go-openapi/swag" +) + +// NewListParams creates a new ListParams object +// with the default values initialized. +func NewListParams() *ListParams { + var () + return &ListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListParamsWithTimeout creates a new ListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListParamsWithTimeout(timeout time.Duration) *ListParams { + var () + return &ListParams{ + + timeout: timeout, + } +} + +// NewListParamsWithContext creates a new ListParams object +// with the default values initialized, and the ability to set a context for a request +func NewListParamsWithContext(ctx context.Context) *ListParams { + var () + return &ListParams{ + + Context: ctx, + } +} + +// NewListParamsWithHTTPClient creates a new ListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListParamsWithHTTPClient(client *http.Client) *ListParams { + var () + return &ListParams{ + HTTPClient: client, + } +} + +/*ListParams contains all the parameters to send to the API endpoint +for the list operation typically these are written to a http.Request +*/ +type ListParams struct { + + /*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 + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list params +func (o *ListParams) WithTimeout(timeout time.Duration) *ListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list params +func (o *ListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list params +func (o *ListParams) WithContext(ctx context.Context) *ListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list params +func (o *ListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list params +func (o *ListParams) WithHTTPClient(client *http.Client) *ListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list params +func (o *ListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the list params +func (o *ListParams) WithLocationOrganizationID(locationOrganizationID string) *ListParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the list params +func (o *ListParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the list params +func (o *ListParams) WithLocationProjectID(locationProjectID string) *ListParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the list params +func (o *ListParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the list params +func (o *ListParams) WithLocationRegionProvider(locationRegionProvider *string) *ListParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the list params +func (o *ListParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the list params +func (o *ListParams) WithLocationRegionRegion(locationRegionRegion *string) *ListParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the list params +func (o *ListParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list params +func (o *ListParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list params +func (o *ListParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list params +func (o *ListParams) WithPaginationPageSize(paginationPageSize *int64) *ListParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list params +func (o *ListParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list params +func (o *ListParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list params +func (o *ListParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WriteToRequest writes these params to a swagger request +func (o *ListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_responses.go new file mode 100644 index 00000000..d9666fda --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_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/preview/2020-04-20/models" +) + +// ListReader is a Reader for the List structure. +type ListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListDefault(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 + } +} + +// NewListOK creates a ListOK with default headers values +func NewListOK() *ListOK { + return &ListOK{} +} + +/*ListOK handles this case with default header values. + +A successful response. +*/ +type ListOK struct { + Payload *models.HashicorpCloudVault20200420ListResponse +} + +func (o *ListOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters][%d] listOK %+v", 200, o.Payload) +} + +func (o *ListOK) GetPayload() *models.HashicorpCloudVault20200420ListResponse { + return o.Payload +} + +func (o *ListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420ListResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListDefault creates a ListDefault with default headers values +func NewListDefault(code int) *ListDefault { + return &ListDefault{ + _statusCode: code, + } +} + +/*ListDefault handles this case with default header values. + +An unexpected error response. +*/ +type ListDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the list default response +func (o *ListDefault) Code() int { + return o._statusCode +} + +func (o *ListDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters][%d] List default %+v", o._statusCode, o.Payload) +} + +func (o *ListDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *ListDefault) 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/preview/2020-04-20/client/vault_service/list_snapshots_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_snapshots_parameters.go new file mode 100644 index 00000000..a80b180e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_snapshots_parameters.go @@ -0,0 +1,456 @@ +// 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/go-openapi/swag" +) + +// NewListSnapshotsParams creates a new ListSnapshotsParams object +// with the default values initialized. +func NewListSnapshotsParams() *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListSnapshotsParamsWithTimeout creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListSnapshotsParamsWithTimeout(timeout time.Duration) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + timeout: timeout, + } +} + +// NewListSnapshotsParamsWithContext creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListSnapshotsParamsWithContext(ctx context.Context) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + Context: ctx, + } +} + +// NewListSnapshotsParamsWithHTTPClient creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListSnapshotsParamsWithHTTPClient(client *http.Client) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + HTTPClient: client, + } +} + +/*ListSnapshotsParams contains all the parameters to send to the API endpoint +for the list snapshots operation typically these are written to a http.Request +*/ +type ListSnapshotsParams struct { + + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*ResourceDescription + description is a human-friendly description for this link. This is + used primarily for informational purposes such as error messages. + + */ + ResourceDescription *string + /*ResourceID + id is the identifier for this resource. + + */ + ResourceID *string + /*ResourceLocationOrganizationID + organization_id is the id of the organization. + + */ + ResourceLocationOrganizationID string + /*ResourceLocationProjectID + project_id is the projects id. + + */ + ResourceLocationProjectID string + /*ResourceLocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + ResourceLocationRegionProvider *string + /*ResourceLocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + ResourceLocationRegionRegion *string + /*ResourceType + type is the unique type of the resource. Each service publishes a + unique set of types. The type value is recommended to be formatted + in "." such as "hashicorp.hvn". This is to prevent conflicts + in the future, but any string value will work. + + */ + ResourceType *string + /*ResourceUUID + uuid is the unique UUID for this resource. + + */ + ResourceUUID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list snapshots params +func (o *ListSnapshotsParams) WithTimeout(timeout time.Duration) *ListSnapshotsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list snapshots params +func (o *ListSnapshotsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list snapshots params +func (o *ListSnapshotsParams) WithContext(ctx context.Context) *ListSnapshotsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list snapshots params +func (o *ListSnapshotsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list snapshots params +func (o *ListSnapshotsParams) WithHTTPClient(client *http.Client) *ListSnapshotsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list snapshots params +func (o *ListSnapshotsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListSnapshotsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationPageSize(paginationPageSize *int64) *ListSnapshotsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListSnapshotsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithResourceDescription adds the resourceDescription to the list snapshots params +func (o *ListSnapshotsParams) WithResourceDescription(resourceDescription *string) *ListSnapshotsParams { + o.SetResourceDescription(resourceDescription) + return o +} + +// SetResourceDescription adds the resourceDescription to the list snapshots params +func (o *ListSnapshotsParams) SetResourceDescription(resourceDescription *string) { + o.ResourceDescription = resourceDescription +} + +// WithResourceID adds the resourceID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceID(resourceID *string) *ListSnapshotsParams { + o.SetResourceID(resourceID) + return o +} + +// SetResourceID adds the resourceId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceID(resourceID *string) { + o.ResourceID = resourceID +} + +// WithResourceLocationOrganizationID adds the resourceLocationOrganizationID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationOrganizationID(resourceLocationOrganizationID string) *ListSnapshotsParams { + o.SetResourceLocationOrganizationID(resourceLocationOrganizationID) + return o +} + +// SetResourceLocationOrganizationID adds the resourceLocationOrganizationId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationOrganizationID(resourceLocationOrganizationID string) { + o.ResourceLocationOrganizationID = resourceLocationOrganizationID +} + +// WithResourceLocationProjectID adds the resourceLocationProjectID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationProjectID(resourceLocationProjectID string) *ListSnapshotsParams { + o.SetResourceLocationProjectID(resourceLocationProjectID) + return o +} + +// SetResourceLocationProjectID adds the resourceLocationProjectId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationProjectID(resourceLocationProjectID string) { + o.ResourceLocationProjectID = resourceLocationProjectID +} + +// WithResourceLocationRegionProvider adds the resourceLocationRegionProvider to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationRegionProvider(resourceLocationRegionProvider *string) *ListSnapshotsParams { + o.SetResourceLocationRegionProvider(resourceLocationRegionProvider) + return o +} + +// SetResourceLocationRegionProvider adds the resourceLocationRegionProvider to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationRegionProvider(resourceLocationRegionProvider *string) { + o.ResourceLocationRegionProvider = resourceLocationRegionProvider +} + +// WithResourceLocationRegionRegion adds the resourceLocationRegionRegion to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationRegionRegion(resourceLocationRegionRegion *string) *ListSnapshotsParams { + o.SetResourceLocationRegionRegion(resourceLocationRegionRegion) + return o +} + +// SetResourceLocationRegionRegion adds the resourceLocationRegionRegion to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationRegionRegion(resourceLocationRegionRegion *string) { + o.ResourceLocationRegionRegion = resourceLocationRegionRegion +} + +// WithResourceType adds the resourceType to the list snapshots params +func (o *ListSnapshotsParams) WithResourceType(resourceType *string) *ListSnapshotsParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the list snapshots params +func (o *ListSnapshotsParams) SetResourceType(resourceType *string) { + o.ResourceType = resourceType +} + +// WithResourceUUID adds the resourceUUID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceUUID(resourceUUID *string) *ListSnapshotsParams { + o.SetResourceUUID(resourceUUID) + return o +} + +// SetResourceUUID adds the resourceUuid to the list snapshots params +func (o *ListSnapshotsParams) SetResourceUUID(resourceUUID *string) { + o.ResourceUUID = resourceUUID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if o.ResourceDescription != nil { + + // query param resource.description + var qrResourceDescription string + if o.ResourceDescription != nil { + qrResourceDescription = *o.ResourceDescription + } + qResourceDescription := qrResourceDescription + if qResourceDescription != "" { + if err := r.SetQueryParam("resource.description", qResourceDescription); err != nil { + return err + } + } + + } + + if o.ResourceID != nil { + + // query param resource.id + var qrResourceID string + if o.ResourceID != nil { + qrResourceID = *o.ResourceID + } + qResourceID := qrResourceID + if qResourceID != "" { + if err := r.SetQueryParam("resource.id", qResourceID); err != nil { + return err + } + } + + } + + // path param resource.location.organization_id + if err := r.SetPathParam("resource.location.organization_id", o.ResourceLocationOrganizationID); err != nil { + return err + } + + // path param resource.location.project_id + if err := r.SetPathParam("resource.location.project_id", o.ResourceLocationProjectID); err != nil { + return err + } + + if o.ResourceLocationRegionProvider != nil { + + // query param resource.location.region.provider + var qrResourceLocationRegionProvider string + if o.ResourceLocationRegionProvider != nil { + qrResourceLocationRegionProvider = *o.ResourceLocationRegionProvider + } + qResourceLocationRegionProvider := qrResourceLocationRegionProvider + if qResourceLocationRegionProvider != "" { + if err := r.SetQueryParam("resource.location.region.provider", qResourceLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.ResourceLocationRegionRegion != nil { + + // query param resource.location.region.region + var qrResourceLocationRegionRegion string + if o.ResourceLocationRegionRegion != nil { + qrResourceLocationRegionRegion = *o.ResourceLocationRegionRegion + } + qResourceLocationRegionRegion := qrResourceLocationRegionRegion + if qResourceLocationRegionRegion != "" { + if err := r.SetQueryParam("resource.location.region.region", qResourceLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.ResourceType != nil { + + // query param resource.type + var qrResourceType string + if o.ResourceType != nil { + qrResourceType = *o.ResourceType + } + qResourceType := qrResourceType + if qResourceType != "" { + if err := r.SetQueryParam("resource.type", qResourceType); err != nil { + return err + } + } + + } + + if o.ResourceUUID != nil { + + // query param resource.uuid + var qrResourceUUID string + if o.ResourceUUID != nil { + qrResourceUUID = *o.ResourceUUID + } + qResourceUUID := qrResourceUUID + if qResourceUUID != "" { + if err := r.SetQueryParam("resource.uuid", qResourceUUID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_snapshots_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_snapshots_responses.go new file mode 100644 index 00000000..3f626eff --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/list_snapshots_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/preview/2020-04-20/models" +) + +// ListSnapshotsReader is a Reader for the ListSnapshots structure. +type ListSnapshotsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSnapshotsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSnapshotsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListSnapshotsDefault(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 + } +} + +// NewListSnapshotsOK creates a ListSnapshotsOK with default headers values +func NewListSnapshotsOK() *ListSnapshotsOK { + return &ListSnapshotsOK{} +} + +/*ListSnapshotsOK handles this case with default header values. + +A successful response. +*/ +type ListSnapshotsOK struct { + Payload *models.HashicorpCloudVault20200420ListSnapshotsResponse +} + +func (o *ListSnapshotsOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] listSnapshotsOK %+v", 200, o.Payload) +} + +func (o *ListSnapshotsOK) GetPayload() *models.HashicorpCloudVault20200420ListSnapshotsResponse { + return o.Payload +} + +func (o *ListSnapshotsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420ListSnapshotsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListSnapshotsDefault creates a ListSnapshotsDefault with default headers values +func NewListSnapshotsDefault(code int) *ListSnapshotsDefault { + return &ListSnapshotsDefault{ + _statusCode: code, + } +} + +/*ListSnapshotsDefault handles this case with default header values. + +An unexpected error response. +*/ +type ListSnapshotsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the list snapshots default response +func (o *ListSnapshotsDefault) Code() int { + return o._statusCode +} + +func (o *ListSnapshotsDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] ListSnapshots default %+v", o._statusCode, o.Payload) +} + +func (o *ListSnapshotsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *ListSnapshotsDefault) 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/preview/2020-04-20/client/vault_service/restore_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/restore_snapshot_parameters.go new file mode 100644 index 00000000..a11982a7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/restore_snapshot_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/preview/2020-04-20/models" +) + +// NewRestoreSnapshotParams creates a new RestoreSnapshotParams object +// with the default values initialized. +func NewRestoreSnapshotParams() *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRestoreSnapshotParamsWithTimeout creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRestoreSnapshotParamsWithTimeout(timeout time.Duration) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + timeout: timeout, + } +} + +// NewRestoreSnapshotParamsWithContext creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewRestoreSnapshotParamsWithContext(ctx context.Context) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + Context: ctx, + } +} + +// NewRestoreSnapshotParamsWithHTTPClient creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRestoreSnapshotParamsWithHTTPClient(client *http.Client) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + HTTPClient: client, + } +} + +/*RestoreSnapshotParams contains all the parameters to send to the API endpoint +for the restore snapshot operation typically these are written to a http.Request +*/ +type RestoreSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420RestoreSnapshotRequest + /*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 restore snapshot params +func (o *RestoreSnapshotParams) WithTimeout(timeout time.Duration) *RestoreSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restore snapshot params +func (o *RestoreSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restore snapshot params +func (o *RestoreSnapshotParams) WithContext(ctx context.Context) *RestoreSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restore snapshot params +func (o *RestoreSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restore snapshot params +func (o *RestoreSnapshotParams) WithHTTPClient(client *http.Client) *RestoreSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restore snapshot params +func (o *RestoreSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the restore snapshot params +func (o *RestoreSnapshotParams) WithBody(body *models.HashicorpCloudVault20200420RestoreSnapshotRequest) *RestoreSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the restore snapshot params +func (o *RestoreSnapshotParams) SetBody(body *models.HashicorpCloudVault20200420RestoreSnapshotRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the restore snapshot params +func (o *RestoreSnapshotParams) WithClusterID(clusterID string) *RestoreSnapshotParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the restore snapshot params +func (o *RestoreSnapshotParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the restore snapshot params +func (o *RestoreSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *RestoreSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the restore snapshot params +func (o *RestoreSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the restore snapshot params +func (o *RestoreSnapshotParams) WithLocationProjectID(locationProjectID string) *RestoreSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the restore snapshot params +func (o *RestoreSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *RestoreSnapshotParams) 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/preview/2020-04-20/client/vault_service/restore_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/restore_snapshot_responses.go new file mode 100644 index 00000000..6ba1bde2 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/restore_snapshot_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/preview/2020-04-20/models" +) + +// RestoreSnapshotReader is a Reader for the RestoreSnapshot structure. +type RestoreSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestoreSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestoreSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRestoreSnapshotDefault(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 + } +} + +// NewRestoreSnapshotOK creates a RestoreSnapshotOK with default headers values +func NewRestoreSnapshotOK() *RestoreSnapshotOK { + return &RestoreSnapshotOK{} +} + +/*RestoreSnapshotOK handles this case with default header values. + +A successful response. +*/ +type RestoreSnapshotOK struct { + Payload *models.HashicorpCloudVault20200420RestoreSnapshotResponse +} + +func (o *RestoreSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore][%d] restoreSnapshotOK %+v", 200, o.Payload) +} + +func (o *RestoreSnapshotOK) GetPayload() *models.HashicorpCloudVault20200420RestoreSnapshotResponse { + return o.Payload +} + +func (o *RestoreSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420RestoreSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRestoreSnapshotDefault creates a RestoreSnapshotDefault with default headers values +func NewRestoreSnapshotDefault(code int) *RestoreSnapshotDefault { + return &RestoreSnapshotDefault{ + _statusCode: code, + } +} + +/*RestoreSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type RestoreSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the restore snapshot default response +func (o *RestoreSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *RestoreSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore][%d] RestoreSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *RestoreSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *RestoreSnapshotDefault) 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/preview/2020-04-20/client/vault_service/seal_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/seal_parameters.go new file mode 100644 index 00000000..69b0027d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/seal_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/preview/2020-04-20/models" +) + +// NewSealParams creates a new SealParams object +// with the default values initialized. +func NewSealParams() *SealParams { + var () + return &SealParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSealParamsWithTimeout creates a new SealParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSealParamsWithTimeout(timeout time.Duration) *SealParams { + var () + return &SealParams{ + + timeout: timeout, + } +} + +// NewSealParamsWithContext creates a new SealParams object +// with the default values initialized, and the ability to set a context for a request +func NewSealParamsWithContext(ctx context.Context) *SealParams { + var () + return &SealParams{ + + Context: ctx, + } +} + +// NewSealParamsWithHTTPClient creates a new SealParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSealParamsWithHTTPClient(client *http.Client) *SealParams { + var () + return &SealParams{ + HTTPClient: client, + } +} + +/*SealParams contains all the parameters to send to the API endpoint +for the seal operation typically these are written to a http.Request +*/ +type SealParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420SealRequest + /*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 seal params +func (o *SealParams) WithTimeout(timeout time.Duration) *SealParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the seal params +func (o *SealParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the seal params +func (o *SealParams) WithContext(ctx context.Context) *SealParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the seal params +func (o *SealParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the seal params +func (o *SealParams) WithHTTPClient(client *http.Client) *SealParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the seal params +func (o *SealParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the seal params +func (o *SealParams) WithBody(body *models.HashicorpCloudVault20200420SealRequest) *SealParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the seal params +func (o *SealParams) SetBody(body *models.HashicorpCloudVault20200420SealRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the seal params +func (o *SealParams) WithClusterID(clusterID string) *SealParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the seal params +func (o *SealParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the seal params +func (o *SealParams) WithLocationOrganizationID(locationOrganizationID string) *SealParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the seal params +func (o *SealParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the seal params +func (o *SealParams) WithLocationProjectID(locationProjectID string) *SealParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the seal params +func (o *SealParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *SealParams) 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/preview/2020-04-20/client/vault_service/seal_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/seal_responses.go new file mode 100644 index 00000000..dac39e19 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/seal_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/preview/2020-04-20/models" +) + +// SealReader is a Reader for the Seal structure. +type SealReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SealReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSealOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSealDefault(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 + } +} + +// NewSealOK creates a SealOK with default headers values +func NewSealOK() *SealOK { + return &SealOK{} +} + +/*SealOK handles this case with default header values. + +A successful response. +*/ +type SealOK struct { + Payload *models.HashicorpCloudVault20200420SealResponse +} + +func (o *SealOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal][%d] sealOK %+v", 200, o.Payload) +} + +func (o *SealOK) GetPayload() *models.HashicorpCloudVault20200420SealResponse { + return o.Payload +} + +func (o *SealOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420SealResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSealDefault creates a SealDefault with default headers values +func NewSealDefault(code int) *SealDefault { + return &SealDefault{ + _statusCode: code, + } +} + +/*SealDefault handles this case with default header values. + +An unexpected error response. +*/ +type SealDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the seal default response +func (o *SealDefault) Code() int { + return o._statusCode +} + +func (o *SealDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal][%d] Seal default %+v", o._statusCode, o.Payload) +} + +func (o *SealDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *SealDefault) 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/preview/2020-04-20/client/vault_service/unseal_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/unseal_parameters.go new file mode 100644 index 00000000..463876d2 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/unseal_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/preview/2020-04-20/models" +) + +// NewUnsealParams creates a new UnsealParams object +// with the default values initialized. +func NewUnsealParams() *UnsealParams { + var () + return &UnsealParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUnsealParamsWithTimeout creates a new UnsealParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUnsealParamsWithTimeout(timeout time.Duration) *UnsealParams { + var () + return &UnsealParams{ + + timeout: timeout, + } +} + +// NewUnsealParamsWithContext creates a new UnsealParams object +// with the default values initialized, and the ability to set a context for a request +func NewUnsealParamsWithContext(ctx context.Context) *UnsealParams { + var () + return &UnsealParams{ + + Context: ctx, + } +} + +// NewUnsealParamsWithHTTPClient creates a new UnsealParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUnsealParamsWithHTTPClient(client *http.Client) *UnsealParams { + var () + return &UnsealParams{ + HTTPClient: client, + } +} + +/*UnsealParams contains all the parameters to send to the API endpoint +for the unseal operation typically these are written to a http.Request +*/ +type UnsealParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420UnsealRequest + /*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 unseal params +func (o *UnsealParams) WithTimeout(timeout time.Duration) *UnsealParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the unseal params +func (o *UnsealParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the unseal params +func (o *UnsealParams) WithContext(ctx context.Context) *UnsealParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the unseal params +func (o *UnsealParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the unseal params +func (o *UnsealParams) WithHTTPClient(client *http.Client) *UnsealParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the unseal params +func (o *UnsealParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the unseal params +func (o *UnsealParams) WithBody(body *models.HashicorpCloudVault20200420UnsealRequest) *UnsealParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the unseal params +func (o *UnsealParams) SetBody(body *models.HashicorpCloudVault20200420UnsealRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the unseal params +func (o *UnsealParams) WithClusterID(clusterID string) *UnsealParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the unseal params +func (o *UnsealParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the unseal params +func (o *UnsealParams) WithLocationOrganizationID(locationOrganizationID string) *UnsealParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the unseal params +func (o *UnsealParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the unseal params +func (o *UnsealParams) WithLocationProjectID(locationProjectID string) *UnsealParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the unseal params +func (o *UnsealParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UnsealParams) 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/preview/2020-04-20/client/vault_service/unseal_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/unseal_responses.go new file mode 100644 index 00000000..24feca13 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/unseal_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/preview/2020-04-20/models" +) + +// UnsealReader is a Reader for the Unseal structure. +type UnsealReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UnsealReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUnsealOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUnsealDefault(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 + } +} + +// NewUnsealOK creates a UnsealOK with default headers values +func NewUnsealOK() *UnsealOK { + return &UnsealOK{} +} + +/*UnsealOK handles this case with default header values. + +A successful response. +*/ +type UnsealOK struct { + Payload *models.HashicorpCloudVault20200420UnsealResponse +} + +func (o *UnsealOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal][%d] unsealOK %+v", 200, o.Payload) +} + +func (o *UnsealOK) GetPayload() *models.HashicorpCloudVault20200420UnsealResponse { + return o.Payload +} + +func (o *UnsealOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420UnsealResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUnsealDefault creates a UnsealDefault with default headers values +func NewUnsealDefault(code int) *UnsealDefault { + return &UnsealDefault{ + _statusCode: code, + } +} + +/*UnsealDefault handles this case with default header values. + +An unexpected error response. +*/ +type UnsealDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the unseal default response +func (o *UnsealDefault) Code() int { + return o._statusCode +} + +func (o *UnsealDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal][%d] Unseal default %+v", o._statusCode, o.Payload) +} + +func (o *UnsealDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UnsealDefault) 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/preview/2020-04-20/client/vault_service/update_c_o_r_s_config_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_c_o_r_s_config_parameters.go new file mode 100644 index 00000000..f78ae3ec --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_c_o_r_s_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/preview/2020-04-20/models" +) + +// NewUpdateCORSConfigParams creates a new UpdateCORSConfigParams object +// with the default values initialized. +func NewUpdateCORSConfigParams() *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateCORSConfigParamsWithTimeout creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateCORSConfigParamsWithTimeout(timeout time.Duration) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + timeout: timeout, + } +} + +// NewUpdateCORSConfigParamsWithContext creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateCORSConfigParamsWithContext(ctx context.Context) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + Context: ctx, + } +} + +// NewUpdateCORSConfigParamsWithHTTPClient creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateCORSConfigParamsWithHTTPClient(client *http.Client) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + HTTPClient: client, + } +} + +/*UpdateCORSConfigParams contains all the parameters to send to the API endpoint +for the update c o r s config operation typically these are written to a http.Request +*/ +type UpdateCORSConfigParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420UpdateCORSConfigRequest + /*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 c o r s config params +func (o *UpdateCORSConfigParams) WithTimeout(timeout time.Duration) *UpdateCORSConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update c o r s config params +func (o *UpdateCORSConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update c o r s config params +func (o *UpdateCORSConfigParams) WithContext(ctx context.Context) *UpdateCORSConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update c o r s config params +func (o *UpdateCORSConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update c o r s config params +func (o *UpdateCORSConfigParams) WithHTTPClient(client *http.Client) *UpdateCORSConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update c o r s config params +func (o *UpdateCORSConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update c o r s config params +func (o *UpdateCORSConfigParams) WithBody(body *models.HashicorpCloudVault20200420UpdateCORSConfigRequest) *UpdateCORSConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update c o r s config params +func (o *UpdateCORSConfigParams) SetBody(body *models.HashicorpCloudVault20200420UpdateCORSConfigRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithClusterID(clusterID string) *UpdateCORSConfigParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithLocationOrganizationID(locationOrganizationID string) *UpdateCORSConfigParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithLocationProjectID(locationProjectID string) *UpdateCORSConfigParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateCORSConfigParams) 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/preview/2020-04-20/client/vault_service/update_c_o_r_s_config_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_c_o_r_s_config_responses.go new file mode 100644 index 00000000..6644addf --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_c_o_r_s_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/preview/2020-04-20/models" +) + +// UpdateCORSConfigReader is a Reader for the UpdateCORSConfig structure. +type UpdateCORSConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateCORSConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateCORSConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateCORSConfigDefault(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 + } +} + +// NewUpdateCORSConfigOK creates a UpdateCORSConfigOK with default headers values +func NewUpdateCORSConfigOK() *UpdateCORSConfigOK { + return &UpdateCORSConfigOK{} +} + +/*UpdateCORSConfigOK handles this case with default header values. + +A successful response. +*/ +type UpdateCORSConfigOK struct { + Payload models.HashicorpCloudVault20200420UpdateCORSConfigResponse +} + +func (o *UpdateCORSConfigOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config][%d] updateCORSConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateCORSConfigOK) GetPayload() models.HashicorpCloudVault20200420UpdateCORSConfigResponse { + return o.Payload +} + +func (o *UpdateCORSConfigOK) 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 +} + +// NewUpdateCORSConfigDefault creates a UpdateCORSConfigDefault with default headers values +func NewUpdateCORSConfigDefault(code int) *UpdateCORSConfigDefault { + return &UpdateCORSConfigDefault{ + _statusCode: code, + } +} + +/*UpdateCORSConfigDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdateCORSConfigDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update c o r s config default response +func (o *UpdateCORSConfigDefault) Code() int { + return o._statusCode +} + +func (o *UpdateCORSConfigDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config][%d] UpdateCORSConfig default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateCORSConfigDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdateCORSConfigDefault) 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/preview/2020-04-20/client/vault_service/update_public_ips_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_public_ips_parameters.go new file mode 100644 index 00000000..ff9dbbb5 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_public_ips_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/preview/2020-04-20/models" +) + +// NewUpdatePublicIpsParams creates a new UpdatePublicIpsParams object +// with the default values initialized. +func NewUpdatePublicIpsParams() *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePublicIpsParamsWithTimeout creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdatePublicIpsParamsWithTimeout(timeout time.Duration) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + timeout: timeout, + } +} + +// NewUpdatePublicIpsParamsWithContext creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdatePublicIpsParamsWithContext(ctx context.Context) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + Context: ctx, + } +} + +// NewUpdatePublicIpsParamsWithHTTPClient creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdatePublicIpsParamsWithHTTPClient(client *http.Client) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + HTTPClient: client, + } +} + +/*UpdatePublicIpsParams contains all the parameters to send to the API endpoint +for the update public ips operation typically these are written to a http.Request +*/ +type UpdatePublicIpsParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420UpdatePublicIpsRequest + /*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 public ips params +func (o *UpdatePublicIpsParams) WithTimeout(timeout time.Duration) *UpdatePublicIpsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update public ips params +func (o *UpdatePublicIpsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update public ips params +func (o *UpdatePublicIpsParams) WithContext(ctx context.Context) *UpdatePublicIpsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update public ips params +func (o *UpdatePublicIpsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update public ips params +func (o *UpdatePublicIpsParams) WithHTTPClient(client *http.Client) *UpdatePublicIpsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update public ips params +func (o *UpdatePublicIpsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update public ips params +func (o *UpdatePublicIpsParams) WithBody(body *models.HashicorpCloudVault20200420UpdatePublicIpsRequest) *UpdatePublicIpsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update public ips params +func (o *UpdatePublicIpsParams) SetBody(body *models.HashicorpCloudVault20200420UpdatePublicIpsRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the update public ips params +func (o *UpdatePublicIpsParams) WithClusterID(clusterID string) *UpdatePublicIpsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the update public ips params +func (o *UpdatePublicIpsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the update public ips params +func (o *UpdatePublicIpsParams) WithLocationOrganizationID(locationOrganizationID string) *UpdatePublicIpsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the update public ips params +func (o *UpdatePublicIpsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the update public ips params +func (o *UpdatePublicIpsParams) WithLocationProjectID(locationProjectID string) *UpdatePublicIpsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the update public ips params +func (o *UpdatePublicIpsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePublicIpsParams) 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/preview/2020-04-20/client/vault_service/update_public_ips_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_public_ips_responses.go new file mode 100644 index 00000000..f67bf835 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_public_ips_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/preview/2020-04-20/models" +) + +// UpdatePublicIpsReader is a Reader for the UpdatePublicIps structure. +type UpdatePublicIpsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePublicIpsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePublicIpsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdatePublicIpsDefault(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 + } +} + +// NewUpdatePublicIpsOK creates a UpdatePublicIpsOK with default headers values +func NewUpdatePublicIpsOK() *UpdatePublicIpsOK { + return &UpdatePublicIpsOK{} +} + +/*UpdatePublicIpsOK handles this case with default header values. + +A successful response. +*/ +type UpdatePublicIpsOK struct { + Payload *models.HashicorpCloudVault20200420UpdatePublicIpsResponse +} + +func (o *UpdatePublicIpsOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips][%d] updatePublicIpsOK %+v", 200, o.Payload) +} + +func (o *UpdatePublicIpsOK) GetPayload() *models.HashicorpCloudVault20200420UpdatePublicIpsResponse { + return o.Payload +} + +func (o *UpdatePublicIpsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420UpdatePublicIpsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePublicIpsDefault creates a UpdatePublicIpsDefault with default headers values +func NewUpdatePublicIpsDefault(code int) *UpdatePublicIpsDefault { + return &UpdatePublicIpsDefault{ + _statusCode: code, + } +} + +/*UpdatePublicIpsDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdatePublicIpsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update public ips default response +func (o *UpdatePublicIpsDefault) Code() int { + return o._statusCode +} + +func (o *UpdatePublicIpsDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips][%d] UpdatePublicIps default %+v", o._statusCode, o.Payload) +} + +func (o *UpdatePublicIpsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdatePublicIpsDefault) 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/preview/2020-04-20/client/vault_service/update_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_snapshot_parameters.go new file mode 100644 index 00000000..cd811552 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_snapshot_parameters.go @@ -0,0 +1,198 @@ +// 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/preview/2020-04-20/models" +) + +// NewUpdateSnapshotParams creates a new UpdateSnapshotParams object +// with the default values initialized. +func NewUpdateSnapshotParams() *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSnapshotParamsWithTimeout creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateSnapshotParamsWithTimeout(timeout time.Duration) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + timeout: timeout, + } +} + +// NewUpdateSnapshotParamsWithContext creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateSnapshotParamsWithContext(ctx context.Context) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + Context: ctx, + } +} + +// NewUpdateSnapshotParamsWithHTTPClient creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateSnapshotParamsWithHTTPClient(client *http.Client) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + HTTPClient: client, + } +} + +/*UpdateSnapshotParams contains all the parameters to send to the API endpoint +for the update snapshot operation typically these are written to a http.Request +*/ +type UpdateSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20200420UpdateSnapshotRequest + /*SnapshotLocationOrganizationID + organization_id is the id of the organization. + + */ + SnapshotLocationOrganizationID string + /*SnapshotLocationProjectID + project_id is the projects id. + + */ + SnapshotLocationProjectID string + /*SnapshotSnapshotID + snapshot_id is the snapshots UUID. + + */ + SnapshotSnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update snapshot params +func (o *UpdateSnapshotParams) WithTimeout(timeout time.Duration) *UpdateSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update snapshot params +func (o *UpdateSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update snapshot params +func (o *UpdateSnapshotParams) WithContext(ctx context.Context) *UpdateSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update snapshot params +func (o *UpdateSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update snapshot params +func (o *UpdateSnapshotParams) WithHTTPClient(client *http.Client) *UpdateSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update snapshot params +func (o *UpdateSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update snapshot params +func (o *UpdateSnapshotParams) WithBody(body *models.HashicorpCloudVault20200420UpdateSnapshotRequest) *UpdateSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update snapshot params +func (o *UpdateSnapshotParams) SetBody(body *models.HashicorpCloudVault20200420UpdateSnapshotRequest) { + o.Body = body +} + +// WithSnapshotLocationOrganizationID adds the snapshotLocationOrganizationID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotLocationOrganizationID(snapshotLocationOrganizationID string) *UpdateSnapshotParams { + o.SetSnapshotLocationOrganizationID(snapshotLocationOrganizationID) + return o +} + +// SetSnapshotLocationOrganizationID adds the snapshotLocationOrganizationId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotLocationOrganizationID(snapshotLocationOrganizationID string) { + o.SnapshotLocationOrganizationID = snapshotLocationOrganizationID +} + +// WithSnapshotLocationProjectID adds the snapshotLocationProjectID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotLocationProjectID(snapshotLocationProjectID string) *UpdateSnapshotParams { + o.SetSnapshotLocationProjectID(snapshotLocationProjectID) + return o +} + +// SetSnapshotLocationProjectID adds the snapshotLocationProjectId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotLocationProjectID(snapshotLocationProjectID string) { + o.SnapshotLocationProjectID = snapshotLocationProjectID +} + +// WithSnapshotSnapshotID adds the snapshotSnapshotID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotSnapshotID(snapshotSnapshotID string) *UpdateSnapshotParams { + o.SetSnapshotSnapshotID(snapshotSnapshotID) + return o +} + +// SetSnapshotSnapshotID adds the snapshotSnapshotId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotSnapshotID(snapshotSnapshotID string) { + o.SnapshotSnapshotID = snapshotSnapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSnapshotParams) 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 snapshot.location.organization_id + if err := r.SetPathParam("snapshot.location.organization_id", o.SnapshotLocationOrganizationID); err != nil { + return err + } + + // path param snapshot.location.project_id + if err := r.SetPathParam("snapshot.location.project_id", o.SnapshotLocationProjectID); err != nil { + return err + } + + // path param snapshot.snapshot_id + if err := r.SetPathParam("snapshot.snapshot_id", o.SnapshotSnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_snapshot_responses.go new file mode 100644 index 00000000..ff035223 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/update_snapshot_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/preview/2020-04-20/models" +) + +// UpdateSnapshotReader is a Reader for the UpdateSnapshot structure. +type UpdateSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateSnapshotDefault(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 + } +} + +// NewUpdateSnapshotOK creates a UpdateSnapshotOK with default headers values +func NewUpdateSnapshotOK() *UpdateSnapshotOK { + return &UpdateSnapshotOK{} +} + +/*UpdateSnapshotOK handles this case with default header values. + +A successful response. +*/ +type UpdateSnapshotOK struct { + Payload *models.HashicorpCloudVault20200420UpdateSnapshotResponse +} + +func (o *UpdateSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}][%d] updateSnapshotOK %+v", 200, o.Payload) +} + +func (o *UpdateSnapshotOK) GetPayload() *models.HashicorpCloudVault20200420UpdateSnapshotResponse { + return o.Payload +} + +func (o *UpdateSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20200420UpdateSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSnapshotDefault creates a UpdateSnapshotDefault with default headers values +func NewUpdateSnapshotDefault(code int) *UpdateSnapshotDefault { + return &UpdateSnapshotDefault{ + _statusCode: code, + } +} + +/*UpdateSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdateSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update snapshot default response +func (o *UpdateSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *UpdateSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-04-20/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}][%d] UpdateSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdateSnapshotDefault) 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/preview/2020-04-20/client/vault_service/vault_service_client.go b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/vault_service_client.go new file mode 100644 index 00000000..70c269da --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/client/vault_service/vault_service_client.go @@ -0,0 +1,718 @@ +// 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 ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new vault service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vault service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + Create(params *CreateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateOK, error) + + CreateSnapshot(params *CreateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateSnapshotOK, error) + + Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) + + DeleteSnapshot(params *DeleteSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSnapshotOK, error) + + DisableCORS(params *DisableCORSParams, authInfo runtime.ClientAuthInfoWriter) (*DisableCORSOK, error) + + FetchAuditLog(params *FetchAuditLogParams, authInfo runtime.ClientAuthInfoWriter) (*FetchAuditLogOK, error) + + Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) + + GetAdminToken(params *GetAdminTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetAdminTokenOK, error) + + GetAuditLogStatus(params *GetAuditLogStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuditLogStatusOK, error) + + GetCORSConfig(params *GetCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*GetCORSConfigOK, error) + + GetSnapshot(params *GetSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*GetSnapshotOK, error) + + List(params *ListParams, authInfo runtime.ClientAuthInfoWriter) (*ListOK, error) + + ListSnapshots(params *ListSnapshotsParams, authInfo runtime.ClientAuthInfoWriter) (*ListSnapshotsOK, error) + + RestoreSnapshot(params *RestoreSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*RestoreSnapshotOK, error) + + Seal(params *SealParams, authInfo runtime.ClientAuthInfoWriter) (*SealOK, error) + + Unseal(params *UnsealParams, authInfo runtime.ClientAuthInfoWriter) (*UnsealOK, error) + + UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCORSConfigOK, error) + + UpdatePublicIps(params *UpdatePublicIpsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePublicIpsOK, error) + + UpdateSnapshot(params *UpdateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateSnapshotOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + Create create API +*/ +func (a *Client) Create(params *CreateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Create", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + CreateSnapshot create snapshot API +*/ +func (a *Client) CreateSnapshot(params *CreateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateSnapshot", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Delete delete API +*/ +func (a *Client) Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Delete", + Method: "DELETE", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + DeleteSnapshot delete snapshot API +*/ +func (a *Client) DeleteSnapshot(params *DeleteSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteSnapshot", + Method: "DELETE", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + DisableCORS disable c o r s API +*/ +func (a *Client) DisableCORS(params *DisableCORSParams, authInfo runtime.ClientAuthInfoWriter) (*DisableCORSOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDisableCORSParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DisableCORS", + Method: "DELETE", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DisableCORSReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DisableCORSOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DisableCORSDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FetchAuditLog fetch audit log API +*/ +func (a *Client) FetchAuditLog(params *FetchAuditLogParams, authInfo runtime.ClientAuthInfoWriter) (*FetchAuditLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFetchAuditLogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FetchAuditLog", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FetchAuditLogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FetchAuditLogOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FetchAuditLogDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Get get API +*/ +func (a *Client) Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Get", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetAdminToken get admin token API +*/ +func (a *Client) GetAdminToken(params *GetAdminTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetAdminTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAdminTokenParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAdminToken", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAdminTokenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAdminTokenOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAdminTokenDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetAuditLogStatus get audit log status API +*/ +func (a *Client) GetAuditLogStatus(params *GetAuditLogStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuditLogStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAuditLogStatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAuditLogStatus", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAuditLogStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAuditLogStatusOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAuditLogStatusDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetCORSConfig get c o r s config API +*/ +func (a *Client) GetCORSConfig(params *GetCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*GetCORSConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCORSConfigParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCORSConfig", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCORSConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCORSConfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetCORSConfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetSnapshot get snapshot API +*/ +func (a *Client) GetSnapshot(params *GetSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*GetSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetSnapshot", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + List list API +*/ +func (a *Client) List(params *ListParams, authInfo runtime.ClientAuthInfoWriter) (*ListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "List", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + ListSnapshots list snapshots API +*/ +func (a *Client) ListSnapshots(params *ListSnapshotsParams, authInfo runtime.ClientAuthInfoWriter) (*ListSnapshotsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListSnapshotsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListSnapshots", + Method: "GET", + PathPattern: "/vault/2020-04-20/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListSnapshotsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListSnapshotsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListSnapshotsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + RestoreSnapshot restore snapshot API +*/ +func (a *Client) RestoreSnapshot(params *RestoreSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*RestoreSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestoreSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RestoreSnapshot", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RestoreSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RestoreSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RestoreSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Seal seal API +*/ +func (a *Client) Seal(params *SealParams, authInfo runtime.ClientAuthInfoWriter) (*SealOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSealParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Seal", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SealReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SealOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SealDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Unseal unseal API +*/ +func (a *Client) Unseal(params *UnsealParams, authInfo runtime.ClientAuthInfoWriter) (*UnsealOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUnsealParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Unseal", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UnsealReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UnsealOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UnsealDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdateCORSConfig update c o r s config API +*/ +func (a *Client) UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCORSConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateCORSConfigParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateCORSConfig", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateCORSConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateCORSConfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateCORSConfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdatePublicIps update public ips API +*/ +func (a *Client) UpdatePublicIps(params *UpdatePublicIpsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePublicIpsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdatePublicIpsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdatePublicIps", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdatePublicIpsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdatePublicIpsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdatePublicIpsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdateSnapshot update snapshot API +*/ +func (a *Client) UpdateSnapshot(params *UpdateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateSnapshot", + Method: "POST", + PathPattern: "/vault/2020-04-20/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateSnapshotDefault) + 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/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_config.go new file mode 100644 index 00000000..44dc007c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420AuditConfig hashicorp cloud vault 20200420 audit config +// +// swagger:model hashicorp.cloud.vault_20200420.AuditConfig +type HashicorpCloudVault20200420AuditConfig struct { + + // audit logs disabled + AuditLogsDisabled bool `json:"audit_logs_disabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 audit config +func (m *HashicorpCloudVault20200420AuditConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420AuditConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420AuditConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420AuditConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log.go new file mode 100644 index 00000000..03a2cd89 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log.go @@ -0,0 +1,189 @@ +// 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" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20200420AuditLog AuditLog represents a request for audit logs to download +// +// swagger:model hashicorp.cloud.vault_20200420.AuditLog +type HashicorpCloudVault20200420AuditLog struct { + + // cluster_id is the cluster id that this download backs + ClusterID string `json:"cluster_id,omitempty"` + + // download_url is the URL which can be used to retrieve the audit logs. + DownloadURL string `json:"download_url,omitempty"` + + // expires_at is the timestamp of when the cluster was first created. + // Format: date-time + ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` + + // finished_at is the timestamp of when the download was ready. + // Format: date-time + FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` + + // id is the id of the audit log download + ID string `json:"id,omitempty"` + + // interval_end + // Format: date-time + IntervalEnd strfmt.DateTime `json:"interval_end,omitempty"` + + // interval_start + // Format: date-time + IntervalStart strfmt.DateTime `json:"interval_start,omitempty"` + + // location is the location of the cluster. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // state is the current state of the download + State HashicorpCloudVault20200420AuditLogState `json:"state,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 audit log +func (m *HashicorpCloudVault20200420AuditLog) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFinishedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420AuditLog) validateExpiresAt(formats strfmt.Registry) error { + + if swag.IsZero(m.ExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("expires_at", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420AuditLog) validateFinishedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.FinishedAt) { // not required + return nil + } + + if err := validate.FormatOf("finished_at", "body", "date-time", m.FinishedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420AuditLog) validateIntervalEnd(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalEnd) { // not required + return nil + } + + if err := validate.FormatOf("interval_end", "body", "date-time", m.IntervalEnd.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420AuditLog) validateIntervalStart(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalStart) { // not required + return nil + } + + if err := validate.FormatOf("interval_start", "body", "date-time", m.IntervalStart.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420AuditLog) 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 *HashicorpCloudVault20200420AuditLog) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420AuditLog) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420AuditLog) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420AuditLog + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log_state.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log_state.go new file mode 100644 index 00000000..134fe0cb --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_audit_log_state.go @@ -0,0 +1,84 @@ +// 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" +) + +// HashicorpCloudVault20200420AuditLogState State is the state of download. +// +// - UNSET: UNSET is a sentinel zero value so that an uninitialized value can be +// detected. +// - PENDING: PENDING is the initial state before the workflow starts. +// - CREATING: CREATING is the state used when the download is being prepared. +// - READY: READY is the completed state when the download is ready +// - FAILED: FAILED is a failure state in which the download is not created +// - EXPIRED: EXPIRED is the state that the download hits when it is no longer +// accessible for download +// +// swagger:model hashicorp.cloud.vault_20200420.AuditLog.State +type HashicorpCloudVault20200420AuditLogState string + +const ( + + // HashicorpCloudVault20200420AuditLogStateUNSET captures enum value "UNSET" + HashicorpCloudVault20200420AuditLogStateUNSET HashicorpCloudVault20200420AuditLogState = "UNSET" + + // HashicorpCloudVault20200420AuditLogStatePENDING captures enum value "PENDING" + HashicorpCloudVault20200420AuditLogStatePENDING HashicorpCloudVault20200420AuditLogState = "PENDING" + + // HashicorpCloudVault20200420AuditLogStateCREATING captures enum value "CREATING" + HashicorpCloudVault20200420AuditLogStateCREATING HashicorpCloudVault20200420AuditLogState = "CREATING" + + // HashicorpCloudVault20200420AuditLogStateREADY captures enum value "READY" + HashicorpCloudVault20200420AuditLogStateREADY HashicorpCloudVault20200420AuditLogState = "READY" + + // HashicorpCloudVault20200420AuditLogStateFAILED captures enum value "FAILED" + HashicorpCloudVault20200420AuditLogStateFAILED HashicorpCloudVault20200420AuditLogState = "FAILED" + + // HashicorpCloudVault20200420AuditLogStateEXPIRED captures enum value "EXPIRED" + HashicorpCloudVault20200420AuditLogStateEXPIRED HashicorpCloudVault20200420AuditLogState = "EXPIRED" +) + +// for schema +var hashicorpCloudVault20200420AuditLogStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20200420AuditLogState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","READY","FAILED","EXPIRED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20200420AuditLogStateEnum = append(hashicorpCloudVault20200420AuditLogStateEnum, v) + } +} + +func (m HashicorpCloudVault20200420AuditLogState) validateHashicorpCloudVault20200420AuditLogStateEnum(path, location string, value HashicorpCloudVault20200420AuditLogState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20200420AuditLogStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20200420 audit log state +func (m HashicorpCloudVault20200420AuditLogState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20200420AuditLogStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_c_o_r_s_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_c_o_r_s_config.go new file mode 100644 index 00000000..5ae66060 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_c_o_r_s_config.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420CORSConfig CORSConfig is the CORS configuration on the Vault cluster +// +// swagger:model hashicorp.cloud.vault_20200420.CORSConfig +type HashicorpCloudVault20200420CORSConfig struct { + + // allowed_headers returns the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins returns the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // enabled is true if CORS is enabled for this cluster. + Enabled bool `json:"enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 c o r s config +func (m *HashicorpCloudVault20200420CORSConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CORSConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CORSConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CORSConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_capacity_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_capacity_config.go new file mode 100644 index 00000000..8a32f759 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_capacity_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420CapacityConfig hashicorp cloud vault 20200420 capacity config +// +// swagger:model hashicorp.cloud.vault_20200420.CapacityConfig +type HashicorpCloudVault20200420CapacityConfig struct { + + // num_servers is the number of nodes this Vault cluster should have. + NumServers int32 `json:"num_servers,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 capacity config +func (m *HashicorpCloudVault20200420CapacityConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CapacityConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CapacityConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CapacityConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster.go new file mode 100644 index 00000000..e9c1db4e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20200420Cluster Cluster represents a single Vault cluster. +// +// swagger:model hashicorp.cloud.vault_20200420.Cluster +type HashicorpCloudVault20200420Cluster struct { + + // config holds the configuration of the cluster. + Config *HashicorpCloudVault20200420ClusterConfig `json:"config,omitempty"` + + // created_at is the timestamp of when the cluster was first created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // currently_deployed_version is the version of the currrent Vault deployment. + CurrentVersion string `json:"current_version,omitempty"` + + // DNSNames holds all of the cluster's DNS names. + DNSNames *HashicorpCloudVault20200420ClusterDNSNames `json:"dns_names,omitempty"` + + // id is ID of the Vault cluster. + ID string `json:"id,omitempty"` + + // location is the location of the cluster. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // state is the current state of the cluster. + State HashicorpCloudVault20200420ClusterState `json:"state,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 cluster +func (m *HashicorpCloudVault20200420Cluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDNSNames(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420Cluster) validateConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420Cluster) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420Cluster) validateDNSNames(formats strfmt.Registry) error { + + if swag.IsZero(m.DNSNames) { // not required + return nil + } + + if m.DNSNames != nil { + if err := m.DNSNames.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dns_names") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420Cluster) 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 *HashicorpCloudVault20200420Cluster) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420Cluster) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_config.go new file mode 100644 index 00000000..754123ff --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_config.go @@ -0,0 +1,202 @@ +// 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" +) + +// HashicorpCloudVault20200420ClusterConfig hashicorp cloud vault 20200420 cluster config +// +// swagger:model hashicorp.cloud.vault_20200420.ClusterConfig +type HashicorpCloudVault20200420ClusterConfig struct { + + // audit config + AuditConfig *HashicorpCloudVault20200420AuditConfig `json:"audit_config,omitempty"` + + // capacity config + CapacityConfig *HashicorpCloudVault20200420CapacityConfig `json:"capacity_config,omitempty"` + + // maintenance config + MaintenanceConfig HashicorpCloudVault20200420MaintenanceConfig `json:"maintenance_config,omitempty"` + + // network config + NetworkConfig *HashicorpCloudVault20200420NetworkConfig `json:"network_config,omitempty"` + + // public ips disabled + PublicIpsDisabled bool `json:"public_ips_disabled,omitempty"` + + // snapshot config + SnapshotConfig *HashicorpCloudVault20200420SnapshotConfig `json:"snapshot_config,omitempty"` + + // vault access + VaultAccess *HashicorpCloudVault20200420VaultAccess `json:"vault_access,omitempty"` + + // vault config + VaultConfig *HashicorpCloudVault20200420VaultConfig `json:"vault_config,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 cluster config +func (m *HashicorpCloudVault20200420ClusterConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuditConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCapacityConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNetworkConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshotConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVaultAccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVaultConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateAuditConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.AuditConfig) { // not required + return nil + } + + if m.AuditConfig != nil { + if err := m.AuditConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("audit_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateCapacityConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.CapacityConfig) { // not required + return nil + } + + if m.CapacityConfig != nil { + if err := m.CapacityConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capacity_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateNetworkConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.NetworkConfig) { // not required + return nil + } + + if m.NetworkConfig != nil { + if err := m.NetworkConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateSnapshotConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.SnapshotConfig) { // not required + return nil + } + + if m.SnapshotConfig != nil { + if err := m.SnapshotConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateVaultAccess(formats strfmt.Registry) error { + + if swag.IsZero(m.VaultAccess) { // not required + return nil + } + + if m.VaultAccess != nil { + if err := m.VaultAccess.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vault_access") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ClusterConfig) validateVaultConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.VaultConfig) { // not required + return nil + } + + if m.VaultConfig != nil { + if err := m.VaultConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vault_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ClusterConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ClusterConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420ClusterConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_dns_names.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_dns_names.go new file mode 100644 index 00000000..08a3fa28 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_dns_names.go @@ -0,0 +1,46 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420ClusterDNSNames DNSNames holds all of the cluster's DNS names. +// +// swagger:model hashicorp.cloud.vault_20200420.Cluster.DNSNames +type HashicorpCloudVault20200420ClusterDNSNames struct { + + // private is the DNS name pointing to the cluster's private IP addresses. + Private string `json:"private,omitempty"` + + // public is the DNS name pointing to the cluster's public IP addresses. + Public string `json:"public,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 cluster DNS names +func (m *HashicorpCloudVault20200420ClusterDNSNames) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ClusterDNSNames) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ClusterDNSNames) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420ClusterDNSNames + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_state.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_state.go new file mode 100644 index 00000000..be2fbbd4 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_cluster_state.go @@ -0,0 +1,113 @@ +// 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" +) + +// HashicorpCloudVault20200420ClusterState State is the state of the Vault cluster. Note that this state +// represents the abstract Vault cluster itself, not necessarily whether +// Vault cluster is currently available or not. +// +// - UNSET: UNSET is a sentinel zero value so that an uninitialized value can be +// detected. +// - PENDING: PENDING is the state the cluster is in while it is waiting to be created. +// - CREATING: CREATING is the state the cluster is in while it is being provisioned for +// the first time. +// - RUNNING: RUNNING is the steady state while the cluster is running. +// - FAILED: FAILED is a failure state in which the cluster is unavailable and may +// required an operator restore action to recover. +// - UPDATING: UPDATING is the state the cluster is in while undergoing a version +// update. +// - RESTORING: RESTORING is the state the cluster is in while restoring from a snapshot. +// - DELETING: DELETING is the state the cluster is in while it is being de-provisioned. +// - DELETED: DELETED is the state the cluster is in when it has been de-provisioned. At +// this point, the cluster is eligible for garbage collection. +// - SEALING: SEALING is the state the cluster is in when it is about to get sealed. +// - SEALED: SEALED is the state the cluster is in while a cluster is sealed. +// - UNSEALING: UNSEALING is the state the cluster is in when it is about to get unsealed. +// +// swagger:model hashicorp.cloud.vault_20200420.Cluster.State +type HashicorpCloudVault20200420ClusterState string + +const ( + + // HashicorpCloudVault20200420ClusterStateUNSET captures enum value "UNSET" + HashicorpCloudVault20200420ClusterStateUNSET HashicorpCloudVault20200420ClusterState = "UNSET" + + // HashicorpCloudVault20200420ClusterStatePENDING captures enum value "PENDING" + HashicorpCloudVault20200420ClusterStatePENDING HashicorpCloudVault20200420ClusterState = "PENDING" + + // HashicorpCloudVault20200420ClusterStateCREATING captures enum value "CREATING" + HashicorpCloudVault20200420ClusterStateCREATING HashicorpCloudVault20200420ClusterState = "CREATING" + + // HashicorpCloudVault20200420ClusterStateRUNNING captures enum value "RUNNING" + HashicorpCloudVault20200420ClusterStateRUNNING HashicorpCloudVault20200420ClusterState = "RUNNING" + + // HashicorpCloudVault20200420ClusterStateFAILED captures enum value "FAILED" + HashicorpCloudVault20200420ClusterStateFAILED HashicorpCloudVault20200420ClusterState = "FAILED" + + // HashicorpCloudVault20200420ClusterStateUPDATING captures enum value "UPDATING" + HashicorpCloudVault20200420ClusterStateUPDATING HashicorpCloudVault20200420ClusterState = "UPDATING" + + // HashicorpCloudVault20200420ClusterStateRESTORING captures enum value "RESTORING" + HashicorpCloudVault20200420ClusterStateRESTORING HashicorpCloudVault20200420ClusterState = "RESTORING" + + // HashicorpCloudVault20200420ClusterStateDELETING captures enum value "DELETING" + HashicorpCloudVault20200420ClusterStateDELETING HashicorpCloudVault20200420ClusterState = "DELETING" + + // HashicorpCloudVault20200420ClusterStateDELETED captures enum value "DELETED" + HashicorpCloudVault20200420ClusterStateDELETED HashicorpCloudVault20200420ClusterState = "DELETED" + + // HashicorpCloudVault20200420ClusterStateSEALING captures enum value "SEALING" + HashicorpCloudVault20200420ClusterStateSEALING HashicorpCloudVault20200420ClusterState = "SEALING" + + // HashicorpCloudVault20200420ClusterStateSEALED captures enum value "SEALED" + HashicorpCloudVault20200420ClusterStateSEALED HashicorpCloudVault20200420ClusterState = "SEALED" + + // HashicorpCloudVault20200420ClusterStateUNSEALING captures enum value "UNSEALING" + HashicorpCloudVault20200420ClusterStateUNSEALING HashicorpCloudVault20200420ClusterState = "UNSEALING" +) + +// for schema +var hashicorpCloudVault20200420ClusterStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20200420ClusterState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","RUNNING","FAILED","UPDATING","RESTORING","DELETING","DELETED","SEALING","SEALED","UNSEALING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20200420ClusterStateEnum = append(hashicorpCloudVault20200420ClusterStateEnum, v) + } +} + +func (m HashicorpCloudVault20200420ClusterState) validateHashicorpCloudVault20200420ClusterStateEnum(path, location string, value HashicorpCloudVault20200420ClusterState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20200420ClusterStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20200420 cluster state +func (m HashicorpCloudVault20200420ClusterState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20200420ClusterStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_request.go new file mode 100644 index 00000000..78ceb451 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420CreateRequest hashicorp cloud vault 20200420 create request +// +// swagger:model hashicorp.cloud.vault_20200420.CreateRequest +type HashicorpCloudVault20200420CreateRequest struct { + + // cluster + Cluster *HashicorpCloudVault20200420Cluster `json:"cluster,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 create request +func (m *HashicorpCloudVault20200420CreateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420CreateRequest) validateCluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CreateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_response.go new file mode 100644 index 00000000..fad653a7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_response.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" +) + +// HashicorpCloudVault20200420CreateResponse hashicorp cloud vault 20200420 create response +// +// swagger:model hashicorp.cloud.vault_20200420.CreateResponse +type HashicorpCloudVault20200420CreateResponse struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 create response +func (m *HashicorpCloudVault20200420CreateResponse) 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 *HashicorpCloudVault20200420CreateResponse) 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 *HashicorpCloudVault20200420CreateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CreateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_request.go new file mode 100644 index 00000000..1ec536ed --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_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" +) + +// HashicorpCloudVault20200420CreateSnapshotRequest hashicorp cloud vault 20200420 create snapshot request +// +// swagger:model hashicorp.cloud.vault_20200420.CreateSnapshotRequest +type HashicorpCloudVault20200420CreateSnapshotRequest struct { + + // name is the user provided name of the snapshot. + Name string `json:"name,omitempty"` + + // resource specifies the link to the resource to snapshot + Resource *cloud.HashicorpCloudLocationLink `json:"resource,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 create snapshot request +func (m *HashicorpCloudVault20200420CreateSnapshotRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResource(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420CreateSnapshotRequest) validateResource(formats strfmt.Registry) error { + + if swag.IsZero(m.Resource) { // not required + return nil + } + + if m.Resource != nil { + if err := m.Resource.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resource") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CreateSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_response.go new file mode 100644 index 00000000..cefff73f --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_create_snapshot_response.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" +) + +// HashicorpCloudVault20200420CreateSnapshotResponse hashicorp cloud vault 20200420 create snapshot response +// +// swagger:model hashicorp.cloud.vault_20200420.CreateSnapshotResponse +type HashicorpCloudVault20200420CreateSnapshotResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` + + // snapshot id + SnapshotID string `json:"snapshot_id,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 create snapshot response +func (m *HashicorpCloudVault20200420CreateSnapshotResponse) 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 *HashicorpCloudVault20200420CreateSnapshotResponse) 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 *HashicorpCloudVault20200420CreateSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420CreateSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420CreateSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_response.go new file mode 100644 index 00000000..9e89fa5b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_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" +) + +// HashicorpCloudVault20200420DeleteResponse hashicorp cloud vault 20200420 delete response +// +// swagger:model hashicorp.cloud.vault_20200420.DeleteResponse +type HashicorpCloudVault20200420DeleteResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 delete response +func (m *HashicorpCloudVault20200420DeleteResponse) 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 *HashicorpCloudVault20200420DeleteResponse) 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 *HashicorpCloudVault20200420DeleteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420DeleteResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420DeleteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_snapshot_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_snapshot_response.go new file mode 100644 index 00000000..d85582df --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_delete_snapshot_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" +) + +// HashicorpCloudVault20200420DeleteSnapshotResponse DeleteSnapshotResponse is a response to deleting a snapshot. +// +// swagger:model hashicorp.cloud.vault_20200420.DeleteSnapshotResponse +type HashicorpCloudVault20200420DeleteSnapshotResponse struct { + + // operation represents the deletion of the requested snapshot. + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 delete snapshot response +func (m *HashicorpCloudVault20200420DeleteSnapshotResponse) 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 *HashicorpCloudVault20200420DeleteSnapshotResponse) 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 *HashicorpCloudVault20200420DeleteSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420DeleteSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420DeleteSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_disable_c_o_r_s_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_disable_c_o_r_s_response.go new file mode 100644 index 00000000..188e1fbf --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_disable_c_o_r_s_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 + +// HashicorpCloudVault20200420DisableCORSResponse hashicorp cloud vault 20200420 disable c o r s response +// +// swagger:model hashicorp.cloud.vault_20200420.DisableCORSResponse +type HashicorpCloudVault20200420DisableCORSResponse interface{} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_request.go new file mode 100644 index 00000000..47995c4f --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_request.go @@ -0,0 +1,118 @@ +// 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" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20200420FetchAuditLogRequest hashicorp cloud vault 20200420 fetch audit log request +// +// swagger:model hashicorp.cloud.vault_20200420.FetchAuditLogRequest +type HashicorpCloudVault20200420FetchAuditLogRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // interval end + // Format: date-time + IntervalEnd strfmt.DateTime `json:"interval_end,omitempty"` + + // interval start + // Format: date-time + IntervalStart strfmt.DateTime `json:"interval_start,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 fetch audit log request +func (m *HashicorpCloudVault20200420FetchAuditLogRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIntervalEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420FetchAuditLogRequest) validateIntervalEnd(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalEnd) { // not required + return nil + } + + if err := validate.FormatOf("interval_end", "body", "date-time", m.IntervalEnd.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420FetchAuditLogRequest) validateIntervalStart(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalStart) { // not required + return nil + } + + if err := validate.FormatOf("interval_start", "body", "date-time", m.IntervalStart.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420FetchAuditLogRequest) 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 *HashicorpCloudVault20200420FetchAuditLogRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420FetchAuditLogRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420FetchAuditLogRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_response.go new file mode 100644 index 00000000..c52ce048 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_fetch_audit_log_response.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" +) + +// HashicorpCloudVault20200420FetchAuditLogResponse hashicorp cloud vault 20200420 fetch audit log response +// +// swagger:model hashicorp.cloud.vault_20200420.FetchAuditLogResponse +type HashicorpCloudVault20200420FetchAuditLogResponse struct { + + // log id + LogID string `json:"log_id,omitempty"` + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 fetch audit log response +func (m *HashicorpCloudVault20200420FetchAuditLogResponse) 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 *HashicorpCloudVault20200420FetchAuditLogResponse) 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 *HashicorpCloudVault20200420FetchAuditLogResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420FetchAuditLogResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420FetchAuditLogResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_admin_token_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_admin_token_response.go new file mode 100644 index 00000000..0bd7a298 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_admin_token_response.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420GetAdminTokenResponse hashicorp cloud vault 20200420 get admin token response +// +// swagger:model hashicorp.cloud.vault_20200420.GetAdminTokenResponse +type HashicorpCloudVault20200420GetAdminTokenResponse struct { + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 get admin token response +func (m *HashicorpCloudVault20200420GetAdminTokenResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetAdminTokenResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetAdminTokenResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420GetAdminTokenResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_audit_log_status_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_audit_log_status_response.go new file mode 100644 index 00000000..e0d3d000 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_audit_log_status_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420GetAuditLogStatusResponse hashicorp cloud vault 20200420 get audit log status response +// +// swagger:model hashicorp.cloud.vault_20200420.GetAuditLogStatusResponse +type HashicorpCloudVault20200420GetAuditLogStatusResponse struct { + + // log + Log *HashicorpCloudVault20200420AuditLog `json:"log,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 get audit log status response +func (m *HashicorpCloudVault20200420GetAuditLogStatusResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLog(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420GetAuditLogStatusResponse) validateLog(formats strfmt.Registry) error { + + if swag.IsZero(m.Log) { // not required + return nil + } + + if m.Log != nil { + if err := m.Log.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("log") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetAuditLogStatusResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetAuditLogStatusResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420GetAuditLogStatusResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_c_o_r_s_config_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_c_o_r_s_config_response.go new file mode 100644 index 00000000..31bd86c3 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_c_o_r_s_config_response.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420GetCORSConfigResponse hashicorp cloud vault 20200420 get c o r s config response +// +// swagger:model hashicorp.cloud.vault_20200420.GetCORSConfigResponse +type HashicorpCloudVault20200420GetCORSConfigResponse struct { + + // allowed_headers are the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins are the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // enabled returns true if CORS is enabled. + Enabled bool `json:"enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 get c o r s config response +func (m *HashicorpCloudVault20200420GetCORSConfigResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetCORSConfigResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetCORSConfigResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420GetCORSConfigResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_response.go new file mode 100644 index 00000000..0aa7db84 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420GetResponse hashicorp cloud vault 20200420 get response +// +// swagger:model hashicorp.cloud.vault_20200420.GetResponse +type HashicorpCloudVault20200420GetResponse struct { + + // cluster + Cluster *HashicorpCloudVault20200420Cluster `json:"cluster,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 get response +func (m *HashicorpCloudVault20200420GetResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420GetResponse) validateCluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420GetResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_snapshot_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_snapshot_response.go new file mode 100644 index 00000000..1104f39d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_get_snapshot_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420GetSnapshotResponse GetSnapshotResponse is a response for retrieving a snapshot's information. +// +// swagger:model hashicorp.cloud.vault_20200420.GetSnapshotResponse +type HashicorpCloudVault20200420GetSnapshotResponse struct { + + // snapshot is the requested snapshot. + Snapshot *HashicorpCloudVault20200420Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 get snapshot response +func (m *HashicorpCloudVault20200420GetSnapshotResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420GetSnapshotResponse) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420GetSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420GetSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_response.go new file mode 100644 index 00000000..1223c14a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_response.go @@ -0,0 +1,106 @@ +// 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 ( + "strconv" + + "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" +) + +// HashicorpCloudVault20200420ListResponse hashicorp cloud vault 20200420 list response +// +// swagger:model hashicorp.cloud.vault_20200420.ListResponse +type HashicorpCloudVault20200420ListResponse struct { + + // clusters + Clusters []*HashicorpCloudVault20200420Cluster `json:"clusters"` + + // pagination + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 list response +func (m *HashicorpCloudVault20200420ListResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusters(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420ListResponse) validateClusters(formats strfmt.Registry) error { + + if swag.IsZero(m.Clusters) { // not required + return nil + } + + for i := 0; i < len(m.Clusters); i++ { + if swag.IsZero(m.Clusters[i]) { // not required + continue + } + + if m.Clusters[i] != nil { + if err := m.Clusters[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudVault20200420ListResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ListResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ListResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420ListResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_snapshots_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_snapshots_response.go new file mode 100644 index 00000000..9fbc5287 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_list_snapshots_response.go @@ -0,0 +1,106 @@ +// 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 ( + "strconv" + + "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" +) + +// HashicorpCloudVault20200420ListSnapshotsResponse ListSnapshotsResponse is a response from listing snapshots. +// +// swagger:model hashicorp.cloud.vault_20200420.ListSnapshotsResponse +type HashicorpCloudVault20200420ListSnapshotsResponse struct { + + // Pagination contains the pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // snapshots is a list of available snapshots. + Snapshots []*HashicorpCloudVault20200420Snapshot `json:"snapshots"` +} + +// Validate validates this hashicorp cloud vault 20200420 list snapshots response +func (m *HashicorpCloudVault20200420ListSnapshotsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshots(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420ListSnapshotsResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420ListSnapshotsResponse) validateSnapshots(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshots) { // not required + return nil + } + + for i := 0; i < len(m.Snapshots); i++ { + if swag.IsZero(m.Snapshots[i]) { // not required + continue + } + + if m.Snapshots[i] != nil { + if err := m.Snapshots[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ListSnapshotsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420ListSnapshotsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420ListSnapshotsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_maintenance_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_maintenance_config.go new file mode 100644 index 00000000..08b42044 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_maintenance_config.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 + +// HashicorpCloudVault20200420MaintenanceConfig hashicorp cloud vault 20200420 maintenance config +// +// swagger:model hashicorp.cloud.vault_20200420.MaintenanceConfig +type HashicorpCloudVault20200420MaintenanceConfig interface{} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_network_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_network_config.go new file mode 100644 index 00000000..eef13c47 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_network_config.go @@ -0,0 +1,77 @@ +// 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" +) + +// HashicorpCloudVault20200420NetworkConfig hashicorp cloud vault 20200420 network config +// +// swagger:model hashicorp.cloud.vault_20200420.NetworkConfig +type HashicorpCloudVault20200420NetworkConfig struct { + + // cors config + CorsConfig *HashicorpCloudVault20200420CORSConfig `json:"cors_config,omitempty"` + + // network_id is the ID of the network the Vault cluster belongs to. + NetworkID string `json:"network_id,omitempty"` + + // public_ips_disabled indicates if public IP's are disabled. + PublicIpsDisabled bool `json:"public_ips_disabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 network config +func (m *HashicorpCloudVault20200420NetworkConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCorsConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420NetworkConfig) validateCorsConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.CorsConfig) { // not required + return nil + } + + if m.CorsConfig != nil { + if err := m.CorsConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cors_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420NetworkConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420NetworkConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420NetworkConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_request.go new file mode 100644 index 00000000..a59d428f --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_request.go @@ -0,0 +1,78 @@ +// 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" +) + +// HashicorpCloudVault20200420RestoreSnapshotRequest hashicorp cloud vault 20200420 restore snapshot request +// +// swagger:model hashicorp.cloud.vault_20200420.RestoreSnapshotRequest +type HashicorpCloudVault20200420RestoreSnapshotRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // snapshot id + SnapshotID string `json:"snapshot_id,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 restore snapshot request +func (m *HashicorpCloudVault20200420RestoreSnapshotRequest) 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 *HashicorpCloudVault20200420RestoreSnapshotRequest) 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 *HashicorpCloudVault20200420RestoreSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420RestoreSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420RestoreSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_response.go new file mode 100644 index 00000000..75af3c6d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_restore_snapshot_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" +) + +// HashicorpCloudVault20200420RestoreSnapshotResponse hashicorp cloud vault 20200420 restore snapshot response +// +// swagger:model hashicorp.cloud.vault_20200420.RestoreSnapshotResponse +type HashicorpCloudVault20200420RestoreSnapshotResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 restore snapshot response +func (m *HashicorpCloudVault20200420RestoreSnapshotResponse) 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 *HashicorpCloudVault20200420RestoreSnapshotResponse) 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 *HashicorpCloudVault20200420RestoreSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420RestoreSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420RestoreSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_request.go new file mode 100644 index 00000000..f8ee452a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_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" +) + +// HashicorpCloudVault20200420SealRequest hashicorp cloud vault 20200420 seal request +// +// swagger:model hashicorp.cloud.vault_20200420.SealRequest +type HashicorpCloudVault20200420SealRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 seal request +func (m *HashicorpCloudVault20200420SealRequest) 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 *HashicorpCloudVault20200420SealRequest) 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 *HashicorpCloudVault20200420SealRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420SealRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420SealRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_response.go new file mode 100644 index 00000000..2e06a003 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_seal_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" +) + +// HashicorpCloudVault20200420SealResponse hashicorp cloud vault 20200420 seal response +// +// swagger:model hashicorp.cloud.vault_20200420.SealResponse +type HashicorpCloudVault20200420SealResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 seal response +func (m *HashicorpCloudVault20200420SealResponse) 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 *HashicorpCloudVault20200420SealResponse) 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 *HashicorpCloudVault20200420SealResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420SealResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420SealResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot.go new file mode 100644 index 00000000..378a816b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20200420Snapshot Snapshot is our representation needed to back-up a Vault cluster. +// +// swagger:model hashicorp.cloud.vault_20200420.Snapshot +type HashicorpCloudVault20200420Snapshot struct { + + // cluster_id is the cluster id that this snapshot backs. + ClusterID string `json:"cluster_id,omitempty"` + + // finished_at notes the time that this snapshot was finished. + // Format: date-time + FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` + + // location is the location of the Snapshot. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Name of the snapshot + Name string `json:"name,omitempty"` + + // requested_at notes the time that this snapshot was requested. + // Format: date-time + RequestedAt strfmt.DateTime `json:"requested_at,omitempty"` + + // snapshot_id is the snapshots UUID. + SnapshotID string `json:"snapshot_id,omitempty"` + + // state is represents the current status for this snapshot. + State HashicorpCloudVault20200420SnapshotState `json:"state,omitempty"` + + // type is the type of snapshot. + Type HashicorpCloudVault20200420SnapshotType `json:"type,omitempty"` + + // vault_version is the version of the Vault cluster this snapshot was taken from. + VaultVersion string `json:"vault_version,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 snapshot +func (m *HashicorpCloudVault20200420Snapshot) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFinishedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420Snapshot) validateFinishedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.FinishedAt) { // not required + return nil + } + + if err := validate.FormatOf("finished_at", "body", "date-time", m.FinishedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420Snapshot) 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 *HashicorpCloudVault20200420Snapshot) validateRequestedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requested_at", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420Snapshot) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20200420Snapshot) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420Snapshot) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420Snapshot) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420Snapshot + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_config.go new file mode 100644 index 00000000..d2e4c4ff --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420SnapshotConfig hashicorp cloud vault 20200420 snapshot config +// +// swagger:model hashicorp.cloud.vault_20200420.SnapshotConfig +type HashicorpCloudVault20200420SnapshotConfig struct { + + // periodic_snapshots_disabled indicates if automated periodic snapshots should be disabled + PeriodicSnapshotsDisabled bool `json:"periodic_snapshots_disabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 snapshot config +func (m *HashicorpCloudVault20200420SnapshotConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420SnapshotConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420SnapshotConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420SnapshotConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_state.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_state.go new file mode 100644 index 00000000..f6027997 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_state.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" +) + +// HashicorpCloudVault20200420SnapshotState SnapshotState represents the lifecycle of snapshots +// +// swagger:model hashicorp.cloud.vault_20200420.Snapshot.State +type HashicorpCloudVault20200420SnapshotState string + +const ( + + // HashicorpCloudVault20200420SnapshotStateUNSET captures enum value "UNSET" + HashicorpCloudVault20200420SnapshotStateUNSET HashicorpCloudVault20200420SnapshotState = "UNSET" + + // HashicorpCloudVault20200420SnapshotStatePENDING captures enum value "PENDING" + HashicorpCloudVault20200420SnapshotStatePENDING HashicorpCloudVault20200420SnapshotState = "PENDING" + + // HashicorpCloudVault20200420SnapshotStateCREATING captures enum value "CREATING" + HashicorpCloudVault20200420SnapshotStateCREATING HashicorpCloudVault20200420SnapshotState = "CREATING" + + // HashicorpCloudVault20200420SnapshotStateSTORED captures enum value "STORED" + HashicorpCloudVault20200420SnapshotStateSTORED HashicorpCloudVault20200420SnapshotState = "STORED" + + // HashicorpCloudVault20200420SnapshotStateFAILED captures enum value "FAILED" + HashicorpCloudVault20200420SnapshotStateFAILED HashicorpCloudVault20200420SnapshotState = "FAILED" + + // HashicorpCloudVault20200420SnapshotStateDELETING captures enum value "DELETING" + HashicorpCloudVault20200420SnapshotStateDELETING HashicorpCloudVault20200420SnapshotState = "DELETING" +) + +// for schema +var hashicorpCloudVault20200420SnapshotStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20200420SnapshotState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","STORED","FAILED","DELETING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20200420SnapshotStateEnum = append(hashicorpCloudVault20200420SnapshotStateEnum, v) + } +} + +func (m HashicorpCloudVault20200420SnapshotState) validateHashicorpCloudVault20200420SnapshotStateEnum(path, location string, value HashicorpCloudVault20200420SnapshotState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20200420SnapshotStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20200420 snapshot state +func (m HashicorpCloudVault20200420SnapshotState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20200420SnapshotStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_type.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_type.go new file mode 100644 index 00000000..eea70ab5 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_snapshot_type.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" +) + +// HashicorpCloudVault20200420SnapshotType Type represents the type of snapshots. +// +// swagger:model hashicorp.cloud.vault_20200420.Snapshot.Type +type HashicorpCloudVault20200420SnapshotType string + +const ( + + // HashicorpCloudVault20200420SnapshotTypeTYPEUNSET captures enum value "TYPE_UNSET" + HashicorpCloudVault20200420SnapshotTypeTYPEUNSET HashicorpCloudVault20200420SnapshotType = "TYPE_UNSET" + + // HashicorpCloudVault20200420SnapshotTypeAUTOMATIC captures enum value "AUTOMATIC" + HashicorpCloudVault20200420SnapshotTypeAUTOMATIC HashicorpCloudVault20200420SnapshotType = "AUTOMATIC" + + // HashicorpCloudVault20200420SnapshotTypeSCHEDULED captures enum value "SCHEDULED" + HashicorpCloudVault20200420SnapshotTypeSCHEDULED HashicorpCloudVault20200420SnapshotType = "SCHEDULED" + + // HashicorpCloudVault20200420SnapshotTypeMANUAL captures enum value "MANUAL" + HashicorpCloudVault20200420SnapshotTypeMANUAL HashicorpCloudVault20200420SnapshotType = "MANUAL" + + // HashicorpCloudVault20200420SnapshotTypeBEFOREUPGRADE captures enum value "BEFORE_UPGRADE" + HashicorpCloudVault20200420SnapshotTypeBEFOREUPGRADE HashicorpCloudVault20200420SnapshotType = "BEFORE_UPGRADE" +) + +// for schema +var hashicorpCloudVault20200420SnapshotTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVault20200420SnapshotType + if err := json.Unmarshal([]byte(`["TYPE_UNSET","AUTOMATIC","SCHEDULED","MANUAL","BEFORE_UPGRADE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20200420SnapshotTypeEnum = append(hashicorpCloudVault20200420SnapshotTypeEnum, v) + } +} + +func (m HashicorpCloudVault20200420SnapshotType) validateHashicorpCloudVault20200420SnapshotTypeEnum(path, location string, value HashicorpCloudVault20200420SnapshotType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20200420SnapshotTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20200420 snapshot type +func (m HashicorpCloudVault20200420SnapshotType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20200420SnapshotTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_request.go new file mode 100644 index 00000000..51a0efe9 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_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" +) + +// HashicorpCloudVault20200420UnsealRequest hashicorp cloud vault 20200420 unseal request +// +// swagger:model hashicorp.cloud.vault_20200420.UnsealRequest +type HashicorpCloudVault20200420UnsealRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 unseal request +func (m *HashicorpCloudVault20200420UnsealRequest) 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 *HashicorpCloudVault20200420UnsealRequest) 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 *HashicorpCloudVault20200420UnsealRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UnsealRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UnsealRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_response.go new file mode 100644 index 00000000..34cc6926 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_unseal_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" +) + +// HashicorpCloudVault20200420UnsealResponse hashicorp cloud vault 20200420 unseal response +// +// swagger:model hashicorp.cloud.vault_20200420.UnsealResponse +type HashicorpCloudVault20200420UnsealResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 unseal response +func (m *HashicorpCloudVault20200420UnsealResponse) 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 *HashicorpCloudVault20200420UnsealResponse) 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 *HashicorpCloudVault20200420UnsealResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UnsealResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UnsealResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_config_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_config_request.go new file mode 100644 index 00000000..1b23a9ce --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_config_request.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 ( + "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" +) + +// HashicorpCloudVault20200420UpdateCORSConfigRequest hashicorp cloud vault 20200420 update c o r s config request +// +// swagger:model hashicorp.cloud.vault_20200420.UpdateCORSConfigRequest +type HashicorpCloudVault20200420UpdateCORSConfigRequest struct { + + // allowed_headers sets the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins sets the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 update c o r s config request +func (m *HashicorpCloudVault20200420UpdateCORSConfigRequest) 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 *HashicorpCloudVault20200420UpdateCORSConfigRequest) 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 *HashicorpCloudVault20200420UpdateCORSConfigRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdateCORSConfigRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UpdateCORSConfigRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_config_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_config_response.go new file mode 100644 index 00000000..1770e1b3 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_c_o_r_s_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 + +// HashicorpCloudVault20200420UpdateCORSConfigResponse hashicorp cloud vault 20200420 update c o r s config response +// +// swagger:model hashicorp.cloud.vault_20200420.UpdateCORSConfigResponse +type HashicorpCloudVault20200420UpdateCORSConfigResponse interface{} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_request.go new file mode 100644 index 00000000..25ed74a7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_request.go @@ -0,0 +1,78 @@ +// 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" +) + +// HashicorpCloudVault20200420UpdatePublicIpsRequest hashicorp cloud vault 20200420 update public ips request +// +// swagger:model hashicorp.cloud.vault_20200420.UpdatePublicIpsRequest +type HashicorpCloudVault20200420UpdatePublicIpsRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // enable public ips + EnablePublicIps bool `json:"enable_public_ips,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 update public ips request +func (m *HashicorpCloudVault20200420UpdatePublicIpsRequest) 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 *HashicorpCloudVault20200420UpdatePublicIpsRequest) 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 *HashicorpCloudVault20200420UpdatePublicIpsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdatePublicIpsRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UpdatePublicIpsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_response.go new file mode 100644 index 00000000..29bd21af --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_public_ips_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" +) + +// HashicorpCloudVault20200420UpdatePublicIpsResponse hashicorp cloud vault 20200420 update public ips response +// +// swagger:model hashicorp.cloud.vault_20200420.UpdatePublicIpsResponse +type HashicorpCloudVault20200420UpdatePublicIpsResponse struct { + + // operation represents the operation of the request. + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 update public ips response +func (m *HashicorpCloudVault20200420UpdatePublicIpsResponse) 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 *HashicorpCloudVault20200420UpdatePublicIpsResponse) 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 *HashicorpCloudVault20200420UpdatePublicIpsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdatePublicIpsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UpdatePublicIpsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_request.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_request.go new file mode 100644 index 00000000..adec92a8 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_request.go @@ -0,0 +1,99 @@ +// 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" +) + +// HashicorpCloudVault20200420UpdateSnapshotRequest UpdateSnapshotRequest is a request to update a snapshot. +// +// swagger:model hashicorp.cloud.vault_20200420.UpdateSnapshotRequest +type HashicorpCloudVault20200420UpdateSnapshotRequest struct { + + // mask is the mask of fields to update. + Mask *cloud.GoogleProtobufFieldMask `json:"mask,omitempty"` + + // snapshot contains the fields to update. + // + // Supported fields: name + Snapshot *HashicorpCloudVault20200420Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 update snapshot request +func (m *HashicorpCloudVault20200420UpdateSnapshotRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMask(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420UpdateSnapshotRequest) validateMask(formats strfmt.Registry) error { + + if swag.IsZero(m.Mask) { // not required + return nil + } + + if m.Mask != nil { + if err := m.Mask.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mask") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20200420UpdateSnapshotRequest) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdateSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdateSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UpdateSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_response.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_response.go new file mode 100644 index 00000000..ca39ce2c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_update_snapshot_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420UpdateSnapshotResponse UpdateSnapshotResponse is a response to updating a snapshot. +// +// swagger:model hashicorp.cloud.vault_20200420.UpdateSnapshotResponse +type HashicorpCloudVault20200420UpdateSnapshotResponse struct { + + // snapshot is the updated snapshot. + Snapshot *HashicorpCloudVault20200420Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 update snapshot response +func (m *HashicorpCloudVault20200420UpdateSnapshotResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20200420UpdateSnapshotResponse) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdateSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420UpdateSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420UpdateSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_access.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_access.go new file mode 100644 index 00000000..d2b4afe4 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_access.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420VaultAccess hashicorp cloud vault 20200420 vault access +// +// swagger:model hashicorp.cloud.vault_20200420.VaultAccess +type HashicorpCloudVault20200420VaultAccess struct { + + // recovery key + RecoveryKey string `json:"recovery_key,omitempty"` + + // root token + RootToken string `json:"root_token,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 vault access +func (m *HashicorpCloudVault20200420VaultAccess) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420VaultAccess) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420VaultAccess) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420VaultAccess + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_config.go b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_config.go new file mode 100644 index 00000000..87103819 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-04-20/models/hashicorp_cloud_vault20200420_vault_config.go @@ -0,0 +1,50 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20200420VaultConfig hashicorp cloud vault 20200420 vault config +// +// swagger:model hashicorp.cloud.vault_20200420.VaultConfig +type HashicorpCloudVault20200420VaultConfig struct { + + // initial_version is the initial Vault version to use when creating the + // cluster. Once the cluster is created, this value is no longer used. + InitialVersion string `json:"initial_version,omitempty"` + + // max_lease_ttl is the max lease ttl for this Vault cluster. + MaxLeaseTTL string `json:"max_lease_ttl,omitempty"` + + // namespace is the name of the customer namespace. + Namespace string `json:"namespace,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20200420 vault config +func (m *HashicorpCloudVault20200420VaultConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20200420VaultConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20200420VaultConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20200420VaultConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/cloud_vault_service_client.go b/clients/cloud-vault-service/preview/2020-11-25/client/cloud_vault_service_client.go new file mode 100644 index 00000000..64d9ee5c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/cloud_vault_service_client.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// 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/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/preview/2020-11-25/client/vault_service" +) + +// Default cloud vault service HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "api.cloud.hashicorp.com" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new cloud vault service HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudVaultService { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud vault service HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudVaultService { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new cloud vault service client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudVaultService { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudVaultService) + cli.Transport = transport + cli.VaultService = vault_service.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// CloudVaultService is a client for cloud vault service +type CloudVaultService struct { + VaultService vault_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudVaultService) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.VaultService.SetTransport(transport) +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_parameters.go new file mode 100644 index 00000000..b501f626 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_parameters.go @@ -0,0 +1,177 @@ +// 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/preview/2020-11-25/models" +) + +// NewCreateParams creates a new CreateParams object +// with the default values initialized. +func NewCreateParams() *CreateParams { + var () + return &CreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateParamsWithTimeout creates a new CreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateParamsWithTimeout(timeout time.Duration) *CreateParams { + var () + return &CreateParams{ + + timeout: timeout, + } +} + +// NewCreateParamsWithContext creates a new CreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateParamsWithContext(ctx context.Context) *CreateParams { + var () + return &CreateParams{ + + Context: ctx, + } +} + +// NewCreateParamsWithHTTPClient creates a new CreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateParamsWithHTTPClient(client *http.Client) *CreateParams { + var () + return &CreateParams{ + HTTPClient: client, + } +} + +/*CreateParams contains all the parameters to send to the API endpoint +for the create operation typically these are written to a http.Request +*/ +type CreateParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125CreateRequest + /*ClusterLocationOrganizationID + organization_id is the id of the organization. + + */ + ClusterLocationOrganizationID string + /*ClusterLocationProjectID + project_id is the projects id. + + */ + ClusterLocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create params +func (o *CreateParams) WithTimeout(timeout time.Duration) *CreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create params +func (o *CreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create params +func (o *CreateParams) WithContext(ctx context.Context) *CreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create params +func (o *CreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create params +func (o *CreateParams) WithHTTPClient(client *http.Client) *CreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create params +func (o *CreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create params +func (o *CreateParams) WithBody(body *models.HashicorpCloudVault20201125CreateRequest) *CreateParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create params +func (o *CreateParams) SetBody(body *models.HashicorpCloudVault20201125CreateRequest) { + o.Body = body +} + +// WithClusterLocationOrganizationID adds the clusterLocationOrganizationID to the create params +func (o *CreateParams) WithClusterLocationOrganizationID(clusterLocationOrganizationID string) *CreateParams { + o.SetClusterLocationOrganizationID(clusterLocationOrganizationID) + return o +} + +// SetClusterLocationOrganizationID adds the clusterLocationOrganizationId to the create params +func (o *CreateParams) SetClusterLocationOrganizationID(clusterLocationOrganizationID string) { + o.ClusterLocationOrganizationID = clusterLocationOrganizationID +} + +// WithClusterLocationProjectID adds the clusterLocationProjectID to the create params +func (o *CreateParams) WithClusterLocationProjectID(clusterLocationProjectID string) *CreateParams { + o.SetClusterLocationProjectID(clusterLocationProjectID) + return o +} + +// SetClusterLocationProjectID adds the clusterLocationProjectId to the create params +func (o *CreateParams) SetClusterLocationProjectID(clusterLocationProjectID string) { + o.ClusterLocationProjectID = clusterLocationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateParams) 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.location.organization_id + if err := r.SetPathParam("cluster.location.organization_id", o.ClusterLocationOrganizationID); err != nil { + return err + } + + // path param cluster.location.project_id + if err := r.SetPathParam("cluster.location.project_id", o.ClusterLocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_responses.go new file mode 100644 index 00000000..87b385bd --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_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/preview/2020-11-25/models" +) + +// CreateReader is a Reader for the Create structure. +type CreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateDefault(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 + } +} + +// NewCreateOK creates a CreateOK with default headers values +func NewCreateOK() *CreateOK { + return &CreateOK{} +} + +/*CreateOK handles this case with default header values. + +A successful response. +*/ +type CreateOK struct { + Payload *models.HashicorpCloudVault20201125CreateResponse +} + +func (o *CreateOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters][%d] createOK %+v", 200, o.Payload) +} + +func (o *CreateOK) GetPayload() *models.HashicorpCloudVault20201125CreateResponse { + return o.Payload +} + +func (o *CreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125CreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDefault creates a CreateDefault with default headers values +func NewCreateDefault(code int) *CreateDefault { + return &CreateDefault{ + _statusCode: code, + } +} + +/*CreateDefault handles this case with default header values. + +An unexpected error response. +*/ +type CreateDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the create default response +func (o *CreateDefault) Code() int { + return o._statusCode +} + +func (o *CreateDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters][%d] Create default %+v", o._statusCode, o.Payload) +} + +func (o *CreateDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *CreateDefault) 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/preview/2020-11-25/client/vault_service/create_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_snapshot_parameters.go new file mode 100644 index 00000000..69c642c7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_snapshot_parameters.go @@ -0,0 +1,177 @@ +// 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/preview/2020-11-25/models" +) + +// NewCreateSnapshotParams creates a new CreateSnapshotParams object +// with the default values initialized. +func NewCreateSnapshotParams() *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSnapshotParamsWithTimeout creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateSnapshotParamsWithTimeout(timeout time.Duration) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + timeout: timeout, + } +} + +// NewCreateSnapshotParamsWithContext creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateSnapshotParamsWithContext(ctx context.Context) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + + Context: ctx, + } +} + +// NewCreateSnapshotParamsWithHTTPClient creates a new CreateSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateSnapshotParamsWithHTTPClient(client *http.Client) *CreateSnapshotParams { + var () + return &CreateSnapshotParams{ + HTTPClient: client, + } +} + +/*CreateSnapshotParams contains all the parameters to send to the API endpoint +for the create snapshot operation typically these are written to a http.Request +*/ +type CreateSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125CreateSnapshotRequest + /*ResourceLocationOrganizationID + organization_id is the id of the organization. + + */ + ResourceLocationOrganizationID string + /*ResourceLocationProjectID + project_id is the projects id. + + */ + ResourceLocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create snapshot params +func (o *CreateSnapshotParams) WithTimeout(timeout time.Duration) *CreateSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create snapshot params +func (o *CreateSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create snapshot params +func (o *CreateSnapshotParams) WithContext(ctx context.Context) *CreateSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create snapshot params +func (o *CreateSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create snapshot params +func (o *CreateSnapshotParams) WithHTTPClient(client *http.Client) *CreateSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create snapshot params +func (o *CreateSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create snapshot params +func (o *CreateSnapshotParams) WithBody(body *models.HashicorpCloudVault20201125CreateSnapshotRequest) *CreateSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create snapshot params +func (o *CreateSnapshotParams) SetBody(body *models.HashicorpCloudVault20201125CreateSnapshotRequest) { + o.Body = body +} + +// WithResourceLocationOrganizationID adds the resourceLocationOrganizationID to the create snapshot params +func (o *CreateSnapshotParams) WithResourceLocationOrganizationID(resourceLocationOrganizationID string) *CreateSnapshotParams { + o.SetResourceLocationOrganizationID(resourceLocationOrganizationID) + return o +} + +// SetResourceLocationOrganizationID adds the resourceLocationOrganizationId to the create snapshot params +func (o *CreateSnapshotParams) SetResourceLocationOrganizationID(resourceLocationOrganizationID string) { + o.ResourceLocationOrganizationID = resourceLocationOrganizationID +} + +// WithResourceLocationProjectID adds the resourceLocationProjectID to the create snapshot params +func (o *CreateSnapshotParams) WithResourceLocationProjectID(resourceLocationProjectID string) *CreateSnapshotParams { + o.SetResourceLocationProjectID(resourceLocationProjectID) + return o +} + +// SetResourceLocationProjectID adds the resourceLocationProjectId to the create snapshot params +func (o *CreateSnapshotParams) SetResourceLocationProjectID(resourceLocationProjectID string) { + o.ResourceLocationProjectID = resourceLocationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSnapshotParams) 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 resource.location.organization_id + if err := r.SetPathParam("resource.location.organization_id", o.ResourceLocationOrganizationID); err != nil { + return err + } + + // path param resource.location.project_id + if err := r.SetPathParam("resource.location.project_id", o.ResourceLocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_snapshot_responses.go new file mode 100644 index 00000000..62d382be --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/create_snapshot_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/preview/2020-11-25/models" +) + +// CreateSnapshotReader is a Reader for the CreateSnapshot structure. +type CreateSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateSnapshotDefault(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 + } +} + +// NewCreateSnapshotOK creates a CreateSnapshotOK with default headers values +func NewCreateSnapshotOK() *CreateSnapshotOK { + return &CreateSnapshotOK{} +} + +/*CreateSnapshotOK handles this case with default header values. + +A successful response. +*/ +type CreateSnapshotOK struct { + Payload *models.HashicorpCloudVault20201125CreateSnapshotResponse +} + +func (o *CreateSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] createSnapshotOK %+v", 200, o.Payload) +} + +func (o *CreateSnapshotOK) GetPayload() *models.HashicorpCloudVault20201125CreateSnapshotResponse { + return o.Payload +} + +func (o *CreateSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125CreateSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSnapshotDefault creates a CreateSnapshotDefault with default headers values +func NewCreateSnapshotDefault(code int) *CreateSnapshotDefault { + return &CreateSnapshotDefault{ + _statusCode: code, + } +} + +/*CreateSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type CreateSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the create snapshot default response +func (o *CreateSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *CreateSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] CreateSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *CreateSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *CreateSnapshotDefault) 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/preview/2020-11-25/client/vault_service/delete_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_parameters.go new file mode 100644 index 00000000..a16ce98e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_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" +) + +// NewDeleteParams creates a new DeleteParams object +// with the default values initialized. +func NewDeleteParams() *DeleteParams { + var () + return &DeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteParamsWithTimeout creates a new DeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { + var () + return &DeleteParams{ + + timeout: timeout, + } +} + +// NewDeleteParamsWithContext creates a new DeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { + var () + return &DeleteParams{ + + Context: ctx, + } +} + +// NewDeleteParamsWithHTTPClient creates a new DeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { + var () + return &DeleteParams{ + HTTPClient: client, + } +} + +/*DeleteParams contains all the parameters to send to the API endpoint +for the delete operation typically these are written to a http.Request +*/ +type DeleteParams 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 delete params +func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete params +func (o *DeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete params +func (o *DeleteParams) WithContext(ctx context.Context) *DeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete params +func (o *DeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) WithHTTPClient(client *http.Client) *DeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the delete params +func (o *DeleteParams) WithClusterID(clusterID string) *DeleteParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the delete params +func (o *DeleteParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the delete params +func (o *DeleteParams) WithLocationOrganizationID(locationOrganizationID string) *DeleteParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the delete params +func (o *DeleteParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the delete params +func (o *DeleteParams) WithLocationProjectID(locationProjectID string) *DeleteParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the delete params +func (o *DeleteParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the delete params +func (o *DeleteParams) WithLocationRegionProvider(locationRegionProvider *string) *DeleteParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the delete params +func (o *DeleteParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the delete params +func (o *DeleteParams) WithLocationRegionRegion(locationRegionRegion *string) *DeleteParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the delete params +func (o *DeleteParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteParams) 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/preview/2020-11-25/client/vault_service/delete_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_responses.go new file mode 100644 index 00000000..36cdc1af --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_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/preview/2020-11-25/models" +) + +// DeleteReader is a Reader for the Delete structure. +type DeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteDefault(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 + } +} + +// NewDeleteOK creates a DeleteOK with default headers values +func NewDeleteOK() *DeleteOK { + return &DeleteOK{} +} + +/*DeleteOK handles this case with default header values. + +A successful response. +*/ +type DeleteOK struct { + Payload *models.HashicorpCloudVault20201125DeleteResponse +} + +func (o *DeleteOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] deleteOK %+v", 200, o.Payload) +} + +func (o *DeleteOK) GetPayload() *models.HashicorpCloudVault20201125DeleteResponse { + return o.Payload +} + +func (o *DeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteDefault creates a DeleteDefault with default headers values +func NewDeleteDefault(code int) *DeleteDefault { + return &DeleteDefault{ + _statusCode: code, + } +} + +/*DeleteDefault handles this case with default header values. + +An unexpected error response. +*/ +type DeleteDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the delete default response +func (o *DeleteDefault) Code() int { + return o._statusCode +} + +func (o *DeleteDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] Delete default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DeleteDefault) 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/preview/2020-11-25/client/vault_service/delete_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_snapshot_parameters.go new file mode 100644 index 00000000..54bd0ff6 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_snapshot_parameters.go @@ -0,0 +1,241 @@ +// 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" +) + +// NewDeleteSnapshotParams creates a new DeleteSnapshotParams object +// with the default values initialized. +func NewDeleteSnapshotParams() *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSnapshotParamsWithTimeout creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSnapshotParamsWithTimeout(timeout time.Duration) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + timeout: timeout, + } +} + +// NewDeleteSnapshotParamsWithContext creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSnapshotParamsWithContext(ctx context.Context) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + + Context: ctx, + } +} + +// NewDeleteSnapshotParamsWithHTTPClient creates a new DeleteSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSnapshotParamsWithHTTPClient(client *http.Client) *DeleteSnapshotParams { + var () + return &DeleteSnapshotParams{ + HTTPClient: client, + } +} + +/*DeleteSnapshotParams contains all the parameters to send to the API endpoint +for the delete snapshot operation typically these are written to a http.Request +*/ +type DeleteSnapshotParams struct { + + /*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 + /*SnapshotID + snapshot_id represents the snapshot to delete. + + */ + SnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete snapshot params +func (o *DeleteSnapshotParams) WithTimeout(timeout time.Duration) *DeleteSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete snapshot params +func (o *DeleteSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete snapshot params +func (o *DeleteSnapshotParams) WithContext(ctx context.Context) *DeleteSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete snapshot params +func (o *DeleteSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete snapshot params +func (o *DeleteSnapshotParams) WithHTTPClient(client *http.Client) *DeleteSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete snapshot params +func (o *DeleteSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *DeleteSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationProjectID(locationProjectID string) *DeleteSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationRegionProvider(locationRegionProvider *string) *DeleteSnapshotParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the delete snapshot params +func (o *DeleteSnapshotParams) WithLocationRegionRegion(locationRegionRegion *string) *DeleteSnapshotParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the delete snapshot params +func (o *DeleteSnapshotParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSnapshotID adds the snapshotID to the delete snapshot params +func (o *DeleteSnapshotParams) WithSnapshotID(snapshotID string) *DeleteSnapshotParams { + o.SetSnapshotID(snapshotID) + return o +} + +// SetSnapshotID adds the snapshotId to the delete snapshot params +func (o *DeleteSnapshotParams) SetSnapshotID(snapshotID string) { + o.SnapshotID = snapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 + } + } + + } + + // path param snapshot_id + if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_snapshot_responses.go new file mode 100644 index 00000000..7ee62ee4 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/delete_snapshot_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/preview/2020-11-25/models" +) + +// DeleteSnapshotReader is a Reader for the DeleteSnapshot structure. +type DeleteSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteSnapshotDefault(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 + } +} + +// NewDeleteSnapshotOK creates a DeleteSnapshotOK with default headers values +func NewDeleteSnapshotOK() *DeleteSnapshotOK { + return &DeleteSnapshotOK{} +} + +/*DeleteSnapshotOK handles this case with default header values. + +A successful response. +*/ +type DeleteSnapshotOK struct { + Payload *models.HashicorpCloudVault20201125DeleteSnapshotResponse +} + +func (o *DeleteSnapshotOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] deleteSnapshotOK %+v", 200, o.Payload) +} + +func (o *DeleteSnapshotOK) GetPayload() *models.HashicorpCloudVault20201125DeleteSnapshotResponse { + return o.Payload +} + +func (o *DeleteSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125DeleteSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSnapshotDefault creates a DeleteSnapshotDefault with default headers values +func NewDeleteSnapshotDefault(code int) *DeleteSnapshotDefault { + return &DeleteSnapshotDefault{ + _statusCode: code, + } +} + +/*DeleteSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type DeleteSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the delete snapshot default response +func (o *DeleteSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *DeleteSnapshotDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] DeleteSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DeleteSnapshotDefault) 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/preview/2020-11-25/client/vault_service/disable_c_o_r_s_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/disable_c_o_r_s_parameters.go new file mode 100644 index 00000000..808b726e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/disable_c_o_r_s_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" +) + +// NewDisableCORSParams creates a new DisableCORSParams object +// with the default values initialized. +func NewDisableCORSParams() *DisableCORSParams { + var () + return &DisableCORSParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDisableCORSParamsWithTimeout creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDisableCORSParamsWithTimeout(timeout time.Duration) *DisableCORSParams { + var () + return &DisableCORSParams{ + + timeout: timeout, + } +} + +// NewDisableCORSParamsWithContext creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a context for a request +func NewDisableCORSParamsWithContext(ctx context.Context) *DisableCORSParams { + var () + return &DisableCORSParams{ + + Context: ctx, + } +} + +// NewDisableCORSParamsWithHTTPClient creates a new DisableCORSParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDisableCORSParamsWithHTTPClient(client *http.Client) *DisableCORSParams { + var () + return &DisableCORSParams{ + HTTPClient: client, + } +} + +/*DisableCORSParams contains all the parameters to send to the API endpoint +for the disable c o r s operation typically these are written to a http.Request +*/ +type DisableCORSParams 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 disable c o r s params +func (o *DisableCORSParams) WithTimeout(timeout time.Duration) *DisableCORSParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the disable c o r s params +func (o *DisableCORSParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the disable c o r s params +func (o *DisableCORSParams) WithContext(ctx context.Context) *DisableCORSParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the disable c o r s params +func (o *DisableCORSParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the disable c o r s params +func (o *DisableCORSParams) WithHTTPClient(client *http.Client) *DisableCORSParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the disable c o r s params +func (o *DisableCORSParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the disable c o r s params +func (o *DisableCORSParams) WithClusterID(clusterID string) *DisableCORSParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the disable c o r s params +func (o *DisableCORSParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the disable c o r s params +func (o *DisableCORSParams) WithLocationOrganizationID(locationOrganizationID string) *DisableCORSParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the disable c o r s params +func (o *DisableCORSParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the disable c o r s params +func (o *DisableCORSParams) WithLocationProjectID(locationProjectID string) *DisableCORSParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the disable c o r s params +func (o *DisableCORSParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the disable c o r s params +func (o *DisableCORSParams) WithLocationRegionProvider(locationRegionProvider *string) *DisableCORSParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the disable c o r s params +func (o *DisableCORSParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the disable c o r s params +func (o *DisableCORSParams) WithLocationRegionRegion(locationRegionRegion *string) *DisableCORSParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the disable c o r s params +func (o *DisableCORSParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *DisableCORSParams) 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/preview/2020-11-25/client/vault_service/disable_c_o_r_s_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/disable_c_o_r_s_responses.go new file mode 100644 index 00000000..b4dda689 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/disable_c_o_r_s_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/preview/2020-11-25/models" +) + +// DisableCORSReader is a Reader for the DisableCORS structure. +type DisableCORSReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DisableCORSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDisableCORSOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDisableCORSDefault(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 + } +} + +// NewDisableCORSOK creates a DisableCORSOK with default headers values +func NewDisableCORSOK() *DisableCORSOK { + return &DisableCORSOK{} +} + +/*DisableCORSOK handles this case with default header values. + +A successful response. +*/ +type DisableCORSOK struct { + Payload models.HashicorpCloudVault20201125DisableCORSResponse +} + +func (o *DisableCORSOK) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors][%d] disableCORSOK %+v", 200, o.Payload) +} + +func (o *DisableCORSOK) GetPayload() models.HashicorpCloudVault20201125DisableCORSResponse { + return o.Payload +} + +func (o *DisableCORSOK) 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 +} + +// NewDisableCORSDefault creates a DisableCORSDefault with default headers values +func NewDisableCORSDefault(code int) *DisableCORSDefault { + return &DisableCORSDefault{ + _statusCode: code, + } +} + +/*DisableCORSDefault handles this case with default header values. + +An unexpected error response. +*/ +type DisableCORSDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the disable c o r s default response +func (o *DisableCORSDefault) Code() int { + return o._statusCode +} + +func (o *DisableCORSDefault) Error() string { + return fmt.Sprintf("[DELETE /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors][%d] DisableCORS default %+v", o._statusCode, o.Payload) +} + +func (o *DisableCORSDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *DisableCORSDefault) 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/preview/2020-11-25/client/vault_service/fetch_audit_log_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/fetch_audit_log_parameters.go new file mode 100644 index 00000000..453cfc2a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/fetch_audit_log_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/preview/2020-11-25/models" +) + +// NewFetchAuditLogParams creates a new FetchAuditLogParams object +// with the default values initialized. +func NewFetchAuditLogParams() *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFetchAuditLogParamsWithTimeout creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFetchAuditLogParamsWithTimeout(timeout time.Duration) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + timeout: timeout, + } +} + +// NewFetchAuditLogParamsWithContext creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a context for a request +func NewFetchAuditLogParamsWithContext(ctx context.Context) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + + Context: ctx, + } +} + +// NewFetchAuditLogParamsWithHTTPClient creates a new FetchAuditLogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFetchAuditLogParamsWithHTTPClient(client *http.Client) *FetchAuditLogParams { + var () + return &FetchAuditLogParams{ + HTTPClient: client, + } +} + +/*FetchAuditLogParams contains all the parameters to send to the API endpoint +for the fetch audit log operation typically these are written to a http.Request +*/ +type FetchAuditLogParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125FetchAuditLogRequest + /*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 fetch audit log params +func (o *FetchAuditLogParams) WithTimeout(timeout time.Duration) *FetchAuditLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the fetch audit log params +func (o *FetchAuditLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the fetch audit log params +func (o *FetchAuditLogParams) WithContext(ctx context.Context) *FetchAuditLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the fetch audit log params +func (o *FetchAuditLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the fetch audit log params +func (o *FetchAuditLogParams) WithHTTPClient(client *http.Client) *FetchAuditLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the fetch audit log params +func (o *FetchAuditLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the fetch audit log params +func (o *FetchAuditLogParams) WithBody(body *models.HashicorpCloudVault20201125FetchAuditLogRequest) *FetchAuditLogParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the fetch audit log params +func (o *FetchAuditLogParams) SetBody(body *models.HashicorpCloudVault20201125FetchAuditLogRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the fetch audit log params +func (o *FetchAuditLogParams) WithClusterID(clusterID string) *FetchAuditLogParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the fetch audit log params +func (o *FetchAuditLogParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the fetch audit log params +func (o *FetchAuditLogParams) WithLocationOrganizationID(locationOrganizationID string) *FetchAuditLogParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the fetch audit log params +func (o *FetchAuditLogParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the fetch audit log params +func (o *FetchAuditLogParams) WithLocationProjectID(locationProjectID string) *FetchAuditLogParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the fetch audit log params +func (o *FetchAuditLogParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *FetchAuditLogParams) 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/preview/2020-11-25/client/vault_service/fetch_audit_log_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/fetch_audit_log_responses.go new file mode 100644 index 00000000..e95a272e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/fetch_audit_log_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/preview/2020-11-25/models" +) + +// FetchAuditLogReader is a Reader for the FetchAuditLog structure. +type FetchAuditLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FetchAuditLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFetchAuditLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFetchAuditLogDefault(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 + } +} + +// NewFetchAuditLogOK creates a FetchAuditLogOK with default headers values +func NewFetchAuditLogOK() *FetchAuditLogOK { + return &FetchAuditLogOK{} +} + +/*FetchAuditLogOK handles this case with default header values. + +A successful response. +*/ +type FetchAuditLogOK struct { + Payload *models.HashicorpCloudVault20201125FetchAuditLogResponse +} + +func (o *FetchAuditLogOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog][%d] fetchAuditLogOK %+v", 200, o.Payload) +} + +func (o *FetchAuditLogOK) GetPayload() *models.HashicorpCloudVault20201125FetchAuditLogResponse { + return o.Payload +} + +func (o *FetchAuditLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125FetchAuditLogResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFetchAuditLogDefault creates a FetchAuditLogDefault with default headers values +func NewFetchAuditLogDefault(code int) *FetchAuditLogDefault { + return &FetchAuditLogDefault{ + _statusCode: code, + } +} + +/*FetchAuditLogDefault handles this case with default header values. + +An unexpected error response. +*/ +type FetchAuditLogDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the fetch audit log default response +func (o *FetchAuditLogDefault) Code() int { + return o._statusCode +} + +func (o *FetchAuditLogDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog][%d] FetchAuditLog default %+v", o._statusCode, o.Payload) +} + +func (o *FetchAuditLogDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *FetchAuditLogDefault) 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/preview/2020-11-25/client/vault_service/get_admin_token_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_admin_token_parameters.go new file mode 100644 index 00000000..9d4bb39a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_admin_token_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" +) + +// NewGetAdminTokenParams creates a new GetAdminTokenParams object +// with the default values initialized. +func NewGetAdminTokenParams() *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAdminTokenParamsWithTimeout creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAdminTokenParamsWithTimeout(timeout time.Duration) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + timeout: timeout, + } +} + +// NewGetAdminTokenParamsWithContext creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAdminTokenParamsWithContext(ctx context.Context) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + + Context: ctx, + } +} + +// NewGetAdminTokenParamsWithHTTPClient creates a new GetAdminTokenParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAdminTokenParamsWithHTTPClient(client *http.Client) *GetAdminTokenParams { + var () + return &GetAdminTokenParams{ + HTTPClient: client, + } +} + +/*GetAdminTokenParams contains all the parameters to send to the API endpoint +for the get admin token operation typically these are written to a http.Request +*/ +type GetAdminTokenParams 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 admin token params +func (o *GetAdminTokenParams) WithTimeout(timeout time.Duration) *GetAdminTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get admin token params +func (o *GetAdminTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get admin token params +func (o *GetAdminTokenParams) WithContext(ctx context.Context) *GetAdminTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get admin token params +func (o *GetAdminTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get admin token params +func (o *GetAdminTokenParams) WithHTTPClient(client *http.Client) *GetAdminTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get admin token params +func (o *GetAdminTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get admin token params +func (o *GetAdminTokenParams) WithClusterID(clusterID string) *GetAdminTokenParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get admin token params +func (o *GetAdminTokenParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get admin token params +func (o *GetAdminTokenParams) WithLocationOrganizationID(locationOrganizationID string) *GetAdminTokenParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get admin token params +func (o *GetAdminTokenParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get admin token params +func (o *GetAdminTokenParams) WithLocationProjectID(locationProjectID string) *GetAdminTokenParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get admin token params +func (o *GetAdminTokenParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get admin token params +func (o *GetAdminTokenParams) WithLocationRegionProvider(locationRegionProvider *string) *GetAdminTokenParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get admin token params +func (o *GetAdminTokenParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get admin token params +func (o *GetAdminTokenParams) WithLocationRegionRegion(locationRegionRegion *string) *GetAdminTokenParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get admin token params +func (o *GetAdminTokenParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAdminTokenParams) 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/preview/2020-11-25/client/vault_service/get_admin_token_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_admin_token_responses.go new file mode 100644 index 00000000..c2097167 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_admin_token_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/preview/2020-11-25/models" +) + +// GetAdminTokenReader is a Reader for the GetAdminToken structure. +type GetAdminTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAdminTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAdminTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAdminTokenDefault(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 + } +} + +// NewGetAdminTokenOK creates a GetAdminTokenOK with default headers values +func NewGetAdminTokenOK() *GetAdminTokenOK { + return &GetAdminTokenOK{} +} + +/*GetAdminTokenOK handles this case with default header values. + +A successful response. +*/ +type GetAdminTokenOK struct { + Payload *models.HashicorpCloudVault20201125GetAdminTokenResponse +} + +func (o *GetAdminTokenOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken][%d] getAdminTokenOK %+v", 200, o.Payload) +} + +func (o *GetAdminTokenOK) GetPayload() *models.HashicorpCloudVault20201125GetAdminTokenResponse { + return o.Payload +} + +func (o *GetAdminTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetAdminTokenResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAdminTokenDefault creates a GetAdminTokenDefault with default headers values +func NewGetAdminTokenDefault(code int) *GetAdminTokenDefault { + return &GetAdminTokenDefault{ + _statusCode: code, + } +} + +/*GetAdminTokenDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetAdminTokenDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get admin token default response +func (o *GetAdminTokenDefault) Code() int { + return o._statusCode +} + +func (o *GetAdminTokenDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken][%d] GetAdminToken default %+v", o._statusCode, o.Payload) +} + +func (o *GetAdminTokenDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetAdminTokenDefault) 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/preview/2020-11-25/client/vault_service/get_audit_log_status_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_audit_log_status_parameters.go new file mode 100644 index 00000000..1109cbd1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_audit_log_status_parameters.go @@ -0,0 +1,256 @@ +// 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" +) + +// NewGetAuditLogStatusParams creates a new GetAuditLogStatusParams object +// with the default values initialized. +func NewGetAuditLogStatusParams() *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAuditLogStatusParamsWithTimeout creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAuditLogStatusParamsWithTimeout(timeout time.Duration) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + timeout: timeout, + } +} + +// NewGetAuditLogStatusParamsWithContext creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAuditLogStatusParamsWithContext(ctx context.Context) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + + Context: ctx, + } +} + +// NewGetAuditLogStatusParamsWithHTTPClient creates a new GetAuditLogStatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAuditLogStatusParamsWithHTTPClient(client *http.Client) *GetAuditLogStatusParams { + var () + return &GetAuditLogStatusParams{ + HTTPClient: client, + } +} + +/*GetAuditLogStatusParams contains all the parameters to send to the API endpoint +for the get audit log status operation typically these are written to a http.Request +*/ +type GetAuditLogStatusParams 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 + /*LogID*/ + LogID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get audit log status params +func (o *GetAuditLogStatusParams) WithTimeout(timeout time.Duration) *GetAuditLogStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get audit log status params +func (o *GetAuditLogStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get audit log status params +func (o *GetAuditLogStatusParams) WithContext(ctx context.Context) *GetAuditLogStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get audit log status params +func (o *GetAuditLogStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get audit log status params +func (o *GetAuditLogStatusParams) WithHTTPClient(client *http.Client) *GetAuditLogStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get audit log status params +func (o *GetAuditLogStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get audit log status params +func (o *GetAuditLogStatusParams) WithClusterID(clusterID string) *GetAuditLogStatusParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get audit log status params +func (o *GetAuditLogStatusParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationOrganizationID(locationOrganizationID string) *GetAuditLogStatusParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationProjectID(locationProjectID string) *GetAuditLogStatusParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationRegionProvider(locationRegionProvider *string) *GetAuditLogStatusParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get audit log status params +func (o *GetAuditLogStatusParams) WithLocationRegionRegion(locationRegionRegion *string) *GetAuditLogStatusParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get audit log status params +func (o *GetAuditLogStatusParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithLogID adds the logID to the get audit log status params +func (o *GetAuditLogStatusParams) WithLogID(logID string) *GetAuditLogStatusParams { + o.SetLogID(logID) + return o +} + +// SetLogID adds the logId to the get audit log status params +func (o *GetAuditLogStatusParams) SetLogID(logID string) { + o.LogID = logID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAuditLogStatusParams) 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 + } + } + + } + + // path param log_id + if err := r.SetPathParam("log_id", o.LogID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_audit_log_status_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_audit_log_status_responses.go new file mode 100644 index 00000000..5e9193df --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_audit_log_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/preview/2020-11-25/models" +) + +// GetAuditLogStatusReader is a Reader for the GetAuditLogStatus structure. +type GetAuditLogStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAuditLogStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAuditLogStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAuditLogStatusDefault(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 + } +} + +// NewGetAuditLogStatusOK creates a GetAuditLogStatusOK with default headers values +func NewGetAuditLogStatusOK() *GetAuditLogStatusOK { + return &GetAuditLogStatusOK{} +} + +/*GetAuditLogStatusOK handles this case with default header values. + +A successful response. +*/ +type GetAuditLogStatusOK struct { + Payload *models.HashicorpCloudVault20201125GetAuditLogStatusResponse +} + +func (o *GetAuditLogStatusOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}][%d] getAuditLogStatusOK %+v", 200, o.Payload) +} + +func (o *GetAuditLogStatusOK) GetPayload() *models.HashicorpCloudVault20201125GetAuditLogStatusResponse { + return o.Payload +} + +func (o *GetAuditLogStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetAuditLogStatusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuditLogStatusDefault creates a GetAuditLogStatusDefault with default headers values +func NewGetAuditLogStatusDefault(code int) *GetAuditLogStatusDefault { + return &GetAuditLogStatusDefault{ + _statusCode: code, + } +} + +/*GetAuditLogStatusDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetAuditLogStatusDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get audit log status default response +func (o *GetAuditLogStatusDefault) Code() int { + return o._statusCode +} + +func (o *GetAuditLogStatusDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}][%d] GetAuditLogStatus default %+v", o._statusCode, o.Payload) +} + +func (o *GetAuditLogStatusDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetAuditLogStatusDefault) 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/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_parameters.go new file mode 100644 index 00000000..bf4c709e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_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" +) + +// NewGetCORSConfigParams creates a new GetCORSConfigParams object +// with the default values initialized. +func NewGetCORSConfigParams() *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCORSConfigParamsWithTimeout creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCORSConfigParamsWithTimeout(timeout time.Duration) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + timeout: timeout, + } +} + +// NewGetCORSConfigParamsWithContext creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCORSConfigParamsWithContext(ctx context.Context) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + + Context: ctx, + } +} + +// NewGetCORSConfigParamsWithHTTPClient creates a new GetCORSConfigParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCORSConfigParamsWithHTTPClient(client *http.Client) *GetCORSConfigParams { + var () + return &GetCORSConfigParams{ + HTTPClient: client, + } +} + +/*GetCORSConfigParams contains all the parameters to send to the API endpoint +for the get c o r s config operation typically these are written to a http.Request +*/ +type GetCORSConfigParams 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 c o r s config params +func (o *GetCORSConfigParams) WithTimeout(timeout time.Duration) *GetCORSConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get c o r s config params +func (o *GetCORSConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get c o r s config params +func (o *GetCORSConfigParams) WithContext(ctx context.Context) *GetCORSConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get c o r s config params +func (o *GetCORSConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get c o r s config params +func (o *GetCORSConfigParams) WithHTTPClient(client *http.Client) *GetCORSConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get c o r s config params +func (o *GetCORSConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get c o r s config params +func (o *GetCORSConfigParams) WithClusterID(clusterID string) *GetCORSConfigParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get c o r s config params +func (o *GetCORSConfigParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationOrganizationID(locationOrganizationID string) *GetCORSConfigParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationProjectID(locationProjectID string) *GetCORSConfigParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationRegionProvider(locationRegionProvider *string) *GetCORSConfigParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get c o r s config params +func (o *GetCORSConfigParams) WithLocationRegionRegion(locationRegionRegion *string) *GetCORSConfigParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get c o r s config params +func (o *GetCORSConfigParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCORSConfigParams) 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/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_responses.go new file mode 100644 index 00000000..653b365b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_c_o_r_s_config_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/preview/2020-11-25/models" +) + +// GetCORSConfigReader is a Reader for the GetCORSConfig structure. +type GetCORSConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCORSConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCORSConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetCORSConfigDefault(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 + } +} + +// NewGetCORSConfigOK creates a GetCORSConfigOK with default headers values +func NewGetCORSConfigOK() *GetCORSConfigOK { + return &GetCORSConfigOK{} +} + +/*GetCORSConfigOK handles this case with default header values. + +A successful response. +*/ +type GetCORSConfigOK struct { + Payload *models.HashicorpCloudVault20201125GetCORSConfigResponse +} + +func (o *GetCORSConfigOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config][%d] getCORSConfigOK %+v", 200, o.Payload) +} + +func (o *GetCORSConfigOK) GetPayload() *models.HashicorpCloudVault20201125GetCORSConfigResponse { + return o.Payload +} + +func (o *GetCORSConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetCORSConfigResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCORSConfigDefault creates a GetCORSConfigDefault with default headers values +func NewGetCORSConfigDefault(code int) *GetCORSConfigDefault { + return &GetCORSConfigDefault{ + _statusCode: code, + } +} + +/*GetCORSConfigDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetCORSConfigDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get c o r s config default response +func (o *GetCORSConfigDefault) Code() int { + return o._statusCode +} + +func (o *GetCORSConfigDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config][%d] GetCORSConfig default %+v", o._statusCode, o.Payload) +} + +func (o *GetCORSConfigDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetCORSConfigDefault) 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/preview/2020-11-25/client/vault_service/get_client_counts_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_client_counts_parameters.go new file mode 100644 index 00000000..dd2bdc4e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_client_counts_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" +) + +// NewGetClientCountsParams creates a new GetClientCountsParams object +// with the default values initialized. +func NewGetClientCountsParams() *GetClientCountsParams { + var () + return &GetClientCountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClientCountsParamsWithTimeout creates a new GetClientCountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClientCountsParamsWithTimeout(timeout time.Duration) *GetClientCountsParams { + var () + return &GetClientCountsParams{ + + timeout: timeout, + } +} + +// NewGetClientCountsParamsWithContext creates a new GetClientCountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClientCountsParamsWithContext(ctx context.Context) *GetClientCountsParams { + var () + return &GetClientCountsParams{ + + Context: ctx, + } +} + +// NewGetClientCountsParamsWithHTTPClient creates a new GetClientCountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClientCountsParamsWithHTTPClient(client *http.Client) *GetClientCountsParams { + var () + return &GetClientCountsParams{ + HTTPClient: client, + } +} + +/*GetClientCountsParams contains all the parameters to send to the API endpoint +for the get client counts operation typically these are written to a http.Request +*/ +type GetClientCountsParams 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 client counts params +func (o *GetClientCountsParams) WithTimeout(timeout time.Duration) *GetClientCountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get client counts params +func (o *GetClientCountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get client counts params +func (o *GetClientCountsParams) WithContext(ctx context.Context) *GetClientCountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get client counts params +func (o *GetClientCountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get client counts params +func (o *GetClientCountsParams) WithHTTPClient(client *http.Client) *GetClientCountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get client counts params +func (o *GetClientCountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get client counts params +func (o *GetClientCountsParams) WithClusterID(clusterID string) *GetClientCountsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get client counts params +func (o *GetClientCountsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get client counts params +func (o *GetClientCountsParams) WithLocationOrganizationID(locationOrganizationID string) *GetClientCountsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get client counts params +func (o *GetClientCountsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get client counts params +func (o *GetClientCountsParams) WithLocationProjectID(locationProjectID string) *GetClientCountsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get client counts params +func (o *GetClientCountsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get client counts params +func (o *GetClientCountsParams) WithLocationRegionProvider(locationRegionProvider *string) *GetClientCountsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get client counts params +func (o *GetClientCountsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get client counts params +func (o *GetClientCountsParams) WithLocationRegionRegion(locationRegionRegion *string) *GetClientCountsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get client counts params +func (o *GetClientCountsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClientCountsParams) 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/preview/2020-11-25/client/vault_service/get_client_counts_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_client_counts_responses.go new file mode 100644 index 00000000..a745aad3 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_client_counts_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/preview/2020-11-25/models" +) + +// GetClientCountsReader is a Reader for the GetClientCounts structure. +type GetClientCountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClientCountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClientCountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClientCountsDefault(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 + } +} + +// NewGetClientCountsOK creates a GetClientCountsOK with default headers values +func NewGetClientCountsOK() *GetClientCountsOK { + return &GetClientCountsOK{} +} + +/*GetClientCountsOK handles this case with default header values. + +A successful response. +*/ +type GetClientCountsOK struct { + Payload *models.HashicorpCloudVault20201125GetClientCountsResponse +} + +func (o *GetClientCountsOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/clients][%d] getClientCountsOK %+v", 200, o.Payload) +} + +func (o *GetClientCountsOK) GetPayload() *models.HashicorpCloudVault20201125GetClientCountsResponse { + return o.Payload +} + +func (o *GetClientCountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetClientCountsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClientCountsDefault creates a GetClientCountsDefault with default headers values +func NewGetClientCountsDefault(code int) *GetClientCountsDefault { + return &GetClientCountsDefault{ + _statusCode: code, + } +} + +/*GetClientCountsDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetClientCountsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get client counts default response +func (o *GetClientCountsDefault) Code() int { + return o._statusCode +} + +func (o *GetClientCountsDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/clients][%d] GetClientCounts default %+v", o._statusCode, o.Payload) +} + +func (o *GetClientCountsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetClientCountsDefault) 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/preview/2020-11-25/client/vault_service/get_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_parameters.go new file mode 100644 index 00000000..db0ce6f1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_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" +) + +// NewGetParams creates a new GetParams object +// with the default values initialized. +func NewGetParams() *GetParams { + var () + return &GetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetParamsWithTimeout creates a new GetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { + var () + return &GetParams{ + + timeout: timeout, + } +} + +// NewGetParamsWithContext creates a new GetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetParamsWithContext(ctx context.Context) *GetParams { + var () + return &GetParams{ + + Context: ctx, + } +} + +// NewGetParamsWithHTTPClient creates a new GetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { + var () + return &GetParams{ + HTTPClient: client, + } +} + +/*GetParams contains all the parameters to send to the API endpoint +for the get operation typically these are written to a http.Request +*/ +type GetParams 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 params +func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get params +func (o *GetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get params +func (o *GetParams) WithContext(ctx context.Context) *GetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get params +func (o *GetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get params +func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get params +func (o *GetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get params +func (o *GetParams) WithClusterID(clusterID string) *GetParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get params +func (o *GetParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get params +func (o *GetParams) WithLocationOrganizationID(locationOrganizationID string) *GetParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get params +func (o *GetParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get params +func (o *GetParams) WithLocationProjectID(locationProjectID string) *GetParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get params +func (o *GetParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get params +func (o *GetParams) WithLocationRegionProvider(locationRegionProvider *string) *GetParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get params +func (o *GetParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get params +func (o *GetParams) WithLocationRegionRegion(locationRegionRegion *string) *GetParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get params +func (o *GetParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetParams) 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/preview/2020-11-25/client/vault_service/get_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_responses.go new file mode 100644 index 00000000..e07a8b17 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_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/preview/2020-11-25/models" +) + +// GetReader is a Reader for the Get structure. +type GetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetDefault(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 + } +} + +// NewGetOK creates a GetOK with default headers values +func NewGetOK() *GetOK { + return &GetOK{} +} + +/*GetOK handles this case with default header values. + +A successful response. +*/ +type GetOK struct { + Payload *models.HashicorpCloudVault20201125GetResponse +} + +func (o *GetOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] getOK %+v", 200, o.Payload) +} + +func (o *GetOK) GetPayload() *models.HashicorpCloudVault20201125GetResponse { + return o.Payload +} + +func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDefault creates a GetDefault with default headers values +func NewGetDefault(code int) *GetDefault { + return &GetDefault{ + _statusCode: code, + } +} + +/*GetDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get default response +func (o *GetDefault) Code() int { + return o._statusCode +} + +func (o *GetDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}][%d] Get default %+v", o._statusCode, o.Payload) +} + +func (o *GetDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetDefault) 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/preview/2020-11-25/client/vault_service/get_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_snapshot_parameters.go new file mode 100644 index 00000000..04ba7097 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_snapshot_parameters.go @@ -0,0 +1,241 @@ +// 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" +) + +// NewGetSnapshotParams creates a new GetSnapshotParams object +// with the default values initialized. +func NewGetSnapshotParams() *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSnapshotParamsWithTimeout creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSnapshotParamsWithTimeout(timeout time.Duration) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + timeout: timeout, + } +} + +// NewGetSnapshotParamsWithContext creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSnapshotParamsWithContext(ctx context.Context) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + + Context: ctx, + } +} + +// NewGetSnapshotParamsWithHTTPClient creates a new GetSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSnapshotParamsWithHTTPClient(client *http.Client) *GetSnapshotParams { + var () + return &GetSnapshotParams{ + HTTPClient: client, + } +} + +/*GetSnapshotParams contains all the parameters to send to the API endpoint +for the get snapshot operation typically these are written to a http.Request +*/ +type GetSnapshotParams struct { + + /*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 + /*SnapshotID + snapshot_id represents the snapshot to get. + + */ + SnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get snapshot params +func (o *GetSnapshotParams) WithTimeout(timeout time.Duration) *GetSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get snapshot params +func (o *GetSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get snapshot params +func (o *GetSnapshotParams) WithContext(ctx context.Context) *GetSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get snapshot params +func (o *GetSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get snapshot params +func (o *GetSnapshotParams) WithHTTPClient(client *http.Client) *GetSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get snapshot params +func (o *GetSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get snapshot params +func (o *GetSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *GetSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get snapshot params +func (o *GetSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get snapshot params +func (o *GetSnapshotParams) WithLocationProjectID(locationProjectID string) *GetSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get snapshot params +func (o *GetSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get snapshot params +func (o *GetSnapshotParams) WithLocationRegionProvider(locationRegionProvider *string) *GetSnapshotParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get snapshot params +func (o *GetSnapshotParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get snapshot params +func (o *GetSnapshotParams) WithLocationRegionRegion(locationRegionRegion *string) *GetSnapshotParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get snapshot params +func (o *GetSnapshotParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSnapshotID adds the snapshotID to the get snapshot params +func (o *GetSnapshotParams) WithSnapshotID(snapshotID string) *GetSnapshotParams { + o.SetSnapshotID(snapshotID) + return o +} + +// SetSnapshotID adds the snapshotId to the get snapshot params +func (o *GetSnapshotParams) SetSnapshotID(snapshotID string) { + o.SnapshotID = snapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 + } + } + + } + + // path param snapshot_id + if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_snapshot_responses.go new file mode 100644 index 00000000..590b73b9 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/get_snapshot_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/preview/2020-11-25/models" +) + +// GetSnapshotReader is a Reader for the GetSnapshot structure. +type GetSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetSnapshotDefault(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 + } +} + +// NewGetSnapshotOK creates a GetSnapshotOK with default headers values +func NewGetSnapshotOK() *GetSnapshotOK { + return &GetSnapshotOK{} +} + +/*GetSnapshotOK handles this case with default header values. + +A successful response. +*/ +type GetSnapshotOK struct { + Payload *models.HashicorpCloudVault20201125GetSnapshotResponse +} + +func (o *GetSnapshotOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] getSnapshotOK %+v", 200, o.Payload) +} + +func (o *GetSnapshotOK) GetPayload() *models.HashicorpCloudVault20201125GetSnapshotResponse { + return o.Payload +} + +func (o *GetSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125GetSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSnapshotDefault creates a GetSnapshotDefault with default headers values +func NewGetSnapshotDefault(code int) *GetSnapshotDefault { + return &GetSnapshotDefault{ + _statusCode: code, + } +} + +/*GetSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type GetSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the get snapshot default response +func (o *GetSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *GetSnapshotDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}][%d] GetSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *GetSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *GetSnapshotDefault) 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/preview/2020-11-25/client/vault_service/list_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_parameters.go new file mode 100644 index 00000000..90c2f185 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_parameters.go @@ -0,0 +1,324 @@ +// 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/go-openapi/swag" +) + +// NewListParams creates a new ListParams object +// with the default values initialized. +func NewListParams() *ListParams { + var () + return &ListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListParamsWithTimeout creates a new ListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListParamsWithTimeout(timeout time.Duration) *ListParams { + var () + return &ListParams{ + + timeout: timeout, + } +} + +// NewListParamsWithContext creates a new ListParams object +// with the default values initialized, and the ability to set a context for a request +func NewListParamsWithContext(ctx context.Context) *ListParams { + var () + return &ListParams{ + + Context: ctx, + } +} + +// NewListParamsWithHTTPClient creates a new ListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListParamsWithHTTPClient(client *http.Client) *ListParams { + var () + return &ListParams{ + HTTPClient: client, + } +} + +/*ListParams contains all the parameters to send to the API endpoint +for the list operation typically these are written to a http.Request +*/ +type ListParams struct { + + /*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 + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list params +func (o *ListParams) WithTimeout(timeout time.Duration) *ListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list params +func (o *ListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list params +func (o *ListParams) WithContext(ctx context.Context) *ListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list params +func (o *ListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list params +func (o *ListParams) WithHTTPClient(client *http.Client) *ListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list params +func (o *ListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the list params +func (o *ListParams) WithLocationOrganizationID(locationOrganizationID string) *ListParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the list params +func (o *ListParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the list params +func (o *ListParams) WithLocationProjectID(locationProjectID string) *ListParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the list params +func (o *ListParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the list params +func (o *ListParams) WithLocationRegionProvider(locationRegionProvider *string) *ListParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the list params +func (o *ListParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the list params +func (o *ListParams) WithLocationRegionRegion(locationRegionRegion *string) *ListParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the list params +func (o *ListParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list params +func (o *ListParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list params +func (o *ListParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list params +func (o *ListParams) WithPaginationPageSize(paginationPageSize *int64) *ListParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list params +func (o *ListParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list params +func (o *ListParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list params +func (o *ListParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WriteToRequest writes these params to a swagger request +func (o *ListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // 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 o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_responses.go new file mode 100644 index 00000000..9511c4a3 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_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/preview/2020-11-25/models" +) + +// ListReader is a Reader for the List structure. +type ListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListDefault(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 + } +} + +// NewListOK creates a ListOK with default headers values +func NewListOK() *ListOK { + return &ListOK{} +} + +/*ListOK handles this case with default header values. + +A successful response. +*/ +type ListOK struct { + Payload *models.HashicorpCloudVault20201125ListResponse +} + +func (o *ListOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters][%d] listOK %+v", 200, o.Payload) +} + +func (o *ListOK) GetPayload() *models.HashicorpCloudVault20201125ListResponse { + return o.Payload +} + +func (o *ListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125ListResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListDefault creates a ListDefault with default headers values +func NewListDefault(code int) *ListDefault { + return &ListDefault{ + _statusCode: code, + } +} + +/*ListDefault handles this case with default header values. + +An unexpected error response. +*/ +type ListDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the list default response +func (o *ListDefault) Code() int { + return o._statusCode +} + +func (o *ListDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters][%d] List default %+v", o._statusCode, o.Payload) +} + +func (o *ListDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *ListDefault) 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/preview/2020-11-25/client/vault_service/list_snapshots_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_snapshots_parameters.go new file mode 100644 index 00000000..a80b180e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_snapshots_parameters.go @@ -0,0 +1,456 @@ +// 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/go-openapi/swag" +) + +// NewListSnapshotsParams creates a new ListSnapshotsParams object +// with the default values initialized. +func NewListSnapshotsParams() *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListSnapshotsParamsWithTimeout creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListSnapshotsParamsWithTimeout(timeout time.Duration) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + timeout: timeout, + } +} + +// NewListSnapshotsParamsWithContext creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListSnapshotsParamsWithContext(ctx context.Context) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + + Context: ctx, + } +} + +// NewListSnapshotsParamsWithHTTPClient creates a new ListSnapshotsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListSnapshotsParamsWithHTTPClient(client *http.Client) *ListSnapshotsParams { + var () + return &ListSnapshotsParams{ + HTTPClient: client, + } +} + +/*ListSnapshotsParams contains all the parameters to send to the API endpoint +for the list snapshots operation typically these are written to a http.Request +*/ +type ListSnapshotsParams struct { + + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*ResourceDescription + description is a human-friendly description for this link. This is + used primarily for informational purposes such as error messages. + + */ + ResourceDescription *string + /*ResourceID + id is the identifier for this resource. + + */ + ResourceID *string + /*ResourceLocationOrganizationID + organization_id is the id of the organization. + + */ + ResourceLocationOrganizationID string + /*ResourceLocationProjectID + project_id is the projects id. + + */ + ResourceLocationProjectID string + /*ResourceLocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + ResourceLocationRegionProvider *string + /*ResourceLocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + ResourceLocationRegionRegion *string + /*ResourceType + type is the unique type of the resource. Each service publishes a + unique set of types. The type value is recommended to be formatted + in "." such as "hashicorp.hvn". This is to prevent conflicts + in the future, but any string value will work. + + */ + ResourceType *string + /*ResourceUUID + uuid is the unique UUID for this resource. + + */ + ResourceUUID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list snapshots params +func (o *ListSnapshotsParams) WithTimeout(timeout time.Duration) *ListSnapshotsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list snapshots params +func (o *ListSnapshotsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list snapshots params +func (o *ListSnapshotsParams) WithContext(ctx context.Context) *ListSnapshotsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list snapshots params +func (o *ListSnapshotsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list snapshots params +func (o *ListSnapshotsParams) WithHTTPClient(client *http.Client) *ListSnapshotsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list snapshots params +func (o *ListSnapshotsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListSnapshotsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationPageSize(paginationPageSize *int64) *ListSnapshotsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list snapshots params +func (o *ListSnapshotsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListSnapshotsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list snapshots params +func (o *ListSnapshotsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithResourceDescription adds the resourceDescription to the list snapshots params +func (o *ListSnapshotsParams) WithResourceDescription(resourceDescription *string) *ListSnapshotsParams { + o.SetResourceDescription(resourceDescription) + return o +} + +// SetResourceDescription adds the resourceDescription to the list snapshots params +func (o *ListSnapshotsParams) SetResourceDescription(resourceDescription *string) { + o.ResourceDescription = resourceDescription +} + +// WithResourceID adds the resourceID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceID(resourceID *string) *ListSnapshotsParams { + o.SetResourceID(resourceID) + return o +} + +// SetResourceID adds the resourceId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceID(resourceID *string) { + o.ResourceID = resourceID +} + +// WithResourceLocationOrganizationID adds the resourceLocationOrganizationID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationOrganizationID(resourceLocationOrganizationID string) *ListSnapshotsParams { + o.SetResourceLocationOrganizationID(resourceLocationOrganizationID) + return o +} + +// SetResourceLocationOrganizationID adds the resourceLocationOrganizationId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationOrganizationID(resourceLocationOrganizationID string) { + o.ResourceLocationOrganizationID = resourceLocationOrganizationID +} + +// WithResourceLocationProjectID adds the resourceLocationProjectID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationProjectID(resourceLocationProjectID string) *ListSnapshotsParams { + o.SetResourceLocationProjectID(resourceLocationProjectID) + return o +} + +// SetResourceLocationProjectID adds the resourceLocationProjectId to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationProjectID(resourceLocationProjectID string) { + o.ResourceLocationProjectID = resourceLocationProjectID +} + +// WithResourceLocationRegionProvider adds the resourceLocationRegionProvider to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationRegionProvider(resourceLocationRegionProvider *string) *ListSnapshotsParams { + o.SetResourceLocationRegionProvider(resourceLocationRegionProvider) + return o +} + +// SetResourceLocationRegionProvider adds the resourceLocationRegionProvider to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationRegionProvider(resourceLocationRegionProvider *string) { + o.ResourceLocationRegionProvider = resourceLocationRegionProvider +} + +// WithResourceLocationRegionRegion adds the resourceLocationRegionRegion to the list snapshots params +func (o *ListSnapshotsParams) WithResourceLocationRegionRegion(resourceLocationRegionRegion *string) *ListSnapshotsParams { + o.SetResourceLocationRegionRegion(resourceLocationRegionRegion) + return o +} + +// SetResourceLocationRegionRegion adds the resourceLocationRegionRegion to the list snapshots params +func (o *ListSnapshotsParams) SetResourceLocationRegionRegion(resourceLocationRegionRegion *string) { + o.ResourceLocationRegionRegion = resourceLocationRegionRegion +} + +// WithResourceType adds the resourceType to the list snapshots params +func (o *ListSnapshotsParams) WithResourceType(resourceType *string) *ListSnapshotsParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the list snapshots params +func (o *ListSnapshotsParams) SetResourceType(resourceType *string) { + o.ResourceType = resourceType +} + +// WithResourceUUID adds the resourceUUID to the list snapshots params +func (o *ListSnapshotsParams) WithResourceUUID(resourceUUID *string) *ListSnapshotsParams { + o.SetResourceUUID(resourceUUID) + return o +} + +// SetResourceUUID adds the resourceUuid to the list snapshots params +func (o *ListSnapshotsParams) SetResourceUUID(resourceUUID *string) { + o.ResourceUUID = resourceUUID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if o.ResourceDescription != nil { + + // query param resource.description + var qrResourceDescription string + if o.ResourceDescription != nil { + qrResourceDescription = *o.ResourceDescription + } + qResourceDescription := qrResourceDescription + if qResourceDescription != "" { + if err := r.SetQueryParam("resource.description", qResourceDescription); err != nil { + return err + } + } + + } + + if o.ResourceID != nil { + + // query param resource.id + var qrResourceID string + if o.ResourceID != nil { + qrResourceID = *o.ResourceID + } + qResourceID := qrResourceID + if qResourceID != "" { + if err := r.SetQueryParam("resource.id", qResourceID); err != nil { + return err + } + } + + } + + // path param resource.location.organization_id + if err := r.SetPathParam("resource.location.organization_id", o.ResourceLocationOrganizationID); err != nil { + return err + } + + // path param resource.location.project_id + if err := r.SetPathParam("resource.location.project_id", o.ResourceLocationProjectID); err != nil { + return err + } + + if o.ResourceLocationRegionProvider != nil { + + // query param resource.location.region.provider + var qrResourceLocationRegionProvider string + if o.ResourceLocationRegionProvider != nil { + qrResourceLocationRegionProvider = *o.ResourceLocationRegionProvider + } + qResourceLocationRegionProvider := qrResourceLocationRegionProvider + if qResourceLocationRegionProvider != "" { + if err := r.SetQueryParam("resource.location.region.provider", qResourceLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.ResourceLocationRegionRegion != nil { + + // query param resource.location.region.region + var qrResourceLocationRegionRegion string + if o.ResourceLocationRegionRegion != nil { + qrResourceLocationRegionRegion = *o.ResourceLocationRegionRegion + } + qResourceLocationRegionRegion := qrResourceLocationRegionRegion + if qResourceLocationRegionRegion != "" { + if err := r.SetQueryParam("resource.location.region.region", qResourceLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.ResourceType != nil { + + // query param resource.type + var qrResourceType string + if o.ResourceType != nil { + qrResourceType = *o.ResourceType + } + qResourceType := qrResourceType + if qResourceType != "" { + if err := r.SetQueryParam("resource.type", qResourceType); err != nil { + return err + } + } + + } + + if o.ResourceUUID != nil { + + // query param resource.uuid + var qrResourceUUID string + if o.ResourceUUID != nil { + qrResourceUUID = *o.ResourceUUID + } + qResourceUUID := qrResourceUUID + if qResourceUUID != "" { + if err := r.SetQueryParam("resource.uuid", qResourceUUID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_snapshots_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_snapshots_responses.go new file mode 100644 index 00000000..7d1625da --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/list_snapshots_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/preview/2020-11-25/models" +) + +// ListSnapshotsReader is a Reader for the ListSnapshots structure. +type ListSnapshotsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSnapshotsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSnapshotsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListSnapshotsDefault(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 + } +} + +// NewListSnapshotsOK creates a ListSnapshotsOK with default headers values +func NewListSnapshotsOK() *ListSnapshotsOK { + return &ListSnapshotsOK{} +} + +/*ListSnapshotsOK handles this case with default header values. + +A successful response. +*/ +type ListSnapshotsOK struct { + Payload *models.HashicorpCloudVault20201125ListSnapshotsResponse +} + +func (o *ListSnapshotsOK) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] listSnapshotsOK %+v", 200, o.Payload) +} + +func (o *ListSnapshotsOK) GetPayload() *models.HashicorpCloudVault20201125ListSnapshotsResponse { + return o.Payload +} + +func (o *ListSnapshotsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125ListSnapshotsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListSnapshotsDefault creates a ListSnapshotsDefault with default headers values +func NewListSnapshotsDefault(code int) *ListSnapshotsDefault { + return &ListSnapshotsDefault{ + _statusCode: code, + } +} + +/*ListSnapshotsDefault handles this case with default header values. + +An unexpected error response. +*/ +type ListSnapshotsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the list snapshots default response +func (o *ListSnapshotsDefault) Code() int { + return o._statusCode +} + +func (o *ListSnapshotsDefault) Error() string { + return fmt.Sprintf("[GET /vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots][%d] ListSnapshots default %+v", o._statusCode, o.Payload) +} + +func (o *ListSnapshotsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *ListSnapshotsDefault) 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/preview/2020-11-25/client/vault_service/restore_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/restore_snapshot_parameters.go new file mode 100644 index 00000000..317bc9e5 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/restore_snapshot_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/preview/2020-11-25/models" +) + +// NewRestoreSnapshotParams creates a new RestoreSnapshotParams object +// with the default values initialized. +func NewRestoreSnapshotParams() *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRestoreSnapshotParamsWithTimeout creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRestoreSnapshotParamsWithTimeout(timeout time.Duration) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + timeout: timeout, + } +} + +// NewRestoreSnapshotParamsWithContext creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewRestoreSnapshotParamsWithContext(ctx context.Context) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + + Context: ctx, + } +} + +// NewRestoreSnapshotParamsWithHTTPClient creates a new RestoreSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRestoreSnapshotParamsWithHTTPClient(client *http.Client) *RestoreSnapshotParams { + var () + return &RestoreSnapshotParams{ + HTTPClient: client, + } +} + +/*RestoreSnapshotParams contains all the parameters to send to the API endpoint +for the restore snapshot operation typically these are written to a http.Request +*/ +type RestoreSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125RestoreSnapshotRequest + /*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 restore snapshot params +func (o *RestoreSnapshotParams) WithTimeout(timeout time.Duration) *RestoreSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restore snapshot params +func (o *RestoreSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restore snapshot params +func (o *RestoreSnapshotParams) WithContext(ctx context.Context) *RestoreSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restore snapshot params +func (o *RestoreSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restore snapshot params +func (o *RestoreSnapshotParams) WithHTTPClient(client *http.Client) *RestoreSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restore snapshot params +func (o *RestoreSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the restore snapshot params +func (o *RestoreSnapshotParams) WithBody(body *models.HashicorpCloudVault20201125RestoreSnapshotRequest) *RestoreSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the restore snapshot params +func (o *RestoreSnapshotParams) SetBody(body *models.HashicorpCloudVault20201125RestoreSnapshotRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the restore snapshot params +func (o *RestoreSnapshotParams) WithClusterID(clusterID string) *RestoreSnapshotParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the restore snapshot params +func (o *RestoreSnapshotParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the restore snapshot params +func (o *RestoreSnapshotParams) WithLocationOrganizationID(locationOrganizationID string) *RestoreSnapshotParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the restore snapshot params +func (o *RestoreSnapshotParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the restore snapshot params +func (o *RestoreSnapshotParams) WithLocationProjectID(locationProjectID string) *RestoreSnapshotParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the restore snapshot params +func (o *RestoreSnapshotParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *RestoreSnapshotParams) 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/preview/2020-11-25/client/vault_service/restore_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/restore_snapshot_responses.go new file mode 100644 index 00000000..f239a853 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/restore_snapshot_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/preview/2020-11-25/models" +) + +// RestoreSnapshotReader is a Reader for the RestoreSnapshot structure. +type RestoreSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestoreSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestoreSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRestoreSnapshotDefault(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 + } +} + +// NewRestoreSnapshotOK creates a RestoreSnapshotOK with default headers values +func NewRestoreSnapshotOK() *RestoreSnapshotOK { + return &RestoreSnapshotOK{} +} + +/*RestoreSnapshotOK handles this case with default header values. + +A successful response. +*/ +type RestoreSnapshotOK struct { + Payload *models.HashicorpCloudVault20201125RestoreSnapshotResponse +} + +func (o *RestoreSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore][%d] restoreSnapshotOK %+v", 200, o.Payload) +} + +func (o *RestoreSnapshotOK) GetPayload() *models.HashicorpCloudVault20201125RestoreSnapshotResponse { + return o.Payload +} + +func (o *RestoreSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125RestoreSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRestoreSnapshotDefault creates a RestoreSnapshotDefault with default headers values +func NewRestoreSnapshotDefault(code int) *RestoreSnapshotDefault { + return &RestoreSnapshotDefault{ + _statusCode: code, + } +} + +/*RestoreSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type RestoreSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the restore snapshot default response +func (o *RestoreSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *RestoreSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore][%d] RestoreSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *RestoreSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *RestoreSnapshotDefault) 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/preview/2020-11-25/client/vault_service/seal_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/seal_parameters.go new file mode 100644 index 00000000..060dd146 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/seal_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/preview/2020-11-25/models" +) + +// NewSealParams creates a new SealParams object +// with the default values initialized. +func NewSealParams() *SealParams { + var () + return &SealParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSealParamsWithTimeout creates a new SealParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSealParamsWithTimeout(timeout time.Duration) *SealParams { + var () + return &SealParams{ + + timeout: timeout, + } +} + +// NewSealParamsWithContext creates a new SealParams object +// with the default values initialized, and the ability to set a context for a request +func NewSealParamsWithContext(ctx context.Context) *SealParams { + var () + return &SealParams{ + + Context: ctx, + } +} + +// NewSealParamsWithHTTPClient creates a new SealParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSealParamsWithHTTPClient(client *http.Client) *SealParams { + var () + return &SealParams{ + HTTPClient: client, + } +} + +/*SealParams contains all the parameters to send to the API endpoint +for the seal operation typically these are written to a http.Request +*/ +type SealParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125SealRequest + /*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 seal params +func (o *SealParams) WithTimeout(timeout time.Duration) *SealParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the seal params +func (o *SealParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the seal params +func (o *SealParams) WithContext(ctx context.Context) *SealParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the seal params +func (o *SealParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the seal params +func (o *SealParams) WithHTTPClient(client *http.Client) *SealParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the seal params +func (o *SealParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the seal params +func (o *SealParams) WithBody(body *models.HashicorpCloudVault20201125SealRequest) *SealParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the seal params +func (o *SealParams) SetBody(body *models.HashicorpCloudVault20201125SealRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the seal params +func (o *SealParams) WithClusterID(clusterID string) *SealParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the seal params +func (o *SealParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the seal params +func (o *SealParams) WithLocationOrganizationID(locationOrganizationID string) *SealParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the seal params +func (o *SealParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the seal params +func (o *SealParams) WithLocationProjectID(locationProjectID string) *SealParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the seal params +func (o *SealParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *SealParams) 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/preview/2020-11-25/client/vault_service/seal_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/seal_responses.go new file mode 100644 index 00000000..39b39db7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/seal_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/preview/2020-11-25/models" +) + +// SealReader is a Reader for the Seal structure. +type SealReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SealReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSealOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSealDefault(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 + } +} + +// NewSealOK creates a SealOK with default headers values +func NewSealOK() *SealOK { + return &SealOK{} +} + +/*SealOK handles this case with default header values. + +A successful response. +*/ +type SealOK struct { + Payload *models.HashicorpCloudVault20201125SealResponse +} + +func (o *SealOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal][%d] sealOK %+v", 200, o.Payload) +} + +func (o *SealOK) GetPayload() *models.HashicorpCloudVault20201125SealResponse { + return o.Payload +} + +func (o *SealOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125SealResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSealDefault creates a SealDefault with default headers values +func NewSealDefault(code int) *SealDefault { + return &SealDefault{ + _statusCode: code, + } +} + +/*SealDefault handles this case with default header values. + +An unexpected error response. +*/ +type SealDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the seal default response +func (o *SealDefault) Code() int { + return o._statusCode +} + +func (o *SealDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal][%d] Seal default %+v", o._statusCode, o.Payload) +} + +func (o *SealDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *SealDefault) 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/preview/2020-11-25/client/vault_service/unseal_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/unseal_parameters.go new file mode 100644 index 00000000..296615a4 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/unseal_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/preview/2020-11-25/models" +) + +// NewUnsealParams creates a new UnsealParams object +// with the default values initialized. +func NewUnsealParams() *UnsealParams { + var () + return &UnsealParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUnsealParamsWithTimeout creates a new UnsealParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUnsealParamsWithTimeout(timeout time.Duration) *UnsealParams { + var () + return &UnsealParams{ + + timeout: timeout, + } +} + +// NewUnsealParamsWithContext creates a new UnsealParams object +// with the default values initialized, and the ability to set a context for a request +func NewUnsealParamsWithContext(ctx context.Context) *UnsealParams { + var () + return &UnsealParams{ + + Context: ctx, + } +} + +// NewUnsealParamsWithHTTPClient creates a new UnsealParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUnsealParamsWithHTTPClient(client *http.Client) *UnsealParams { + var () + return &UnsealParams{ + HTTPClient: client, + } +} + +/*UnsealParams contains all the parameters to send to the API endpoint +for the unseal operation typically these are written to a http.Request +*/ +type UnsealParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UnsealRequest + /*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 unseal params +func (o *UnsealParams) WithTimeout(timeout time.Duration) *UnsealParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the unseal params +func (o *UnsealParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the unseal params +func (o *UnsealParams) WithContext(ctx context.Context) *UnsealParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the unseal params +func (o *UnsealParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the unseal params +func (o *UnsealParams) WithHTTPClient(client *http.Client) *UnsealParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the unseal params +func (o *UnsealParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the unseal params +func (o *UnsealParams) WithBody(body *models.HashicorpCloudVault20201125UnsealRequest) *UnsealParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the unseal params +func (o *UnsealParams) SetBody(body *models.HashicorpCloudVault20201125UnsealRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the unseal params +func (o *UnsealParams) WithClusterID(clusterID string) *UnsealParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the unseal params +func (o *UnsealParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the unseal params +func (o *UnsealParams) WithLocationOrganizationID(locationOrganizationID string) *UnsealParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the unseal params +func (o *UnsealParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the unseal params +func (o *UnsealParams) WithLocationProjectID(locationProjectID string) *UnsealParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the unseal params +func (o *UnsealParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UnsealParams) 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/preview/2020-11-25/client/vault_service/unseal_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/unseal_responses.go new file mode 100644 index 00000000..97b0e560 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/unseal_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/preview/2020-11-25/models" +) + +// UnsealReader is a Reader for the Unseal structure. +type UnsealReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UnsealReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUnsealOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUnsealDefault(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 + } +} + +// NewUnsealOK creates a UnsealOK with default headers values +func NewUnsealOK() *UnsealOK { + return &UnsealOK{} +} + +/*UnsealOK handles this case with default header values. + +A successful response. +*/ +type UnsealOK struct { + Payload *models.HashicorpCloudVault20201125UnsealResponse +} + +func (o *UnsealOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal][%d] unsealOK %+v", 200, o.Payload) +} + +func (o *UnsealOK) GetPayload() *models.HashicorpCloudVault20201125UnsealResponse { + return o.Payload +} + +func (o *UnsealOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125UnsealResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUnsealDefault creates a UnsealDefault with default headers values +func NewUnsealDefault(code int) *UnsealDefault { + return &UnsealDefault{ + _statusCode: code, + } +} + +/*UnsealDefault handles this case with default header values. + +An unexpected error response. +*/ +type UnsealDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the unseal default response +func (o *UnsealDefault) Code() int { + return o._statusCode +} + +func (o *UnsealDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal][%d] Unseal default %+v", o._statusCode, o.Payload) +} + +func (o *UnsealDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UnsealDefault) 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/preview/2020-11-25/client/vault_service/update_c_o_r_s_config_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_c_o_r_s_config_parameters.go new file mode 100644 index 00000000..61a3287f --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_c_o_r_s_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/preview/2020-11-25/models" +) + +// NewUpdateCORSConfigParams creates a new UpdateCORSConfigParams object +// with the default values initialized. +func NewUpdateCORSConfigParams() *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateCORSConfigParamsWithTimeout creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateCORSConfigParamsWithTimeout(timeout time.Duration) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + timeout: timeout, + } +} + +// NewUpdateCORSConfigParamsWithContext creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateCORSConfigParamsWithContext(ctx context.Context) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + + Context: ctx, + } +} + +// NewUpdateCORSConfigParamsWithHTTPClient creates a new UpdateCORSConfigParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateCORSConfigParamsWithHTTPClient(client *http.Client) *UpdateCORSConfigParams { + var () + return &UpdateCORSConfigParams{ + HTTPClient: client, + } +} + +/*UpdateCORSConfigParams contains all the parameters to send to the API endpoint +for the update c o r s config operation typically these are written to a http.Request +*/ +type UpdateCORSConfigParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UpdateCORSConfigRequest + /*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 c o r s config params +func (o *UpdateCORSConfigParams) WithTimeout(timeout time.Duration) *UpdateCORSConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update c o r s config params +func (o *UpdateCORSConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update c o r s config params +func (o *UpdateCORSConfigParams) WithContext(ctx context.Context) *UpdateCORSConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update c o r s config params +func (o *UpdateCORSConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update c o r s config params +func (o *UpdateCORSConfigParams) WithHTTPClient(client *http.Client) *UpdateCORSConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update c o r s config params +func (o *UpdateCORSConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update c o r s config params +func (o *UpdateCORSConfigParams) WithBody(body *models.HashicorpCloudVault20201125UpdateCORSConfigRequest) *UpdateCORSConfigParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update c o r s config params +func (o *UpdateCORSConfigParams) SetBody(body *models.HashicorpCloudVault20201125UpdateCORSConfigRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithClusterID(clusterID string) *UpdateCORSConfigParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithLocationOrganizationID(locationOrganizationID string) *UpdateCORSConfigParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the update c o r s config params +func (o *UpdateCORSConfigParams) WithLocationProjectID(locationProjectID string) *UpdateCORSConfigParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the update c o r s config params +func (o *UpdateCORSConfigParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateCORSConfigParams) 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/preview/2020-11-25/client/vault_service/update_c_o_r_s_config_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_c_o_r_s_config_responses.go new file mode 100644 index 00000000..4e709fad --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_c_o_r_s_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/preview/2020-11-25/models" +) + +// UpdateCORSConfigReader is a Reader for the UpdateCORSConfig structure. +type UpdateCORSConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateCORSConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateCORSConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateCORSConfigDefault(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 + } +} + +// NewUpdateCORSConfigOK creates a UpdateCORSConfigOK with default headers values +func NewUpdateCORSConfigOK() *UpdateCORSConfigOK { + return &UpdateCORSConfigOK{} +} + +/*UpdateCORSConfigOK handles this case with default header values. + +A successful response. +*/ +type UpdateCORSConfigOK struct { + Payload models.HashicorpCloudVault20201125UpdateCORSConfigResponse +} + +func (o *UpdateCORSConfigOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config][%d] updateCORSConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateCORSConfigOK) GetPayload() models.HashicorpCloudVault20201125UpdateCORSConfigResponse { + return o.Payload +} + +func (o *UpdateCORSConfigOK) 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 +} + +// NewUpdateCORSConfigDefault creates a UpdateCORSConfigDefault with default headers values +func NewUpdateCORSConfigDefault(code int) *UpdateCORSConfigDefault { + return &UpdateCORSConfigDefault{ + _statusCode: code, + } +} + +/*UpdateCORSConfigDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdateCORSConfigDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update c o r s config default response +func (o *UpdateCORSConfigDefault) Code() int { + return o._statusCode +} + +func (o *UpdateCORSConfigDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config][%d] UpdateCORSConfig default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateCORSConfigDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdateCORSConfigDefault) 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/preview/2020-11-25/client/vault_service/update_public_ips_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_public_ips_parameters.go new file mode 100644 index 00000000..49dc4f3d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_public_ips_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/preview/2020-11-25/models" +) + +// NewUpdatePublicIpsParams creates a new UpdatePublicIpsParams object +// with the default values initialized. +func NewUpdatePublicIpsParams() *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePublicIpsParamsWithTimeout creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdatePublicIpsParamsWithTimeout(timeout time.Duration) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + timeout: timeout, + } +} + +// NewUpdatePublicIpsParamsWithContext creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdatePublicIpsParamsWithContext(ctx context.Context) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + + Context: ctx, + } +} + +// NewUpdatePublicIpsParamsWithHTTPClient creates a new UpdatePublicIpsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdatePublicIpsParamsWithHTTPClient(client *http.Client) *UpdatePublicIpsParams { + var () + return &UpdatePublicIpsParams{ + HTTPClient: client, + } +} + +/*UpdatePublicIpsParams contains all the parameters to send to the API endpoint +for the update public ips operation typically these are written to a http.Request +*/ +type UpdatePublicIpsParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UpdatePublicIpsRequest + /*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 public ips params +func (o *UpdatePublicIpsParams) WithTimeout(timeout time.Duration) *UpdatePublicIpsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update public ips params +func (o *UpdatePublicIpsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update public ips params +func (o *UpdatePublicIpsParams) WithContext(ctx context.Context) *UpdatePublicIpsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update public ips params +func (o *UpdatePublicIpsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update public ips params +func (o *UpdatePublicIpsParams) WithHTTPClient(client *http.Client) *UpdatePublicIpsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update public ips params +func (o *UpdatePublicIpsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update public ips params +func (o *UpdatePublicIpsParams) WithBody(body *models.HashicorpCloudVault20201125UpdatePublicIpsRequest) *UpdatePublicIpsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update public ips params +func (o *UpdatePublicIpsParams) SetBody(body *models.HashicorpCloudVault20201125UpdatePublicIpsRequest) { + o.Body = body +} + +// WithClusterID adds the clusterID to the update public ips params +func (o *UpdatePublicIpsParams) WithClusterID(clusterID string) *UpdatePublicIpsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the update public ips params +func (o *UpdatePublicIpsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the update public ips params +func (o *UpdatePublicIpsParams) WithLocationOrganizationID(locationOrganizationID string) *UpdatePublicIpsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the update public ips params +func (o *UpdatePublicIpsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the update public ips params +func (o *UpdatePublicIpsParams) WithLocationProjectID(locationProjectID string) *UpdatePublicIpsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the update public ips params +func (o *UpdatePublicIpsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePublicIpsParams) 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/preview/2020-11-25/client/vault_service/update_public_ips_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_public_ips_responses.go new file mode 100644 index 00000000..e8bf378c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_public_ips_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/preview/2020-11-25/models" +) + +// UpdatePublicIpsReader is a Reader for the UpdatePublicIps structure. +type UpdatePublicIpsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePublicIpsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePublicIpsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdatePublicIpsDefault(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 + } +} + +// NewUpdatePublicIpsOK creates a UpdatePublicIpsOK with default headers values +func NewUpdatePublicIpsOK() *UpdatePublicIpsOK { + return &UpdatePublicIpsOK{} +} + +/*UpdatePublicIpsOK handles this case with default header values. + +A successful response. +*/ +type UpdatePublicIpsOK struct { + Payload *models.HashicorpCloudVault20201125UpdatePublicIpsResponse +} + +func (o *UpdatePublicIpsOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips][%d] updatePublicIpsOK %+v", 200, o.Payload) +} + +func (o *UpdatePublicIpsOK) GetPayload() *models.HashicorpCloudVault20201125UpdatePublicIpsResponse { + return o.Payload +} + +func (o *UpdatePublicIpsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125UpdatePublicIpsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePublicIpsDefault creates a UpdatePublicIpsDefault with default headers values +func NewUpdatePublicIpsDefault(code int) *UpdatePublicIpsDefault { + return &UpdatePublicIpsDefault{ + _statusCode: code, + } +} + +/*UpdatePublicIpsDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdatePublicIpsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update public ips default response +func (o *UpdatePublicIpsDefault) Code() int { + return o._statusCode +} + +func (o *UpdatePublicIpsDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips][%d] UpdatePublicIps default %+v", o._statusCode, o.Payload) +} + +func (o *UpdatePublicIpsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdatePublicIpsDefault) 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/preview/2020-11-25/client/vault_service/update_snapshot_parameters.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_snapshot_parameters.go new file mode 100644 index 00000000..520cd02d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_snapshot_parameters.go @@ -0,0 +1,198 @@ +// 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/preview/2020-11-25/models" +) + +// NewUpdateSnapshotParams creates a new UpdateSnapshotParams object +// with the default values initialized. +func NewUpdateSnapshotParams() *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSnapshotParamsWithTimeout creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateSnapshotParamsWithTimeout(timeout time.Duration) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + timeout: timeout, + } +} + +// NewUpdateSnapshotParamsWithContext creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateSnapshotParamsWithContext(ctx context.Context) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + + Context: ctx, + } +} + +// NewUpdateSnapshotParamsWithHTTPClient creates a new UpdateSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateSnapshotParamsWithHTTPClient(client *http.Client) *UpdateSnapshotParams { + var () + return &UpdateSnapshotParams{ + HTTPClient: client, + } +} + +/*UpdateSnapshotParams contains all the parameters to send to the API endpoint +for the update snapshot operation typically these are written to a http.Request +*/ +type UpdateSnapshotParams struct { + + /*Body*/ + Body *models.HashicorpCloudVault20201125UpdateSnapshotRequest + /*SnapshotLocationOrganizationID + organization_id is the id of the organization. + + */ + SnapshotLocationOrganizationID string + /*SnapshotLocationProjectID + project_id is the projects id. + + */ + SnapshotLocationProjectID string + /*SnapshotSnapshotID + snapshot_id is the snapshots UUID. + + */ + SnapshotSnapshotID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update snapshot params +func (o *UpdateSnapshotParams) WithTimeout(timeout time.Duration) *UpdateSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update snapshot params +func (o *UpdateSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update snapshot params +func (o *UpdateSnapshotParams) WithContext(ctx context.Context) *UpdateSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update snapshot params +func (o *UpdateSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update snapshot params +func (o *UpdateSnapshotParams) WithHTTPClient(client *http.Client) *UpdateSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update snapshot params +func (o *UpdateSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update snapshot params +func (o *UpdateSnapshotParams) WithBody(body *models.HashicorpCloudVault20201125UpdateSnapshotRequest) *UpdateSnapshotParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update snapshot params +func (o *UpdateSnapshotParams) SetBody(body *models.HashicorpCloudVault20201125UpdateSnapshotRequest) { + o.Body = body +} + +// WithSnapshotLocationOrganizationID adds the snapshotLocationOrganizationID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotLocationOrganizationID(snapshotLocationOrganizationID string) *UpdateSnapshotParams { + o.SetSnapshotLocationOrganizationID(snapshotLocationOrganizationID) + return o +} + +// SetSnapshotLocationOrganizationID adds the snapshotLocationOrganizationId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotLocationOrganizationID(snapshotLocationOrganizationID string) { + o.SnapshotLocationOrganizationID = snapshotLocationOrganizationID +} + +// WithSnapshotLocationProjectID adds the snapshotLocationProjectID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotLocationProjectID(snapshotLocationProjectID string) *UpdateSnapshotParams { + o.SetSnapshotLocationProjectID(snapshotLocationProjectID) + return o +} + +// SetSnapshotLocationProjectID adds the snapshotLocationProjectId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotLocationProjectID(snapshotLocationProjectID string) { + o.SnapshotLocationProjectID = snapshotLocationProjectID +} + +// WithSnapshotSnapshotID adds the snapshotSnapshotID to the update snapshot params +func (o *UpdateSnapshotParams) WithSnapshotSnapshotID(snapshotSnapshotID string) *UpdateSnapshotParams { + o.SetSnapshotSnapshotID(snapshotSnapshotID) + return o +} + +// SetSnapshotSnapshotID adds the snapshotSnapshotId to the update snapshot params +func (o *UpdateSnapshotParams) SetSnapshotSnapshotID(snapshotSnapshotID string) { + o.SnapshotSnapshotID = snapshotSnapshotID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSnapshotParams) 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 snapshot.location.organization_id + if err := r.SetPathParam("snapshot.location.organization_id", o.SnapshotLocationOrganizationID); err != nil { + return err + } + + // path param snapshot.location.project_id + if err := r.SetPathParam("snapshot.location.project_id", o.SnapshotLocationProjectID); err != nil { + return err + } + + // path param snapshot.snapshot_id + if err := r.SetPathParam("snapshot.snapshot_id", o.SnapshotSnapshotID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_snapshot_responses.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_snapshot_responses.go new file mode 100644 index 00000000..66277131 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/update_snapshot_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/preview/2020-11-25/models" +) + +// UpdateSnapshotReader is a Reader for the UpdateSnapshot structure. +type UpdateSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateSnapshotDefault(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 + } +} + +// NewUpdateSnapshotOK creates a UpdateSnapshotOK with default headers values +func NewUpdateSnapshotOK() *UpdateSnapshotOK { + return &UpdateSnapshotOK{} +} + +/*UpdateSnapshotOK handles this case with default header values. + +A successful response. +*/ +type UpdateSnapshotOK struct { + Payload *models.HashicorpCloudVault20201125UpdateSnapshotResponse +} + +func (o *UpdateSnapshotOK) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}][%d] updateSnapshotOK %+v", 200, o.Payload) +} + +func (o *UpdateSnapshotOK) GetPayload() *models.HashicorpCloudVault20201125UpdateSnapshotResponse { + return o.Payload +} + +func (o *UpdateSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVault20201125UpdateSnapshotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSnapshotDefault creates a UpdateSnapshotDefault with default headers values +func NewUpdateSnapshotDefault(code int) *UpdateSnapshotDefault { + return &UpdateSnapshotDefault{ + _statusCode: code, + } +} + +/*UpdateSnapshotDefault handles this case with default header values. + +An unexpected error response. +*/ +type UpdateSnapshotDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the update snapshot default response +func (o *UpdateSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *UpdateSnapshotDefault) Error() string { + return fmt.Sprintf("[POST /vault/2020-11-25/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}][%d] UpdateSnapshot default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSnapshotDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *UpdateSnapshotDefault) 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/preview/2020-11-25/client/vault_service/vault_service_client.go b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/vault_service_client.go new file mode 100644 index 00000000..2a41f2b8 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/client/vault_service/vault_service_client.go @@ -0,0 +1,754 @@ +// 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 ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new vault service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vault service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + Create(params *CreateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateOK, error) + + CreateSnapshot(params *CreateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateSnapshotOK, error) + + Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) + + DeleteSnapshot(params *DeleteSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSnapshotOK, error) + + DisableCORS(params *DisableCORSParams, authInfo runtime.ClientAuthInfoWriter) (*DisableCORSOK, error) + + FetchAuditLog(params *FetchAuditLogParams, authInfo runtime.ClientAuthInfoWriter) (*FetchAuditLogOK, error) + + Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) + + GetAdminToken(params *GetAdminTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetAdminTokenOK, error) + + GetAuditLogStatus(params *GetAuditLogStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuditLogStatusOK, error) + + GetCORSConfig(params *GetCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*GetCORSConfigOK, error) + + GetClientCounts(params *GetClientCountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetClientCountsOK, error) + + GetSnapshot(params *GetSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*GetSnapshotOK, error) + + List(params *ListParams, authInfo runtime.ClientAuthInfoWriter) (*ListOK, error) + + ListSnapshots(params *ListSnapshotsParams, authInfo runtime.ClientAuthInfoWriter) (*ListSnapshotsOK, error) + + RestoreSnapshot(params *RestoreSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*RestoreSnapshotOK, error) + + Seal(params *SealParams, authInfo runtime.ClientAuthInfoWriter) (*SealOK, error) + + Unseal(params *UnsealParams, authInfo runtime.ClientAuthInfoWriter) (*UnsealOK, error) + + UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCORSConfigOK, error) + + UpdatePublicIps(params *UpdatePublicIpsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePublicIpsOK, error) + + UpdateSnapshot(params *UpdateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateSnapshotOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + Create create API +*/ +func (a *Client) Create(params *CreateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Create", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{cluster.location.organization_id}/projects/{cluster.location.project_id}/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + CreateSnapshot create snapshot API +*/ +func (a *Client) CreateSnapshot(params *CreateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateSnapshot", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Delete delete API +*/ +func (a *Client) Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Delete", + Method: "DELETE", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + DeleteSnapshot delete snapshot API +*/ +func (a *Client) DeleteSnapshot(params *DeleteSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteSnapshot", + Method: "DELETE", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + DisableCORS disable c o r s API +*/ +func (a *Client) DisableCORS(params *DisableCORSParams, authInfo runtime.ClientAuthInfoWriter) (*DisableCORSOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDisableCORSParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DisableCORS", + Method: "DELETE", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/disable-cors", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DisableCORSReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DisableCORSOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DisableCORSDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FetchAuditLog fetch audit log API +*/ +func (a *Client) FetchAuditLog(params *FetchAuditLogParams, authInfo runtime.ClientAuthInfoWriter) (*FetchAuditLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFetchAuditLogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FetchAuditLog", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FetchAuditLogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FetchAuditLogOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FetchAuditLogDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Get get API +*/ +func (a *Client) Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Get", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetAdminToken get admin token API +*/ +func (a *Client) GetAdminToken(params *GetAdminTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetAdminTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAdminTokenParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAdminToken", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/admintoken", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAdminTokenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAdminTokenOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAdminTokenDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetAuditLogStatus get audit log status API +*/ +func (a *Client) GetAuditLogStatus(params *GetAuditLogStatusParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuditLogStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAuditLogStatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAuditLogStatus", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/auditlog/{log_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAuditLogStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAuditLogStatusOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAuditLogStatusDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetCORSConfig get c o r s config API +*/ +func (a *Client) GetCORSConfig(params *GetCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*GetCORSConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCORSConfigParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCORSConfig", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/get-cors-config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCORSConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCORSConfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetCORSConfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetClientCounts get client counts API +*/ +func (a *Client) GetClientCounts(params *GetClientCountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetClientCountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClientCountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClientCounts", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/clients", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClientCountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClientCountsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClientCountsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetSnapshot get snapshot API +*/ +func (a *Client) GetSnapshot(params *GetSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*GetSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetSnapshot", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/snapshots/{snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + List list API +*/ +func (a *Client) List(params *ListParams, authInfo runtime.ClientAuthInfoWriter) (*ListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "List", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + ListSnapshots list snapshots API +*/ +func (a *Client) ListSnapshots(params *ListSnapshotsParams, authInfo runtime.ClientAuthInfoWriter) (*ListSnapshotsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListSnapshotsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListSnapshots", + Method: "GET", + PathPattern: "/vault/2020-11-25/organizations/{resource.location.organization_id}/projects/{resource.location.project_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListSnapshotsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListSnapshotsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListSnapshotsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + RestoreSnapshot restore snapshot API +*/ +func (a *Client) RestoreSnapshot(params *RestoreSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*RestoreSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRestoreSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RestoreSnapshot", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/restore", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RestoreSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RestoreSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RestoreSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Seal seal API +*/ +func (a *Client) Seal(params *SealParams, authInfo runtime.ClientAuthInfoWriter) (*SealOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSealParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Seal", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/seal", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SealReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SealOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SealDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Unseal unseal API +*/ +func (a *Client) Unseal(params *UnsealParams, authInfo runtime.ClientAuthInfoWriter) (*UnsealOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUnsealParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Unseal", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/unseal", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UnsealReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UnsealOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UnsealDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdateCORSConfig update c o r s config API +*/ +func (a *Client) UpdateCORSConfig(params *UpdateCORSConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCORSConfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateCORSConfigParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateCORSConfig", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/update-cors-config", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateCORSConfigReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateCORSConfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateCORSConfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdatePublicIps update public ips API +*/ +func (a *Client) UpdatePublicIps(params *UpdatePublicIpsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePublicIpsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdatePublicIpsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdatePublicIps", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{location.organization_id}/projects/{location.project_id}/clusters/{cluster_id}/public-ips", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdatePublicIpsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdatePublicIpsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdatePublicIpsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UpdateSnapshot update snapshot API +*/ +func (a *Client) UpdateSnapshot(params *UpdateSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateSnapshot", + Method: "POST", + PathPattern: "/vault/2020-11-25/organizations/{snapshot.location.organization_id}/projects/{snapshot.location.project_id}/snapshots/{snapshot.snapshot_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateSnapshotReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateSnapshotDefault) + 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/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_config.go new file mode 100644 index 00000000..f86a67ed --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125AuditConfig hashicorp cloud vault 20201125 audit config +// +// swagger:model hashicorp.cloud.vault_20201125.AuditConfig +type HashicorpCloudVault20201125AuditConfig struct { + + // audit logs disabled + AuditLogsDisabled bool `json:"audit_logs_disabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 audit config +func (m *HashicorpCloudVault20201125AuditConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125AuditConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125AuditConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125AuditConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log.go new file mode 100644 index 00000000..1c91fdf6 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log.go @@ -0,0 +1,189 @@ +// 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" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125AuditLog AuditLog represents a request for audit logs to download +// +// swagger:model hashicorp.cloud.vault_20201125.AuditLog +type HashicorpCloudVault20201125AuditLog struct { + + // cluster_id is the cluster id that this download backs + ClusterID string `json:"cluster_id,omitempty"` + + // download_url is the URL which can be used to retrieve the audit logs. + DownloadURL string `json:"download_url,omitempty"` + + // expires_at is the timestamp of when the cluster was first created. + // Format: date-time + ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` + + // finished_at is the timestamp of when the download was ready. + // Format: date-time + FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` + + // id is the id of the audit log download + ID string `json:"id,omitempty"` + + // interval_end + // Format: date-time + IntervalEnd strfmt.DateTime `json:"interval_end,omitempty"` + + // interval_start + // Format: date-time + IntervalStart strfmt.DateTime `json:"interval_start,omitempty"` + + // location is the location of the cluster. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // state is the current state of the download + State HashicorpCloudVault20201125AuditLogState `json:"state,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 audit log +func (m *HashicorpCloudVault20201125AuditLog) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFinishedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125AuditLog) validateExpiresAt(formats strfmt.Registry) error { + + if swag.IsZero(m.ExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("expires_at", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125AuditLog) validateFinishedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.FinishedAt) { // not required + return nil + } + + if err := validate.FormatOf("finished_at", "body", "date-time", m.FinishedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125AuditLog) validateIntervalEnd(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalEnd) { // not required + return nil + } + + if err := validate.FormatOf("interval_end", "body", "date-time", m.IntervalEnd.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125AuditLog) validateIntervalStart(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalStart) { // not required + return nil + } + + if err := validate.FormatOf("interval_start", "body", "date-time", m.IntervalStart.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125AuditLog) 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 *HashicorpCloudVault20201125AuditLog) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125AuditLog) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125AuditLog) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125AuditLog + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log_state.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log_state.go new file mode 100644 index 00000000..ff8d998e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_audit_log_state.go @@ -0,0 +1,84 @@ +// 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" +) + +// HashicorpCloudVault20201125AuditLogState State is the state of download. +// +// - UNSET: UNSET is a sentinel zero value so that an uninitialized value can be +// detected. +// - PENDING: PENDING is the initial state before the workflow starts. +// - CREATING: CREATING is the state used when the download is being prepared. +// - READY: READY is the completed state when the download is ready +// - FAILED: FAILED is a failure state in which the download is not created +// - EXPIRED: EXPIRED is the state that the download hits when it is no longer +// accessible for download +// +// swagger:model hashicorp.cloud.vault_20201125.AuditLog.State +type HashicorpCloudVault20201125AuditLogState string + +const ( + + // HashicorpCloudVault20201125AuditLogStateUNSET captures enum value "UNSET" + HashicorpCloudVault20201125AuditLogStateUNSET HashicorpCloudVault20201125AuditLogState = "UNSET" + + // HashicorpCloudVault20201125AuditLogStatePENDING captures enum value "PENDING" + HashicorpCloudVault20201125AuditLogStatePENDING HashicorpCloudVault20201125AuditLogState = "PENDING" + + // HashicorpCloudVault20201125AuditLogStateCREATING captures enum value "CREATING" + HashicorpCloudVault20201125AuditLogStateCREATING HashicorpCloudVault20201125AuditLogState = "CREATING" + + // HashicorpCloudVault20201125AuditLogStateREADY captures enum value "READY" + HashicorpCloudVault20201125AuditLogStateREADY HashicorpCloudVault20201125AuditLogState = "READY" + + // HashicorpCloudVault20201125AuditLogStateFAILED captures enum value "FAILED" + HashicorpCloudVault20201125AuditLogStateFAILED HashicorpCloudVault20201125AuditLogState = "FAILED" + + // HashicorpCloudVault20201125AuditLogStateEXPIRED captures enum value "EXPIRED" + HashicorpCloudVault20201125AuditLogStateEXPIRED HashicorpCloudVault20201125AuditLogState = "EXPIRED" +) + +// for schema +var hashicorpCloudVault20201125AuditLogStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125AuditLogState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","READY","FAILED","EXPIRED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125AuditLogStateEnum = append(hashicorpCloudVault20201125AuditLogStateEnum, v) + } +} + +func (m HashicorpCloudVault20201125AuditLogState) validateHashicorpCloudVault20201125AuditLogStateEnum(path, location string, value HashicorpCloudVault20201125AuditLogState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125AuditLogStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 audit log state +func (m HashicorpCloudVault20201125AuditLogState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125AuditLogStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_c_o_r_s_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_c_o_r_s_config.go new file mode 100644 index 00000000..de1c69a0 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_c_o_r_s_config.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125CORSConfig CORSConfig is the response CORS settings on the Vault cluster +// +// swagger:model hashicorp.cloud.vault_20201125.CORSConfig +type HashicorpCloudVault20201125CORSConfig struct { + + // allowed_headers returns the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins returns the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // enabled is true if CORS is enabled for this cluster. + Enabled bool `json:"enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 c o r s config +func (m *HashicorpCloudVault20201125CORSConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CORSConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CORSConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CORSConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_capacity_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_capacity_config.go new file mode 100644 index 00000000..61c13379 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_capacity_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125CapacityConfig hashicorp cloud vault 20201125 capacity config +// +// swagger:model hashicorp.cloud.vault_20201125.CapacityConfig +type HashicorpCloudVault20201125CapacityConfig struct { + + // num_servers is the number of nodes this Vault cluster should have. + NumServers int32 `json:"num_servers,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 capacity config +func (m *HashicorpCloudVault20201125CapacityConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CapacityConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CapacityConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CapacityConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go new file mode 100644 index 00000000..af84102e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125Cluster Cluster represents a single Vault cluster. +// +// swagger:model hashicorp.cloud.vault_20201125.Cluster +type HashicorpCloudVault20201125Cluster struct { + + // config holds the configuration of the cluster. + Config *HashicorpCloudVault20201125ClusterConfig `json:"config,omitempty"` + + // created_at is the timestamp of when the cluster was first created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // currently_deployed_version is the version of the currrent Vault deployment. + CurrentVersion string `json:"current_version,omitempty"` + + // DNSNames holds all of the cluster's DNS names. + DNSNames *HashicorpCloudVault20201125ClusterDNSNames `json:"dns_names,omitempty"` + + // id is ID of the Vault cluster. + ID string `json:"id,omitempty"` + + // location is the location of the cluster. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // state is the current state of the cluster. + State HashicorpCloudVault20201125ClusterState `json:"state,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 cluster +func (m *HashicorpCloudVault20201125Cluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDNSNames(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125Cluster) validateConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125Cluster) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125Cluster) validateDNSNames(formats strfmt.Registry) error { + + if swag.IsZero(m.DNSNames) { // not required + return nil + } + + if m.DNSNames != nil { + if err := m.DNSNames.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dns_names") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125Cluster) 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 *HashicorpCloudVault20201125Cluster) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125Cluster) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go new file mode 100644 index 00000000..663f9c97 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_config.go @@ -0,0 +1,222 @@ +// 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" +) + +// HashicorpCloudVault20201125ClusterConfig hashicorp cloud vault 20201125 cluster config +// +// swagger:model hashicorp.cloud.vault_20201125.ClusterConfig +type HashicorpCloudVault20201125ClusterConfig struct { + + // audit config + AuditConfig *HashicorpCloudVault20201125AuditConfig `json:"audit_config,omitempty"` + + // capacity config + CapacityConfig *HashicorpCloudVault20201125CapacityConfig `json:"capacity_config,omitempty"` + + // maintenance config + MaintenanceConfig HashicorpCloudVault20201125MaintenanceConfig `json:"maintenance_config,omitempty"` + + // network config + NetworkConfig *HashicorpCloudVault20201125NetworkConfig `json:"network_config,omitempty"` + + // snapshot config + SnapshotConfig *HashicorpCloudVault20201125SnapshotConfig `json:"snapshot_config,omitempty"` + + // tier + Tier HashicorpCloudVault20201125Tier `json:"tier,omitempty"` + + // vault access + VaultAccess *HashicorpCloudVault20201125VaultAccess `json:"vault_access,omitempty"` + + // vault config + VaultConfig *HashicorpCloudVault20201125VaultConfig `json:"vault_config,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 cluster config +func (m *HashicorpCloudVault20201125ClusterConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuditConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCapacityConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNetworkConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshotConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVaultAccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVaultConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateAuditConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.AuditConfig) { // not required + return nil + } + + if m.AuditConfig != nil { + if err := m.AuditConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("audit_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateCapacityConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.CapacityConfig) { // not required + return nil + } + + if m.CapacityConfig != nil { + if err := m.CapacityConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capacity_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateNetworkConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.NetworkConfig) { // not required + return nil + } + + if m.NetworkConfig != nil { + if err := m.NetworkConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateSnapshotConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.SnapshotConfig) { // not required + return nil + } + + if m.SnapshotConfig != nil { + if err := m.SnapshotConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateTier(formats strfmt.Registry) error { + + if swag.IsZero(m.Tier) { // not required + return nil + } + + if err := m.Tier.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tier") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateVaultAccess(formats strfmt.Registry) error { + + if swag.IsZero(m.VaultAccess) { // not required + return nil + } + + if m.VaultAccess != nil { + if err := m.VaultAccess.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vault_access") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ClusterConfig) validateVaultConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.VaultConfig) { // not required + return nil + } + + if m.VaultConfig != nil { + if err := m.VaultConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vault_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125ClusterConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_dns_names.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_dns_names.go new file mode 100644 index 00000000..cb401bcf --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_dns_names.go @@ -0,0 +1,46 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125ClusterDNSNames DNSNames holds all of the cluster's DNS names. +// +// swagger:model hashicorp.cloud.vault_20201125.Cluster.DNSNames +type HashicorpCloudVault20201125ClusterDNSNames struct { + + // private is the DNS name pointing to the cluster's private IP addresses. + Private string `json:"private,omitempty"` + + // public is the DNS name pointing to the cluster's public IP addresses. + Public string `json:"public,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 cluster DNS names +func (m *HashicorpCloudVault20201125ClusterDNSNames) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterDNSNames) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ClusterDNSNames) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125ClusterDNSNames + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_state.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_state.go new file mode 100644 index 00000000..c74d2d12 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_cluster_state.go @@ -0,0 +1,113 @@ +// 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" +) + +// HashicorpCloudVault20201125ClusterState State is the state of the Vault cluster. Note that this state +// represents the abstract Vault cluster itself, not necessarily whether +// Vault cluster is currently available or not. +// +// - UNSET: UNSET is a sentinel zero value so that an uninitialized value can be +// detected. +// - PENDING: PENDING is the state the cluster is in while it is waiting to be created. +// - CREATING: CREATING is the state the cluster is in while it is being provisioned for +// the first time. +// - RUNNING: RUNNING is the steady state while the cluster is running. +// - FAILED: FAILED is a failure state in which the cluster is unavailable and may +// required an operator restore action to recover. +// - UPDATING: UPDATING is the state the cluster is in while undergoing a version +// update. +// - RESTORING: RESTORING is the state the cluster is in while restoring from a snapshot. +// - DELETING: DELETING is the state the cluster is in while it is being de-provisioned. +// - DELETED: DELETED is the state the cluster is in when it has been de-provisioned. At +// this point, the cluster is eligible for garbage collection. +// - SEALING: SEALING is the state the cluster is in when it is about to get sealed. +// - SEALED: SEALED is the state the cluster is in while a cluster is sealed. +// - UNSEALING: UNSEALING is the state the cluster is in when it is about to get unsealed. +// +// swagger:model hashicorp.cloud.vault_20201125.Cluster.State +type HashicorpCloudVault20201125ClusterState string + +const ( + + // HashicorpCloudVault20201125ClusterStateUNSET captures enum value "UNSET" + HashicorpCloudVault20201125ClusterStateUNSET HashicorpCloudVault20201125ClusterState = "UNSET" + + // HashicorpCloudVault20201125ClusterStatePENDING captures enum value "PENDING" + HashicorpCloudVault20201125ClusterStatePENDING HashicorpCloudVault20201125ClusterState = "PENDING" + + // HashicorpCloudVault20201125ClusterStateCREATING captures enum value "CREATING" + HashicorpCloudVault20201125ClusterStateCREATING HashicorpCloudVault20201125ClusterState = "CREATING" + + // HashicorpCloudVault20201125ClusterStateRUNNING captures enum value "RUNNING" + HashicorpCloudVault20201125ClusterStateRUNNING HashicorpCloudVault20201125ClusterState = "RUNNING" + + // HashicorpCloudVault20201125ClusterStateFAILED captures enum value "FAILED" + HashicorpCloudVault20201125ClusterStateFAILED HashicorpCloudVault20201125ClusterState = "FAILED" + + // HashicorpCloudVault20201125ClusterStateUPDATING captures enum value "UPDATING" + HashicorpCloudVault20201125ClusterStateUPDATING HashicorpCloudVault20201125ClusterState = "UPDATING" + + // HashicorpCloudVault20201125ClusterStateRESTORING captures enum value "RESTORING" + HashicorpCloudVault20201125ClusterStateRESTORING HashicorpCloudVault20201125ClusterState = "RESTORING" + + // HashicorpCloudVault20201125ClusterStateDELETING captures enum value "DELETING" + HashicorpCloudVault20201125ClusterStateDELETING HashicorpCloudVault20201125ClusterState = "DELETING" + + // HashicorpCloudVault20201125ClusterStateDELETED captures enum value "DELETED" + HashicorpCloudVault20201125ClusterStateDELETED HashicorpCloudVault20201125ClusterState = "DELETED" + + // HashicorpCloudVault20201125ClusterStateSEALING captures enum value "SEALING" + HashicorpCloudVault20201125ClusterStateSEALING HashicorpCloudVault20201125ClusterState = "SEALING" + + // HashicorpCloudVault20201125ClusterStateSEALED captures enum value "SEALED" + HashicorpCloudVault20201125ClusterStateSEALED HashicorpCloudVault20201125ClusterState = "SEALED" + + // HashicorpCloudVault20201125ClusterStateUNSEALING captures enum value "UNSEALING" + HashicorpCloudVault20201125ClusterStateUNSEALING HashicorpCloudVault20201125ClusterState = "UNSEALING" +) + +// for schema +var hashicorpCloudVault20201125ClusterStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125ClusterState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","RUNNING","FAILED","UPDATING","RESTORING","DELETING","DELETED","SEALING","SEALED","UNSEALING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125ClusterStateEnum = append(hashicorpCloudVault20201125ClusterStateEnum, v) + } +} + +func (m HashicorpCloudVault20201125ClusterState) validateHashicorpCloudVault20201125ClusterStateEnum(path, location string, value HashicorpCloudVault20201125ClusterState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125ClusterStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 cluster state +func (m HashicorpCloudVault20201125ClusterState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125ClusterStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_request.go new file mode 100644 index 00000000..5c44e442 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125CreateRequest hashicorp cloud vault 20201125 create request +// +// swagger:model hashicorp.cloud.vault_20201125.CreateRequest +type HashicorpCloudVault20201125CreateRequest struct { + + // cluster + Cluster *HashicorpCloudVault20201125InputCluster `json:"cluster,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 create request +func (m *HashicorpCloudVault20201125CreateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125CreateRequest) validateCluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CreateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_response.go new file mode 100644 index 00000000..42db2573 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_response.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" +) + +// HashicorpCloudVault20201125CreateResponse hashicorp cloud vault 20201125 create response +// +// swagger:model hashicorp.cloud.vault_20201125.CreateResponse +type HashicorpCloudVault20201125CreateResponse struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 create response +func (m *HashicorpCloudVault20201125CreateResponse) 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 *HashicorpCloudVault20201125CreateResponse) 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 *HashicorpCloudVault20201125CreateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CreateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_request.go new file mode 100644 index 00000000..16c43fc6 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_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" +) + +// HashicorpCloudVault20201125CreateSnapshotRequest hashicorp cloud vault 20201125 create snapshot request +// +// swagger:model hashicorp.cloud.vault_20201125.CreateSnapshotRequest +type HashicorpCloudVault20201125CreateSnapshotRequest struct { + + // name is the user provided name of the snapshot. + Name string `json:"name,omitempty"` + + // resource specifies the link to the resource to snapshot + Resource *cloud.HashicorpCloudLocationLink `json:"resource,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 create snapshot request +func (m *HashicorpCloudVault20201125CreateSnapshotRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResource(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125CreateSnapshotRequest) validateResource(formats strfmt.Registry) error { + + if swag.IsZero(m.Resource) { // not required + return nil + } + + if m.Resource != nil { + if err := m.Resource.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resource") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CreateSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_response.go new file mode 100644 index 00000000..d3973ec0 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_create_snapshot_response.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" +) + +// HashicorpCloudVault20201125CreateSnapshotResponse hashicorp cloud vault 20201125 create snapshot response +// +// swagger:model hashicorp.cloud.vault_20201125.CreateSnapshotResponse +type HashicorpCloudVault20201125CreateSnapshotResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` + + // snapshot id + SnapshotID string `json:"snapshot_id,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 create snapshot response +func (m *HashicorpCloudVault20201125CreateSnapshotResponse) 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 *HashicorpCloudVault20201125CreateSnapshotResponse) 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 *HashicorpCloudVault20201125CreateSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125CreateSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125CreateSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_response.go new file mode 100644 index 00000000..c7dd50e5 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_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" +) + +// HashicorpCloudVault20201125DeleteResponse hashicorp cloud vault 20201125 delete response +// +// swagger:model hashicorp.cloud.vault_20201125.DeleteResponse +type HashicorpCloudVault20201125DeleteResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 delete response +func (m *HashicorpCloudVault20201125DeleteResponse) 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 *HashicorpCloudVault20201125DeleteResponse) 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 *HashicorpCloudVault20201125DeleteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125DeleteResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125DeleteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_snapshot_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_snapshot_response.go new file mode 100644 index 00000000..bae24229 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_delete_snapshot_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" +) + +// HashicorpCloudVault20201125DeleteSnapshotResponse DeleteSnapshotResponse is a response to deleting a snapshot. +// +// swagger:model hashicorp.cloud.vault_20201125.DeleteSnapshotResponse +type HashicorpCloudVault20201125DeleteSnapshotResponse struct { + + // operation represents the deletion of the requested snapshot. + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 delete snapshot response +func (m *HashicorpCloudVault20201125DeleteSnapshotResponse) 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 *HashicorpCloudVault20201125DeleteSnapshotResponse) 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 *HashicorpCloudVault20201125DeleteSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125DeleteSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125DeleteSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_disable_c_o_r_s_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_disable_c_o_r_s_response.go new file mode 100644 index 00000000..9eb77b9a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_disable_c_o_r_s_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 + +// HashicorpCloudVault20201125DisableCORSResponse hashicorp cloud vault 20201125 disable c o r s response +// +// swagger:model hashicorp.cloud.vault_20201125.DisableCORSResponse +type HashicorpCloudVault20201125DisableCORSResponse interface{} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_request.go new file mode 100644 index 00000000..c3d493e5 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_request.go @@ -0,0 +1,118 @@ +// 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" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125FetchAuditLogRequest hashicorp cloud vault 20201125 fetch audit log request +// +// swagger:model hashicorp.cloud.vault_20201125.FetchAuditLogRequest +type HashicorpCloudVault20201125FetchAuditLogRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // interval end + // Format: date-time + IntervalEnd strfmt.DateTime `json:"interval_end,omitempty"` + + // interval start + // Format: date-time + IntervalStart strfmt.DateTime `json:"interval_start,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 fetch audit log request +func (m *HashicorpCloudVault20201125FetchAuditLogRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIntervalEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntervalStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125FetchAuditLogRequest) validateIntervalEnd(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalEnd) { // not required + return nil + } + + if err := validate.FormatOf("interval_end", "body", "date-time", m.IntervalEnd.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125FetchAuditLogRequest) validateIntervalStart(formats strfmt.Registry) error { + + if swag.IsZero(m.IntervalStart) { // not required + return nil + } + + if err := validate.FormatOf("interval_start", "body", "date-time", m.IntervalStart.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125FetchAuditLogRequest) 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 *HashicorpCloudVault20201125FetchAuditLogRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125FetchAuditLogRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125FetchAuditLogRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_response.go new file mode 100644 index 00000000..2f2c74bc --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_fetch_audit_log_response.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" +) + +// HashicorpCloudVault20201125FetchAuditLogResponse hashicorp cloud vault 20201125 fetch audit log response +// +// swagger:model hashicorp.cloud.vault_20201125.FetchAuditLogResponse +type HashicorpCloudVault20201125FetchAuditLogResponse struct { + + // log id + LogID string `json:"log_id,omitempty"` + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 fetch audit log response +func (m *HashicorpCloudVault20201125FetchAuditLogResponse) 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 *HashicorpCloudVault20201125FetchAuditLogResponse) 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 *HashicorpCloudVault20201125FetchAuditLogResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125FetchAuditLogResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125FetchAuditLogResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_admin_token_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_admin_token_response.go new file mode 100644 index 00000000..feb9b38b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_admin_token_response.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetAdminTokenResponse hashicorp cloud vault 20201125 get admin token response +// +// swagger:model hashicorp.cloud.vault_20201125.GetAdminTokenResponse +type HashicorpCloudVault20201125GetAdminTokenResponse struct { + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get admin token response +func (m *HashicorpCloudVault20201125GetAdminTokenResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetAdminTokenResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetAdminTokenResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetAdminTokenResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_audit_log_status_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_audit_log_status_response.go new file mode 100644 index 00000000..9906f601 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_audit_log_status_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetAuditLogStatusResponse hashicorp cloud vault 20201125 get audit log status response +// +// swagger:model hashicorp.cloud.vault_20201125.GetAuditLogStatusResponse +type HashicorpCloudVault20201125GetAuditLogStatusResponse struct { + + // log + Log *HashicorpCloudVault20201125AuditLog `json:"log,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get audit log status response +func (m *HashicorpCloudVault20201125GetAuditLogStatusResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLog(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125GetAuditLogStatusResponse) validateLog(formats strfmt.Registry) error { + + if swag.IsZero(m.Log) { // not required + return nil + } + + if m.Log != nil { + if err := m.Log.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("log") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetAuditLogStatusResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetAuditLogStatusResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetAuditLogStatusResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_c_o_r_s_config_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_c_o_r_s_config_response.go new file mode 100644 index 00000000..339a8b7b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_c_o_r_s_config_response.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetCORSConfigResponse hashicorp cloud vault 20201125 get c o r s config response +// +// swagger:model hashicorp.cloud.vault_20201125.GetCORSConfigResponse +type HashicorpCloudVault20201125GetCORSConfigResponse struct { + + // allowed_headers are the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins are the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // enabled returns true if CORS is enabled. + Enabled bool `json:"enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get c o r s config response +func (m *HashicorpCloudVault20201125GetCORSConfigResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetCORSConfigResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetCORSConfigResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetCORSConfigResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_client_counts_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_client_counts_response.go new file mode 100644 index 00000000..90c417c0 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_client_counts_response.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetClientCountsResponse hashicorp cloud vault 20201125 get client counts response +// +// swagger:model hashicorp.cloud.vault_20201125.GetClientCountsResponse +type HashicorpCloudVault20201125GetClientCountsResponse struct { + + // clients + Clients string `json:"clients,omitempty"` + + // distinct entities + DistinctEntities string `json:"distinct_entities,omitempty"` + + // non entity tokens + NonEntityTokens string `json:"non_entity_tokens,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get client counts response +func (m *HashicorpCloudVault20201125GetClientCountsResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetClientCountsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetClientCountsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetClientCountsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_response.go new file mode 100644 index 00000000..2f69474a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetResponse hashicorp cloud vault 20201125 get response +// +// swagger:model hashicorp.cloud.vault_20201125.GetResponse +type HashicorpCloudVault20201125GetResponse struct { + + // cluster + Cluster *HashicorpCloudVault20201125Cluster `json:"cluster,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get response +func (m *HashicorpCloudVault20201125GetResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125GetResponse) validateCluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_snapshot_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_snapshot_response.go new file mode 100644 index 00000000..9fc709dc --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_get_snapshot_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125GetSnapshotResponse GetSnapshotResponse is a response for retrieving a snapshot's information. +// +// swagger:model hashicorp.cloud.vault_20201125.GetSnapshotResponse +type HashicorpCloudVault20201125GetSnapshotResponse struct { + + // snapshot is the requested snapshot. + Snapshot *HashicorpCloudVault20201125Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 get snapshot response +func (m *HashicorpCloudVault20201125GetSnapshotResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125GetSnapshotResponse) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125GetSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125GetSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster.go new file mode 100644 index 00000000..ce66417c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster.go @@ -0,0 +1,100 @@ +// 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" +) + +// HashicorpCloudVault20201125InputCluster hashicorp cloud vault 20201125 input cluster +// +// swagger:model hashicorp.cloud.vault_20201125.InputCluster +type HashicorpCloudVault20201125InputCluster struct { + + // config for the cluster + Config *HashicorpCloudVault20201125InputClusterConfig `json:"config,omitempty"` + + // id is ID of the Vault cluster. + ID string `json:"id,omitempty"` + + // location is the location of the cluster. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 input cluster +func (m *HashicorpCloudVault20201125InputCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125InputCluster) validateConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125InputCluster) 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 *HashicorpCloudVault20201125InputCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125InputCluster) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125InputCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster_config.go new file mode 100644 index 00000000..e32d2f3e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_cluster_config.go @@ -0,0 +1,119 @@ +// 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" +) + +// HashicorpCloudVault20201125InputClusterConfig hashicorp cloud vault 20201125 input cluster config +// +// swagger:model hashicorp.cloud.vault_20201125.InputClusterConfig +type HashicorpCloudVault20201125InputClusterConfig struct { + + // network_config is the network configuration for the cluster + NetworkConfig *HashicorpCloudVault20201125InputNetworkConfig `json:"network_config,omitempty"` + + // Tier is the type of Vault cluster that should be provisioned + Tier HashicorpCloudVault20201125Tier `json:"tier,omitempty"` + + // vault_config is the Vault specific configuration + VaultConfig *HashicorpCloudVault20201125VaultConfig `json:"vault_config,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 input cluster config +func (m *HashicorpCloudVault20201125InputClusterConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNetworkConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVaultConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125InputClusterConfig) validateNetworkConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.NetworkConfig) { // not required + return nil + } + + if m.NetworkConfig != nil { + if err := m.NetworkConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network_config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125InputClusterConfig) validateTier(formats strfmt.Registry) error { + + if swag.IsZero(m.Tier) { // not required + return nil + } + + if err := m.Tier.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tier") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125InputClusterConfig) validateVaultConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.VaultConfig) { // not required + return nil + } + + if m.VaultConfig != nil { + if err := m.VaultConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vault_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125InputClusterConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125InputClusterConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125InputClusterConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_network_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_network_config.go new file mode 100644 index 00000000..1459d652 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_input_network_config.go @@ -0,0 +1,46 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125InputNetworkConfig hashicorp cloud vault 20201125 input network config +// +// swagger:model hashicorp.cloud.vault_20201125.InputNetworkConfig +type HashicorpCloudVault20201125InputNetworkConfig struct { + + // network_id is the ID of the network the Vault cluster belongs to. + NetworkID string `json:"network_id,omitempty"` + + // public indicates if this cluster's instances should be externally accessible. + PublicIpsEnabled bool `json:"public_ips_enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 input network config +func (m *HashicorpCloudVault20201125InputNetworkConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125InputNetworkConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125InputNetworkConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125InputNetworkConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_response.go new file mode 100644 index 00000000..3d4ddff1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_response.go @@ -0,0 +1,106 @@ +// 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 ( + "strconv" + + "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" +) + +// HashicorpCloudVault20201125ListResponse hashicorp cloud vault 20201125 list response +// +// swagger:model hashicorp.cloud.vault_20201125.ListResponse +type HashicorpCloudVault20201125ListResponse struct { + + // clusters + Clusters []*HashicorpCloudVault20201125Cluster `json:"clusters"` + + // pagination + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 list response +func (m *HashicorpCloudVault20201125ListResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusters(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125ListResponse) validateClusters(formats strfmt.Registry) error { + + if swag.IsZero(m.Clusters) { // not required + return nil + } + + for i := 0; i < len(m.Clusters); i++ { + if swag.IsZero(m.Clusters[i]) { // not required + continue + } + + if m.Clusters[i] != nil { + if err := m.Clusters[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudVault20201125ListResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ListResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ListResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125ListResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_snapshots_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_snapshots_response.go new file mode 100644 index 00000000..922d307e --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_list_snapshots_response.go @@ -0,0 +1,106 @@ +// 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 ( + "strconv" + + "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" +) + +// HashicorpCloudVault20201125ListSnapshotsResponse ListSnapshotsResponse is a response from listing snapshots. +// +// swagger:model hashicorp.cloud.vault_20201125.ListSnapshotsResponse +type HashicorpCloudVault20201125ListSnapshotsResponse struct { + + // Pagination contains the pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // snapshots is a list of available snapshots. + Snapshots []*HashicorpCloudVault20201125Snapshot `json:"snapshots"` +} + +// Validate validates this hashicorp cloud vault 20201125 list snapshots response +func (m *HashicorpCloudVault20201125ListSnapshotsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshots(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125ListSnapshotsResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125ListSnapshotsResponse) validateSnapshots(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshots) { // not required + return nil + } + + for i := 0; i < len(m.Snapshots); i++ { + if swag.IsZero(m.Snapshots[i]) { // not required + continue + } + + if m.Snapshots[i] != nil { + if err := m.Snapshots[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ListSnapshotsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125ListSnapshotsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125ListSnapshotsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_maintenance_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_maintenance_config.go new file mode 100644 index 00000000..6925498a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_maintenance_config.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 + +// HashicorpCloudVault20201125MaintenanceConfig hashicorp cloud vault 20201125 maintenance config +// +// swagger:model hashicorp.cloud.vault_20201125.MaintenanceConfig +type HashicorpCloudVault20201125MaintenanceConfig interface{} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_network_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_network_config.go new file mode 100644 index 00000000..6fcbdc85 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_network_config.go @@ -0,0 +1,77 @@ +// 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" +) + +// HashicorpCloudVault20201125NetworkConfig hashicorp cloud vault 20201125 network config +// +// swagger:model hashicorp.cloud.vault_20201125.NetworkConfig +type HashicorpCloudVault20201125NetworkConfig struct { + + // cors config + CorsConfig *HashicorpCloudVault20201125CORSConfig `json:"cors_config,omitempty"` + + // network_id is the ID of the network the Vault cluster belongs to. + NetworkID string `json:"network_id,omitempty"` + + // public_ips_enabled indicates if public IP's are enabled. + PublicIpsEnabled bool `json:"public_ips_enabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 network config +func (m *HashicorpCloudVault20201125NetworkConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCorsConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125NetworkConfig) validateCorsConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.CorsConfig) { // not required + return nil + } + + if m.CorsConfig != nil { + if err := m.CorsConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cors_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125NetworkConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125NetworkConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125NetworkConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_request.go new file mode 100644 index 00000000..ee460a78 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_request.go @@ -0,0 +1,78 @@ +// 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" +) + +// HashicorpCloudVault20201125RestoreSnapshotRequest hashicorp cloud vault 20201125 restore snapshot request +// +// swagger:model hashicorp.cloud.vault_20201125.RestoreSnapshotRequest +type HashicorpCloudVault20201125RestoreSnapshotRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // snapshot id + SnapshotID string `json:"snapshot_id,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 restore snapshot request +func (m *HashicorpCloudVault20201125RestoreSnapshotRequest) 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 *HashicorpCloudVault20201125RestoreSnapshotRequest) 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 *HashicorpCloudVault20201125RestoreSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125RestoreSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125RestoreSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_response.go new file mode 100644 index 00000000..434fa9b7 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_restore_snapshot_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" +) + +// HashicorpCloudVault20201125RestoreSnapshotResponse hashicorp cloud vault 20201125 restore snapshot response +// +// swagger:model hashicorp.cloud.vault_20201125.RestoreSnapshotResponse +type HashicorpCloudVault20201125RestoreSnapshotResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 restore snapshot response +func (m *HashicorpCloudVault20201125RestoreSnapshotResponse) 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 *HashicorpCloudVault20201125RestoreSnapshotResponse) 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 *HashicorpCloudVault20201125RestoreSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125RestoreSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125RestoreSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_request.go new file mode 100644 index 00000000..51598ac4 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_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" +) + +// HashicorpCloudVault20201125SealRequest hashicorp cloud vault 20201125 seal request +// +// swagger:model hashicorp.cloud.vault_20201125.SealRequest +type HashicorpCloudVault20201125SealRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 seal request +func (m *HashicorpCloudVault20201125SealRequest) 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 *HashicorpCloudVault20201125SealRequest) 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 *HashicorpCloudVault20201125SealRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125SealRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125SealRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_response.go new file mode 100644 index 00000000..8d70a2f1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_seal_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" +) + +// HashicorpCloudVault20201125SealResponse hashicorp cloud vault 20201125 seal response +// +// swagger:model hashicorp.cloud.vault_20201125.SealResponse +type HashicorpCloudVault20201125SealResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 seal response +func (m *HashicorpCloudVault20201125SealResponse) 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 *HashicorpCloudVault20201125SealResponse) 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 *HashicorpCloudVault20201125SealResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125SealResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125SealResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot.go new file mode 100644 index 00000000..acacac7d --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVault20201125Snapshot Snapshot is our representation needed to back-up a Vault cluster. +// +// swagger:model hashicorp.cloud.vault_20201125.Snapshot +type HashicorpCloudVault20201125Snapshot struct { + + // cluster_id is the cluster id that this snapshot backs. + ClusterID string `json:"cluster_id,omitempty"` + + // finished_at notes the time that this snapshot was finished. + // Format: date-time + FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` + + // location is the location of the Snapshot. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Name of the snapshot + Name string `json:"name,omitempty"` + + // requested_at notes the time that this snapshot was requested. + // Format: date-time + RequestedAt strfmt.DateTime `json:"requested_at,omitempty"` + + // snapshot_id is the snapshots UUID. + SnapshotID string `json:"snapshot_id,omitempty"` + + // state is represents the current status for this snapshot. + State HashicorpCloudVault20201125SnapshotState `json:"state,omitempty"` + + // type is the type of snapshot. + Type HashicorpCloudVault20201125SnapshotType `json:"type,omitempty"` + + // vault_version is the version of the Vault cluster this snapshot was taken from. + VaultVersion string `json:"vault_version,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 snapshot +func (m *HashicorpCloudVault20201125Snapshot) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFinishedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125Snapshot) validateFinishedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.FinishedAt) { // not required + return nil + } + + if err := validate.FormatOf("finished_at", "body", "date-time", m.FinishedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125Snapshot) 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 *HashicorpCloudVault20201125Snapshot) validateRequestedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requested_at", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125Snapshot) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVault20201125Snapshot) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125Snapshot) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125Snapshot) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125Snapshot + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_config.go new file mode 100644 index 00000000..b0844321 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_config.go @@ -0,0 +1,43 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125SnapshotConfig hashicorp cloud vault 20201125 snapshot config +// +// swagger:model hashicorp.cloud.vault_20201125.SnapshotConfig +type HashicorpCloudVault20201125SnapshotConfig struct { + + // periodic_snapshots_disabled indicates if automated periodic snapshots should be disabled + PeriodicSnapshotsDisabled bool `json:"periodic_snapshots_disabled,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 snapshot config +func (m *HashicorpCloudVault20201125SnapshotConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125SnapshotConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125SnapshotConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125SnapshotConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_state.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_state.go new file mode 100644 index 00000000..3e18c855 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_state.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" +) + +// HashicorpCloudVault20201125SnapshotState SnapshotState represents the lifecycle of snapshots +// +// swagger:model hashicorp.cloud.vault_20201125.Snapshot.State +type HashicorpCloudVault20201125SnapshotState string + +const ( + + // HashicorpCloudVault20201125SnapshotStateUNSET captures enum value "UNSET" + HashicorpCloudVault20201125SnapshotStateUNSET HashicorpCloudVault20201125SnapshotState = "UNSET" + + // HashicorpCloudVault20201125SnapshotStatePENDING captures enum value "PENDING" + HashicorpCloudVault20201125SnapshotStatePENDING HashicorpCloudVault20201125SnapshotState = "PENDING" + + // HashicorpCloudVault20201125SnapshotStateCREATING captures enum value "CREATING" + HashicorpCloudVault20201125SnapshotStateCREATING HashicorpCloudVault20201125SnapshotState = "CREATING" + + // HashicorpCloudVault20201125SnapshotStateSTORED captures enum value "STORED" + HashicorpCloudVault20201125SnapshotStateSTORED HashicorpCloudVault20201125SnapshotState = "STORED" + + // HashicorpCloudVault20201125SnapshotStateFAILED captures enum value "FAILED" + HashicorpCloudVault20201125SnapshotStateFAILED HashicorpCloudVault20201125SnapshotState = "FAILED" + + // HashicorpCloudVault20201125SnapshotStateDELETING captures enum value "DELETING" + HashicorpCloudVault20201125SnapshotStateDELETING HashicorpCloudVault20201125SnapshotState = "DELETING" +) + +// for schema +var hashicorpCloudVault20201125SnapshotStateEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125SnapshotState + if err := json.Unmarshal([]byte(`["UNSET","PENDING","CREATING","STORED","FAILED","DELETING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125SnapshotStateEnum = append(hashicorpCloudVault20201125SnapshotStateEnum, v) + } +} + +func (m HashicorpCloudVault20201125SnapshotState) validateHashicorpCloudVault20201125SnapshotStateEnum(path, location string, value HashicorpCloudVault20201125SnapshotState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125SnapshotStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 snapshot state +func (m HashicorpCloudVault20201125SnapshotState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125SnapshotStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_type.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_type.go new file mode 100644 index 00000000..825ecb2a --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_snapshot_type.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" +) + +// HashicorpCloudVault20201125SnapshotType Type represents the type of snapshots. +// +// swagger:model hashicorp.cloud.vault_20201125.Snapshot.Type +type HashicorpCloudVault20201125SnapshotType string + +const ( + + // HashicorpCloudVault20201125SnapshotTypeTYPEUNSET captures enum value "TYPE_UNSET" + HashicorpCloudVault20201125SnapshotTypeTYPEUNSET HashicorpCloudVault20201125SnapshotType = "TYPE_UNSET" + + // HashicorpCloudVault20201125SnapshotTypeAUTOMATIC captures enum value "AUTOMATIC" + HashicorpCloudVault20201125SnapshotTypeAUTOMATIC HashicorpCloudVault20201125SnapshotType = "AUTOMATIC" + + // HashicorpCloudVault20201125SnapshotTypeSCHEDULED captures enum value "SCHEDULED" + HashicorpCloudVault20201125SnapshotTypeSCHEDULED HashicorpCloudVault20201125SnapshotType = "SCHEDULED" + + // HashicorpCloudVault20201125SnapshotTypeMANUAL captures enum value "MANUAL" + HashicorpCloudVault20201125SnapshotTypeMANUAL HashicorpCloudVault20201125SnapshotType = "MANUAL" + + // HashicorpCloudVault20201125SnapshotTypeBEFOREUPGRADE captures enum value "BEFORE_UPGRADE" + HashicorpCloudVault20201125SnapshotTypeBEFOREUPGRADE HashicorpCloudVault20201125SnapshotType = "BEFORE_UPGRADE" +) + +// for schema +var hashicorpCloudVault20201125SnapshotTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125SnapshotType + if err := json.Unmarshal([]byte(`["TYPE_UNSET","AUTOMATIC","SCHEDULED","MANUAL","BEFORE_UPGRADE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125SnapshotTypeEnum = append(hashicorpCloudVault20201125SnapshotTypeEnum, v) + } +} + +func (m HashicorpCloudVault20201125SnapshotType) validateHashicorpCloudVault20201125SnapshotTypeEnum(path, location string, value HashicorpCloudVault20201125SnapshotType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125SnapshotTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 snapshot type +func (m HashicorpCloudVault20201125SnapshotType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125SnapshotTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_tier.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_tier.go new file mode 100644 index 00000000..81c861a9 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_tier.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" +) + +// HashicorpCloudVault20201125Tier hashicorp cloud vault 20201125 tier +// +// swagger:model hashicorp.cloud.vault_20201125.Tier +type HashicorpCloudVault20201125Tier string + +const ( + + // HashicorpCloudVault20201125TierDEV captures enum value "DEV" + HashicorpCloudVault20201125TierDEV HashicorpCloudVault20201125Tier = "DEV" + + // HashicorpCloudVault20201125TierSTANDARDSMALL captures enum value "STANDARD_SMALL" + HashicorpCloudVault20201125TierSTANDARDSMALL HashicorpCloudVault20201125Tier = "STANDARD_SMALL" + + // HashicorpCloudVault20201125TierSTANDARDMEDIUM captures enum value "STANDARD_MEDIUM" + HashicorpCloudVault20201125TierSTANDARDMEDIUM HashicorpCloudVault20201125Tier = "STANDARD_MEDIUM" + + // HashicorpCloudVault20201125TierSTANDARDLARGE captures enum value "STANDARD_LARGE" + HashicorpCloudVault20201125TierSTANDARDLARGE HashicorpCloudVault20201125Tier = "STANDARD_LARGE" +) + +// for schema +var hashicorpCloudVault20201125TierEnum []interface{} + +func init() { + var res []HashicorpCloudVault20201125Tier + if err := json.Unmarshal([]byte(`["DEV","STANDARD_SMALL","STANDARD_MEDIUM","STANDARD_LARGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVault20201125TierEnum = append(hashicorpCloudVault20201125TierEnum, v) + } +} + +func (m HashicorpCloudVault20201125Tier) validateHashicorpCloudVault20201125TierEnum(path, location string, value HashicorpCloudVault20201125Tier) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVault20201125TierEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault 20201125 tier +func (m HashicorpCloudVault20201125Tier) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVault20201125TierEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_request.go new file mode 100644 index 00000000..db34bc9f --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_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" +) + +// HashicorpCloudVault20201125UnsealRequest hashicorp cloud vault 20201125 unseal request +// +// swagger:model hashicorp.cloud.vault_20201125.UnsealRequest +type HashicorpCloudVault20201125UnsealRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 unseal request +func (m *HashicorpCloudVault20201125UnsealRequest) 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 *HashicorpCloudVault20201125UnsealRequest) 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 *HashicorpCloudVault20201125UnsealRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UnsealRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UnsealRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_response.go new file mode 100644 index 00000000..8abb8222 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_unseal_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" +) + +// HashicorpCloudVault20201125UnsealResponse hashicorp cloud vault 20201125 unseal response +// +// swagger:model hashicorp.cloud.vault_20201125.UnsealResponse +type HashicorpCloudVault20201125UnsealResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 unseal response +func (m *HashicorpCloudVault20201125UnsealResponse) 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 *HashicorpCloudVault20201125UnsealResponse) 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 *HashicorpCloudVault20201125UnsealResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UnsealResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UnsealResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_config_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_config_request.go new file mode 100644 index 00000000..c7219e0b --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_config_request.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 ( + "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" +) + +// HashicorpCloudVault20201125UpdateCORSConfigRequest hashicorp cloud vault 20201125 update c o r s config request +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateCORSConfigRequest +type HashicorpCloudVault20201125UpdateCORSConfigRequest struct { + + // allowed_headers sets the allowed headers. + AllowedHeaders []string `json:"allowed_headers"` + + // allowed_origins sets the allowed origins. + AllowedOrigins []string `json:"allowed_origins"` + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update c o r s config request +func (m *HashicorpCloudVault20201125UpdateCORSConfigRequest) 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 *HashicorpCloudVault20201125UpdateCORSConfigRequest) 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 *HashicorpCloudVault20201125UpdateCORSConfigRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateCORSConfigRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdateCORSConfigRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_config_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_config_response.go new file mode 100644 index 00000000..a4c74526 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_c_o_r_s_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 + +// HashicorpCloudVault20201125UpdateCORSConfigResponse hashicorp cloud vault 20201125 update c o r s config response +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateCORSConfigResponse +type HashicorpCloudVault20201125UpdateCORSConfigResponse interface{} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_request.go new file mode 100644 index 00000000..a7bfcd86 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_request.go @@ -0,0 +1,78 @@ +// 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" +) + +// HashicorpCloudVault20201125UpdatePublicIpsRequest hashicorp cloud vault 20201125 update public ips request +// +// swagger:model hashicorp.cloud.vault_20201125.UpdatePublicIpsRequest +type HashicorpCloudVault20201125UpdatePublicIpsRequest struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // enable public ips + EnablePublicIps bool `json:"enable_public_ips,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update public ips request +func (m *HashicorpCloudVault20201125UpdatePublicIpsRequest) 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 *HashicorpCloudVault20201125UpdatePublicIpsRequest) 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 *HashicorpCloudVault20201125UpdatePublicIpsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdatePublicIpsRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdatePublicIpsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_response.go new file mode 100644 index 00000000..5283cf9c --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_public_ips_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" +) + +// HashicorpCloudVault20201125UpdatePublicIpsResponse hashicorp cloud vault 20201125 update public ips response +// +// swagger:model hashicorp.cloud.vault_20201125.UpdatePublicIpsResponse +type HashicorpCloudVault20201125UpdatePublicIpsResponse struct { + + // operation represents the operation of the request. + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update public ips response +func (m *HashicorpCloudVault20201125UpdatePublicIpsResponse) 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 *HashicorpCloudVault20201125UpdatePublicIpsResponse) 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 *HashicorpCloudVault20201125UpdatePublicIpsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdatePublicIpsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdatePublicIpsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_request.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_request.go new file mode 100644 index 00000000..064d95e1 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_request.go @@ -0,0 +1,99 @@ +// 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" +) + +// HashicorpCloudVault20201125UpdateSnapshotRequest UpdateSnapshotRequest is a request to update a snapshot. +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateSnapshotRequest +type HashicorpCloudVault20201125UpdateSnapshotRequest struct { + + // mask is the mask of fields to update. + Mask *cloud.GoogleProtobufFieldMask `json:"mask,omitempty"` + + // snapshot contains the fields to update. + // + // Supported fields: name + Snapshot *HashicorpCloudVault20201125Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update snapshot request +func (m *HashicorpCloudVault20201125UpdateSnapshotRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMask(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125UpdateSnapshotRequest) validateMask(formats strfmt.Registry) error { + + if swag.IsZero(m.Mask) { // not required + return nil + } + + if m.Mask != nil { + if err := m.Mask.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mask") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVault20201125UpdateSnapshotRequest) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateSnapshotRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateSnapshotRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdateSnapshotRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_response.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_response.go new file mode 100644 index 00000000..2807e176 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_update_snapshot_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125UpdateSnapshotResponse UpdateSnapshotResponse is a response to updating a snapshot. +// +// swagger:model hashicorp.cloud.vault_20201125.UpdateSnapshotResponse +type HashicorpCloudVault20201125UpdateSnapshotResponse struct { + + // snapshot is the updated snapshot. + Snapshot *HashicorpCloudVault20201125Snapshot `json:"snapshot,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 update snapshot response +func (m *HashicorpCloudVault20201125UpdateSnapshotResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSnapshot(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVault20201125UpdateSnapshotResponse) validateSnapshot(formats strfmt.Registry) error { + + if swag.IsZero(m.Snapshot) { // not required + return nil + } + + if m.Snapshot != nil { + if err := m.Snapshot.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateSnapshotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125UpdateSnapshotResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125UpdateSnapshotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_access.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_access.go new file mode 100644 index 00000000..16f102ad --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_access.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125VaultAccess hashicorp cloud vault 20201125 vault access +// +// swagger:model hashicorp.cloud.vault_20201125.VaultAccess +type HashicorpCloudVault20201125VaultAccess struct { + + // recovery key + RecoveryKey string `json:"recovery_key,omitempty"` + + // root token + RootToken string `json:"root_token,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 vault access +func (m *HashicorpCloudVault20201125VaultAccess) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125VaultAccess) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125VaultAccess) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125VaultAccess + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_config.go b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_config.go new file mode 100644 index 00000000..11157896 --- /dev/null +++ b/clients/cloud-vault-service/preview/2020-11-25/models/hashicorp_cloud_vault20201125_vault_config.go @@ -0,0 +1,50 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVault20201125VaultConfig hashicorp cloud vault 20201125 vault config +// +// swagger:model hashicorp.cloud.vault_20201125.VaultConfig +type HashicorpCloudVault20201125VaultConfig struct { + + // initial_version is the initial Vault version to use when creating the + // cluster. Once the cluster is created, this value is no longer used. + InitialVersion string `json:"initial_version,omitempty"` + + // max_lease_ttl is the max lease ttl for this Vault cluster. + MaxLeaseTTL string `json:"max_lease_ttl,omitempty"` + + // namespace is the name of the customer namespace. + Namespace string `json:"namespace,omitempty"` +} + +// Validate validates this hashicorp cloud vault 20201125 vault config +func (m *HashicorpCloudVault20201125VaultConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVault20201125VaultConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVault20201125VaultConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVault20201125VaultConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}