diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/client/cloud_vault_link_service_client.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/cloud_vault_link_service_client.go new file mode 100644 index 00000000..94e37896 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/cloud_vault_link_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-link-service/preview/2022-11-07/client/vault_link_service" +) + +// Default cloud vault link 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 link service HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudVaultLinkService { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud vault link service HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudVaultLinkService { + // 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 link service client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudVaultLinkService { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudVaultLinkService) + cli.Transport = transport + cli.VaultLinkService = vault_link_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 +} + +// CloudVaultLinkService is a client for cloud vault link service +type CloudVaultLinkService struct { + VaultLinkService vault_link_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudVaultLinkService) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.VaultLinkService.SetTransport(transport) +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go new file mode 100644 index 00000000..5eaee430 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewGetLinkedClusterParams creates a new GetLinkedClusterParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLinkedClusterParams() *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLinkedClusterParamsWithTimeout creates a new GetLinkedClusterParams object +// with the ability to set a timeout on a request. +func NewGetLinkedClusterParamsWithTimeout(timeout time.Duration) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + timeout: timeout, + } +} + +// NewGetLinkedClusterParamsWithContext creates a new GetLinkedClusterParams object +// with the ability to set a context for a request. +func NewGetLinkedClusterParamsWithContext(ctx context.Context) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + Context: ctx, + } +} + +// NewGetLinkedClusterParamsWithHTTPClient creates a new GetLinkedClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLinkedClusterParamsWithHTTPClient(client *http.Client) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + HTTPClient: client, + } +} + +/* +GetLinkedClusterParams contains all the parameters to send to the API endpoint + + for the get linked cluster operation. + + Typically these are written to a http.Request. +*/ +type GetLinkedClusterParams 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 +} + +// WithDefaults hydrates default values in the get linked cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterParams) WithDefaults() *GetLinkedClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get linked cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get linked cluster params +func (o *GetLinkedClusterParams) WithTimeout(timeout time.Duration) *GetLinkedClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get linked cluster params +func (o *GetLinkedClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get linked cluster params +func (o *GetLinkedClusterParams) WithContext(ctx context.Context) *GetLinkedClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get linked cluster params +func (o *GetLinkedClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get linked cluster params +func (o *GetLinkedClusterParams) WithHTTPClient(client *http.Client) *GetLinkedClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get linked cluster params +func (o *GetLinkedClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get linked cluster params +func (o *GetLinkedClusterParams) WithClusterID(clusterID string) *GetLinkedClusterParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get linked cluster params +func (o *GetLinkedClusterParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationOrganizationID(locationOrganizationID string) *GetLinkedClusterParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationProjectID(locationProjectID string) *GetLinkedClusterParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationRegionProvider(locationRegionProvider *string) *GetLinkedClusterParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationRegionRegion(locationRegionRegion *string) *GetLinkedClusterParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLinkedClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go new file mode 100644 index 00000000..dbf58602 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewGetLinkedClusterPolicyParams creates a new GetLinkedClusterPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLinkedClusterPolicyParams() *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLinkedClusterPolicyParamsWithTimeout creates a new GetLinkedClusterPolicyParams object +// with the ability to set a timeout on a request. +func NewGetLinkedClusterPolicyParamsWithTimeout(timeout time.Duration) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + timeout: timeout, + } +} + +// NewGetLinkedClusterPolicyParamsWithContext creates a new GetLinkedClusterPolicyParams object +// with the ability to set a context for a request. +func NewGetLinkedClusterPolicyParamsWithContext(ctx context.Context) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + Context: ctx, + } +} + +// NewGetLinkedClusterPolicyParamsWithHTTPClient creates a new GetLinkedClusterPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLinkedClusterPolicyParamsWithHTTPClient(client *http.Client) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + HTTPClient: client, + } +} + +/* +GetLinkedClusterPolicyParams contains all the parameters to send to the API endpoint + + for the get linked cluster policy operation. + + Typically these are written to a http.Request. +*/ +type GetLinkedClusterPolicyParams 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 +} + +// WithDefaults hydrates default values in the get linked cluster policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterPolicyParams) WithDefaults() *GetLinkedClusterPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get linked cluster policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithTimeout(timeout time.Duration) *GetLinkedClusterPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithContext(ctx context.Context) *GetLinkedClusterPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithHTTPClient(client *http.Client) *GetLinkedClusterPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithClusterID(clusterID *string) *GetLinkedClusterPolicyParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationOrganizationID(locationOrganizationID string) *GetLinkedClusterPolicyParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationProjectID(locationProjectID string) *GetLinkedClusterPolicyParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationRegionProvider(locationRegionProvider *string) *GetLinkedClusterPolicyParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationRegionRegion(locationRegionRegion *string) *GetLinkedClusterPolicyParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLinkedClusterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ClusterID != nil { + + // query param clusterId + var qrClusterID string + + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + + if err := r.SetQueryParam("clusterId", qClusterID); err != nil { + return err + } + } + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go new file mode 100644 index 00000000..65300610 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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-link-service/preview/2022-11-07/models" +) + +// GetLinkedClusterPolicyReader is a Reader for the GetLinkedClusterPolicy structure. +type GetLinkedClusterPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLinkedClusterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLinkedClusterPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetLinkedClusterPolicyDefault(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 + } +} + +// NewGetLinkedClusterPolicyOK creates a GetLinkedClusterPolicyOK with default headers values +func NewGetLinkedClusterPolicyOK() *GetLinkedClusterPolicyOK { + return &GetLinkedClusterPolicyOK{} +} + +/* +GetLinkedClusterPolicyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetLinkedClusterPolicyOK struct { + Payload *models.HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse +} + +// IsSuccess returns true when this get linked cluster policy o k response has a 2xx status code +func (o *GetLinkedClusterPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get linked cluster policy o k response has a 3xx status code +func (o *GetLinkedClusterPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get linked cluster policy o k response has a 4xx status code +func (o *GetLinkedClusterPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get linked cluster policy o k response has a 5xx status code +func (o *GetLinkedClusterPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get linked cluster policy o k response a status code equal to that given +func (o *GetLinkedClusterPolicyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetLinkedClusterPolicyOK) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] getLinkedClusterPolicyOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterPolicyOK) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] getLinkedClusterPolicyOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterPolicyOK) GetPayload() *models.HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse { + return o.Payload +} + +func (o *GetLinkedClusterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLinkedClusterPolicyDefault creates a GetLinkedClusterPolicyDefault with default headers values +func NewGetLinkedClusterPolicyDefault(code int) *GetLinkedClusterPolicyDefault { + return &GetLinkedClusterPolicyDefault{ + _statusCode: code, + } +} + +/* +GetLinkedClusterPolicyDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetLinkedClusterPolicyDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// Code gets the status code for the get linked cluster policy default response +func (o *GetLinkedClusterPolicyDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this get linked cluster policy default response has a 2xx status code +func (o *GetLinkedClusterPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get linked cluster policy default response has a 3xx status code +func (o *GetLinkedClusterPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get linked cluster policy default response has a 4xx status code +func (o *GetLinkedClusterPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get linked cluster policy default response has a 5xx status code +func (o *GetLinkedClusterPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get linked cluster policy default response a status code equal to that given +func (o *GetLinkedClusterPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *GetLinkedClusterPolicyDefault) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] GetLinkedClusterPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterPolicyDefault) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] GetLinkedClusterPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterPolicyDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *GetLinkedClusterPolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // 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-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go new file mode 100644 index 00000000..7c95b216 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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-link-service/preview/2022-11-07/models" +) + +// GetLinkedClusterReader is a Reader for the GetLinkedCluster structure. +type GetLinkedClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLinkedClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLinkedClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetLinkedClusterDefault(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 + } +} + +// NewGetLinkedClusterOK creates a GetLinkedClusterOK with default headers values +func NewGetLinkedClusterOK() *GetLinkedClusterOK { + return &GetLinkedClusterOK{} +} + +/* +GetLinkedClusterOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetLinkedClusterOK struct { + Payload *models.HashicorpCloudVaultLink20221107GetLinkedClusterResponse +} + +// IsSuccess returns true when this get linked cluster o k response has a 2xx status code +func (o *GetLinkedClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get linked cluster o k response has a 3xx status code +func (o *GetLinkedClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get linked cluster o k response has a 4xx status code +func (o *GetLinkedClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get linked cluster o k response has a 5xx status code +func (o *GetLinkedClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get linked cluster o k response a status code equal to that given +func (o *GetLinkedClusterOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetLinkedClusterOK) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] getLinkedClusterOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterOK) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] getLinkedClusterOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterOK) GetPayload() *models.HashicorpCloudVaultLink20221107GetLinkedClusterResponse { + return o.Payload +} + +func (o *GetLinkedClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVaultLink20221107GetLinkedClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLinkedClusterDefault creates a GetLinkedClusterDefault with default headers values +func NewGetLinkedClusterDefault(code int) *GetLinkedClusterDefault { + return &GetLinkedClusterDefault{ + _statusCode: code, + } +} + +/* +GetLinkedClusterDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetLinkedClusterDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// Code gets the status code for the get linked cluster default response +func (o *GetLinkedClusterDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this get linked cluster default response has a 2xx status code +func (o *GetLinkedClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get linked cluster default response has a 3xx status code +func (o *GetLinkedClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get linked cluster default response has a 4xx status code +func (o *GetLinkedClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get linked cluster default response has a 5xx status code +func (o *GetLinkedClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get linked cluster default response a status code equal to that given +func (o *GetLinkedClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *GetLinkedClusterDefault) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] GetLinkedCluster default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterDefault) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] GetLinkedCluster default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *GetLinkedClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // 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-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go new file mode 100644 index 00000000..f1aa4aa4 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewRevokeLinkedClusterCredentialsParams creates a new RevokeLinkedClusterCredentialsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRevokeLinkedClusterCredentialsParams() *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithTimeout creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a timeout on a request. +func NewRevokeLinkedClusterCredentialsParamsWithTimeout(timeout time.Duration) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + timeout: timeout, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithContext creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a context for a request. +func NewRevokeLinkedClusterCredentialsParamsWithContext(ctx context.Context) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + Context: ctx, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithHTTPClient creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRevokeLinkedClusterCredentialsParamsWithHTTPClient(client *http.Client) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + HTTPClient: client, + } +} + +/* +RevokeLinkedClusterCredentialsParams contains all the parameters to send to the API endpoint + + for the revoke linked cluster credentials operation. + + Typically these are written to a http.Request. +*/ +type RevokeLinkedClusterCredentialsParams 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 +} + +// WithDefaults hydrates default values in the revoke linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeLinkedClusterCredentialsParams) WithDefaults() *RevokeLinkedClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeLinkedClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithTimeout(timeout time.Duration) *RevokeLinkedClusterCredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithContext(ctx context.Context) *RevokeLinkedClusterCredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithHTTPClient(client *http.Client) *RevokeLinkedClusterCredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithClusterID(clusterID string) *RevokeLinkedClusterCredentialsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationOrganizationID(locationOrganizationID string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationProjectID(locationProjectID string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationRegionProvider(locationRegionProvider *string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationRegionRegion(locationRegionRegion *string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *RevokeLinkedClusterCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go new file mode 100644 index 00000000..e0920e69 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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-link-service/preview/2022-11-07/models" +) + +// RevokeLinkedClusterCredentialsReader is a Reader for the RevokeLinkedClusterCredentials structure. +type RevokeLinkedClusterCredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RevokeLinkedClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRevokeLinkedClusterCredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRevokeLinkedClusterCredentialsDefault(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 + } +} + +// NewRevokeLinkedClusterCredentialsOK creates a RevokeLinkedClusterCredentialsOK with default headers values +func NewRevokeLinkedClusterCredentialsOK() *RevokeLinkedClusterCredentialsOK { + return &RevokeLinkedClusterCredentialsOK{} +} + +/* +RevokeLinkedClusterCredentialsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type RevokeLinkedClusterCredentialsOK struct { + Payload models.HashicorpCloudVaultLink20221107RevokeLinkedClusterCredentialsResponse +} + +// IsSuccess returns true when this revoke linked cluster credentials o k response has a 2xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this revoke linked cluster credentials o k response has a 3xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this revoke linked cluster credentials o k response has a 4xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this revoke linked cluster credentials o k response has a 5xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this revoke linked cluster credentials o k response a status code equal to that given +func (o *RevokeLinkedClusterCredentialsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RevokeLinkedClusterCredentialsOK) Error() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] revokeLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsOK) String() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] revokeLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsOK) GetPayload() models.HashicorpCloudVaultLink20221107RevokeLinkedClusterCredentialsResponse { + return o.Payload +} + +func (o *RevokeLinkedClusterCredentialsOK) 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 +} + +// NewRevokeLinkedClusterCredentialsDefault creates a RevokeLinkedClusterCredentialsDefault with default headers values +func NewRevokeLinkedClusterCredentialsDefault(code int) *RevokeLinkedClusterCredentialsDefault { + return &RevokeLinkedClusterCredentialsDefault{ + _statusCode: code, + } +} + +/* +RevokeLinkedClusterCredentialsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type RevokeLinkedClusterCredentialsDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// Code gets the status code for the revoke linked cluster credentials default response +func (o *RevokeLinkedClusterCredentialsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this revoke linked cluster credentials default response has a 2xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this revoke linked cluster credentials default response has a 3xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this revoke linked cluster credentials default response has a 4xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this revoke linked cluster credentials default response has a 5xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this revoke linked cluster credentials default response a status code equal to that given +func (o *RevokeLinkedClusterCredentialsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *RevokeLinkedClusterCredentialsDefault) Error() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] RevokeLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsDefault) String() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] RevokeLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *RevokeLinkedClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // 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-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go new file mode 100644 index 00000000..30a94a92 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewRotateLinkedClusterCredentialsParams creates a new RotateLinkedClusterCredentialsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRotateLinkedClusterCredentialsParams() *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithTimeout creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a timeout on a request. +func NewRotateLinkedClusterCredentialsParamsWithTimeout(timeout time.Duration) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + timeout: timeout, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithContext creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a context for a request. +func NewRotateLinkedClusterCredentialsParamsWithContext(ctx context.Context) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + Context: ctx, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithHTTPClient creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRotateLinkedClusterCredentialsParamsWithHTTPClient(client *http.Client) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + HTTPClient: client, + } +} + +/* +RotateLinkedClusterCredentialsParams contains all the parameters to send to the API endpoint + + for the rotate linked cluster credentials operation. + + Typically these are written to a http.Request. +*/ +type RotateLinkedClusterCredentialsParams struct { + + // 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 +} + +// WithDefaults hydrates default values in the rotate linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RotateLinkedClusterCredentialsParams) WithDefaults() *RotateLinkedClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the rotate linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RotateLinkedClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithTimeout(timeout time.Duration) *RotateLinkedClusterCredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithContext(ctx context.Context) *RotateLinkedClusterCredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithHTTPClient(client *http.Client) *RotateLinkedClusterCredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithClusterID(clusterID string) *RotateLinkedClusterCredentialsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithLocationOrganizationID(locationOrganizationID string) *RotateLinkedClusterCredentialsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithLocationProjectID(locationProjectID string) *RotateLinkedClusterCredentialsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *RotateLinkedClusterCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go new file mode 100644 index 00000000..13d563e4 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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-link-service/preview/2022-11-07/models" +) + +// RotateLinkedClusterCredentialsReader is a Reader for the RotateLinkedClusterCredentials structure. +type RotateLinkedClusterCredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RotateLinkedClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRotateLinkedClusterCredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRotateLinkedClusterCredentialsDefault(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 + } +} + +// NewRotateLinkedClusterCredentialsOK creates a RotateLinkedClusterCredentialsOK with default headers values +func NewRotateLinkedClusterCredentialsOK() *RotateLinkedClusterCredentialsOK { + return &RotateLinkedClusterCredentialsOK{} +} + +/* +RotateLinkedClusterCredentialsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type RotateLinkedClusterCredentialsOK struct { + Payload *models.HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse +} + +// IsSuccess returns true when this rotate linked cluster credentials o k response has a 2xx status code +func (o *RotateLinkedClusterCredentialsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this rotate linked cluster credentials o k response has a 3xx status code +func (o *RotateLinkedClusterCredentialsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rotate linked cluster credentials o k response has a 4xx status code +func (o *RotateLinkedClusterCredentialsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this rotate linked cluster credentials o k response has a 5xx status code +func (o *RotateLinkedClusterCredentialsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this rotate linked cluster credentials o k response a status code equal to that given +func (o *RotateLinkedClusterCredentialsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RotateLinkedClusterCredentialsOK) Error() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] rotateLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsOK) String() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] rotateLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsOK) GetPayload() *models.HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse { + return o.Payload +} + +func (o *RotateLinkedClusterCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRotateLinkedClusterCredentialsDefault creates a RotateLinkedClusterCredentialsDefault with default headers values +func NewRotateLinkedClusterCredentialsDefault(code int) *RotateLinkedClusterCredentialsDefault { + return &RotateLinkedClusterCredentialsDefault{ + _statusCode: code, + } +} + +/* +RotateLinkedClusterCredentialsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type RotateLinkedClusterCredentialsDefault struct { + _statusCode int + + Payload *cloud.GoogleRPCStatus +} + +// Code gets the status code for the rotate linked cluster credentials default response +func (o *RotateLinkedClusterCredentialsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this rotate linked cluster credentials default response has a 2xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this rotate linked cluster credentials default response has a 3xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this rotate linked cluster credentials default response has a 4xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this rotate linked cluster credentials default response has a 5xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this rotate linked cluster credentials default response a status code equal to that given +func (o *RotateLinkedClusterCredentialsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *RotateLinkedClusterCredentialsDefault) Error() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] RotateLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsDefault) String() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] RotateLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsDefault) GetPayload() *cloud.GoogleRPCStatus { + return o.Payload +} + +func (o *RotateLinkedClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GoogleRPCStatus) + + // 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-link-service/preview/2022-11-07/client/vault_link_service/vault_link_service_client.go b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/vault_link_service_client.go new file mode 100644 index 00000000..7333e344 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/client/vault_link_service/vault_link_service_client.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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 link service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vault link service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetLinkedCluster(params *GetLinkedClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterOK, error) + + GetLinkedClusterPolicy(params *GetLinkedClusterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterPolicyOK, error) + + RevokeLinkedClusterCredentials(params *RevokeLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeLinkedClusterCredentialsOK, error) + + RotateLinkedClusterCredentials(params *RotateLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RotateLinkedClusterCredentialsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetLinkedCluster get linked cluster API +*/ +func (a *Client) GetLinkedCluster(params *GetLinkedClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLinkedClusterParams() + } + op := &runtime.ClientOperation{ + ID: "GetLinkedCluster", + Method: "GET", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLinkedClusterReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLinkedClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetLinkedClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetLinkedClusterPolicy get linked cluster policy API +*/ +func (a *Client) GetLinkedClusterPolicy(params *GetLinkedClusterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLinkedClusterPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "GetLinkedClusterPolicy", + Method: "GET", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLinkedClusterPolicyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLinkedClusterPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetLinkedClusterPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +RevokeLinkedClusterCredentials revoke linked cluster credentials API +*/ +func (a *Client) RevokeLinkedClusterCredentials(params *RevokeLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeLinkedClusterCredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRevokeLinkedClusterCredentialsParams() + } + op := &runtime.ClientOperation{ + ID: "RevokeLinkedClusterCredentials", + Method: "DELETE", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RevokeLinkedClusterCredentialsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RevokeLinkedClusterCredentialsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RevokeLinkedClusterCredentialsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +RotateLinkedClusterCredentials rotate linked cluster credentials API +*/ +func (a *Client) RotateLinkedClusterCredentials(params *RotateLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RotateLinkedClusterCredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRotateLinkedClusterCredentialsParams() + } + op := &runtime.ClientOperation{ + ID: "RotateLinkedClusterCredentials", + Method: "POST", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RotateLinkedClusterCredentialsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RotateLinkedClusterCredentialsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RotateLinkedClusterCredentialsDefault) + 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-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_policy_response.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_policy_response.go new file mode 100644 index 00000000..eca04c15 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_policy_response.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 ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse hashicorp cloud vault link 20221107 get linked cluster policy response +// +// swagger:model hashicorp.cloud.vault_link_20221107.GetLinkedClusterPolicyResponse +type HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse struct { + + // policy refers to the HCL formatted policy + Policy string `json:"policy,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 get linked cluster policy response +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 get linked cluster policy response based on context it is used +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107GetLinkedClusterPolicyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_response.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_response.go new file mode 100644 index 00000000..59fbf72f --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_get_linked_cluster_response.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVaultLink20221107GetLinkedClusterResponse hashicorp cloud vault link 20221107 get linked cluster response +// +// swagger:model hashicorp.cloud.vault_link_20221107.GetLinkedClusterResponse +type HashicorpCloudVaultLink20221107GetLinkedClusterResponse struct { + + // cluster + Cluster *HashicorpCloudVaultLink20221107LinkedCluster `json:"cluster,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 get linked cluster response +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) 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 *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud vault link 20221107 get linked cluster response based on the context it is used +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107GetLinkedClusterResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107GetLinkedClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster.go new file mode 100644 index 00000000..53b18f6e --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudVaultLink20221107LinkedCluster hashicorp cloud vault link 20221107 linked cluster +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedCluster +type HashicorpCloudVaultLink20221107LinkedCluster struct { + + // autopilot enabled + AutopilotEnabled bool `json:"autopilotEnabled,omitempty"` + + // This is the self-managed cluster name and it differs from the HCP's internal id and HCP's slug id because + // it is configured directly in the self-managed cluster. + ClusterName string `json:"clusterName,omitempty"` + + // current version + CurrentVersion string `json:"currentVersion,omitempty"` + + // ha enabled + HaEnabled bool `json:"haEnabled,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // internal Id + InternalID string `json:"internalId,omitempty"` + + // is sealed + IsSealed bool `json:"isSealed,omitempty"` + + // linked at + // Format: date-time + LinkedAt strfmt.DateTime `json:"linkedAt,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // node statuses + NodeStatuses []*HashicorpCloudVaultLink20221107LinkedClusterNode `json:"nodeStatuses"` + + // raft quorum status + RaftQuorumStatus *HashicorpCloudVaultLink20221107RaftQuorumStatus `json:"raftQuorumStatus,omitempty"` + + // state + State *HashicorpCloudVaultLink20221107LinkedClusterState `json:"state,omitempty"` + + // storage type + StorageType string `json:"storageType,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster +func (m *HashicorpCloudVaultLink20221107LinkedCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLinkedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeStatuses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRaftQuorumStatus(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 *HashicorpCloudVaultLink20221107LinkedCluster) validateLinkedAt(formats strfmt.Registry) error { + if swag.IsZero(m.LinkedAt) { // not required + return nil + } + + if err := validate.FormatOf("linkedAt", "body", "date-time", m.LinkedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) validateNodeStatuses(formats strfmt.Registry) error { + if swag.IsZero(m.NodeStatuses) { // not required + return nil + } + + for i := 0; i < len(m.NodeStatuses); i++ { + if swag.IsZero(m.NodeStatuses[i]) { // not required + continue + } + + if m.NodeStatuses[i] != nil { + if err := m.NodeStatuses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) validateRaftQuorumStatus(formats strfmt.Registry) error { + if swag.IsZero(m.RaftQuorumStatus) { // not required + return nil + } + + if m.RaftQuorumStatus != nil { + if err := m.RaftQuorumStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("raftQuorumStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("raftQuorumStatus") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("state") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud vault link 20221107 linked cluster based on the context it is used +func (m *HashicorpCloudVaultLink20221107LinkedCluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNodeStatuses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRaftQuorumStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateState(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.Location != nil { + if err := m.Location.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) contextValidateNodeStatuses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NodeStatuses); i++ { + + if m.NodeStatuses[i] != nil { + if err := m.NodeStatuses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) contextValidateRaftQuorumStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.RaftQuorumStatus != nil { + if err := m.RaftQuorumStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("raftQuorumStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("raftQuorumStatus") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedCluster) contextValidateState(ctx context.Context, formats strfmt.Registry) error { + + if m.State != nil { + if err := m.State.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107LinkedCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107LinkedCluster) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107LinkedCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node.go new file mode 100644 index 00000000..e186dd4f --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterNode hashicorp cloud vault link 20221107 linked cluster node +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedClusterNode +type HashicorpCloudVaultLink20221107LinkedClusterNode struct { + + // alternative_versions is a list of versions that should also be considered for + // an update as they might come with additional improvements and features. + AlternativeVersions []string `json:"alternativeVersions"` + + // current report + // Format: date-time + CurrentReport strfmt.DateTime `json:"currentReport,omitempty"` + + // current_version is the node's current version in semantic version format. + CurrentVersion string `json:"currentVersion,omitempty"` + + // has_security_flaw will be true if the current version has a security flaw. + HasSecurityFlaws bool `json:"hasSecurityFlaws,omitempty"` + + // hostname + Hostname string `json:"hostname,omitempty"` + + // internal Id + InternalID string `json:"internalId,omitempty"` + + // last reported at + // Format: date-time + LastReportedAt strfmt.DateTime `json:"lastReportedAt,omitempty"` + + // leader status + LeaderStatus *HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus `json:"leaderStatus,omitempty"` + + // linked cluster internal Id + LinkedClusterInternalID string `json:"linkedClusterInternalId,omitempty"` + + // listener addresses + ListenerAddresses []string `json:"listenerAddresses"` + + // log level + LogLevel *HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel `json:"logLevel,omitempty"` + + // node_binary_architecture is the lower-case architecture of the client binary + // (e.g. amd64, arm, ...). + NodeBinaryArchitecture string `json:"nodeBinaryArchitecture,omitempty"` + + // node_id is the node identification. + NodeID string `json:"nodeId,omitempty"` + + // node_initialized indicates if the node has been initialized. + NodeInitialized bool `json:"nodeInitialized,omitempty"` + + // node_os is the lower-case name of the operating system the client is + // running on (e.g. linux, windows). + NodeOs string `json:"nodeOs,omitempty"` + + // node_sealed indicates if the node is sealed. + NodeSealed bool `json:"nodeSealed,omitempty"` + + // node state + NodeState *HashicorpCloudVaultLink20221107LinkedClusterNodeState `json:"nodeState,omitempty"` + + // node_type indicates the node type. + NodeType string `json:"nodeType,omitempty"` + + // recommended_version is the version the product should ideally be updated to. + RecommendedVersion string `json:"recommendedVersion,omitempty"` + + // status is the status of the current version. The status may help to + // determine the urgency of the update. + Status *HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus `json:"status,omitempty"` + + // status_version is the version of the status message format. To ensure + // that the version is not omitted by accident the initial version is 1. + StatusVersion int64 `json:"statusVersion,omitempty"` + + // storage type + StorageType string `json:"storageType,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster node +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentReport(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastReportedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLeaderStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLogLevel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateCurrentReport(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentReport) { // not required + return nil + } + + if err := validate.FormatOf("currentReport", "body", "date-time", m.CurrentReport.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateLastReportedAt(formats strfmt.Registry) error { + if swag.IsZero(m.LastReportedAt) { // not required + return nil + } + + if err := validate.FormatOf("lastReportedAt", "body", "date-time", m.LastReportedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateLeaderStatus(formats strfmt.Registry) error { + if swag.IsZero(m.LeaderStatus) { // not required + return nil + } + + if m.LeaderStatus != nil { + if err := m.LeaderStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leaderStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leaderStatus") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(m.LogLevel) { // not required + return nil + } + + if m.LogLevel != nil { + if err := m.LogLevel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logLevel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logLevel") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateNodeState(formats strfmt.Registry) error { + if swag.IsZero(m.NodeState) { // not required + return nil + } + + if m.NodeState != nil { + if err := m.NodeState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeState") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud vault link 20221107 linked cluster node based on the context it is used +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLeaderStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLogLevel(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNodeState(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) contextValidateLeaderStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.LeaderStatus != nil { + if err := m.LeaderStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leaderStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leaderStatus") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) contextValidateLogLevel(ctx context.Context, formats strfmt.Registry) error { + + if m.LogLevel != nil { + if err := m.LogLevel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logLevel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logLevel") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) contextValidateNodeState(ctx context.Context, formats strfmt.Registry) error { + + if m.NodeState != nil { + if err := m.NodeState.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeState") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107LinkedClusterNode) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107LinkedClusterNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_leader_status.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_leader_status.go new file mode 100644 index 00000000..dd5f8162 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_leader_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus hashicorp cloud vault link 20221107 linked cluster node leader status +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedClusterNode.LeaderStatus +type HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus string + +func NewHashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus(value HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) *HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus. +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) Pointer() *HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus { + return &m +} + +const ( + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusLEADERSTATUSCLUSTERSTATEINVALID captures enum value "LEADER_STATUS_CLUSTER_STATE_INVALID" + HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusLEADERSTATUSCLUSTERSTATEINVALID HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus = "LEADER_STATUS_CLUSTER_STATE_INVALID" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusLEADER captures enum value "LEADER" + HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusLEADER HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus = "LEADER" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusFOLLOWER captures enum value "FOLLOWER" + HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusFOLLOWER HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus = "FOLLOWER" +) + +// for schema +var hashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum []interface{} + +func init() { + var res []HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus + if err := json.Unmarshal([]byte(`["LEADER_STATUS_CLUSTER_STATE_INVALID","LEADER","FOLLOWER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum = append(hashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum, v) + } +} + +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) validateHashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum(path, location string, value HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster node leader status +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 linked cluster node leader status based on context it is used +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLeaderStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_log_level.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_log_level.go new file mode 100644 index 00000000..102e2958 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_log_level.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel hashicorp cloud vault link 20221107 linked cluster node log level +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedClusterNode.LogLevel +type HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel string + +func NewHashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel(value HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) *HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel { + return &value +} + +// Pointer returns a pointer to a freshly-allocated HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel. +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) Pointer() *HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel { + return &m +} + +const ( + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelLOGLEVELCLUSTERSTATEINVALID captures enum value "LOG_LEVEL_CLUSTER_STATE_INVALID" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelLOGLEVELCLUSTERSTATEINVALID HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "LOG_LEVEL_CLUSTER_STATE_INVALID" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelTRACE captures enum value "TRACE" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelTRACE HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "TRACE" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelDEBUG captures enum value "DEBUG" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelDEBUG HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "DEBUG" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelINFO captures enum value "INFO" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelINFO HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "INFO" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelWARN captures enum value "WARN" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelWARN HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "WARN" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelERROR captures enum value "ERROR" + HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelERROR HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel = "ERROR" +) + +// for schema +var hashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum []interface{} + +func init() { + var res []HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel + if err := json.Unmarshal([]byte(`["LOG_LEVEL_CLUSTER_STATE_INVALID","TRACE","DEBUG","INFO","WARN","ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum = append(hashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum, v) + } +} + +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) validateHashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum(path, location string, value HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster node log level +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVaultLink20221107LinkedClusterNodeLogLevelEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 linked cluster node log level based on context it is used +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeLogLevel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_state.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_state.go new file mode 100644 index 00000000..87db81c0 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_state.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterNodeState hashicorp cloud vault link 20221107 linked cluster node state +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedClusterNode.State +type HashicorpCloudVaultLink20221107LinkedClusterNodeState string + +func NewHashicorpCloudVaultLink20221107LinkedClusterNodeState(value HashicorpCloudVaultLink20221107LinkedClusterNodeState) *HashicorpCloudVaultLink20221107LinkedClusterNodeState { + return &value +} + +// Pointer returns a pointer to a freshly-allocated HashicorpCloudVaultLink20221107LinkedClusterNodeState. +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeState) Pointer() *HashicorpCloudVaultLink20221107LinkedClusterNodeState { + return &m +} + +const ( + + // HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKEDCLUSTERSTATEINVALID captures enum value "LINKED_CLUSTER_STATE_INVALID" + HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKEDCLUSTERSTATEINVALID HashicorpCloudVaultLink20221107LinkedClusterNodeState = "LINKED_CLUSTER_STATE_INVALID" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKING captures enum value "LINKING" + HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKING HashicorpCloudVaultLink20221107LinkedClusterNodeState = "LINKING" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKED captures enum value "LINKED" + HashicorpCloudVaultLink20221107LinkedClusterNodeStateLINKED HashicorpCloudVaultLink20221107LinkedClusterNodeState = "LINKED" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeStateUNLINKING captures enum value "UNLINKING" + HashicorpCloudVaultLink20221107LinkedClusterNodeStateUNLINKING HashicorpCloudVaultLink20221107LinkedClusterNodeState = "UNLINKING" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeStateUNLINKED captures enum value "UNLINKED" + HashicorpCloudVaultLink20221107LinkedClusterNodeStateUNLINKED HashicorpCloudVaultLink20221107LinkedClusterNodeState = "UNLINKED" +) + +// for schema +var hashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum []interface{} + +func init() { + var res []HashicorpCloudVaultLink20221107LinkedClusterNodeState + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_STATE_INVALID","LINKING","LINKED","UNLINKING","UNLINKED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum = append(hashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum, v) + } +} + +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeState) validateHashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum(path, location string, value HashicorpCloudVaultLink20221107LinkedClusterNodeState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster node state +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVaultLink20221107LinkedClusterNodeStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 linked cluster node state based on context it is used +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_version_status.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_version_status.go new file mode 100644 index 00000000..38aadcf3 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_node_version_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus - VERSION_UP_TO_DATE: VERSION_UP_TO_DATE is used when node is running the latest Vault Version. +// - UPGRADE_AVAILABLE: UPGRADE_AVAILABLE is used when node is running the latest minor release of a Vault Version, but there is a new major Vault version available for upgrade. +// - UPGRADE_RECOMMENDED: UPGRADE_RECOMMENDED is used when node is running an outdated but still supported version, but there is a new minor or major Vault versions available for upgrade. +// - UPGRADE_REQUIRED: UPGRADE_REQUIRED is used when node is running a no longer supported version and there are minor and major versions available for upgrade. +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedClusterNode.VersionStatus +type HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus string + +func NewHashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus(value HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) *HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus. +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) Pointer() *HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus { + return &m +} + +const ( + + // HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusLINKEDCLUSTERNODEVERSIONSTATUSINVALID captures enum value "LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID" + HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusLINKEDCLUSTERNODEVERSIONSTATUSINVALID HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus = "LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusVERSIONUPTODATE captures enum value "VERSION_UP_TO_DATE" + HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusVERSIONUPTODATE HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus = "VERSION_UP_TO_DATE" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADEAVAILABLE captures enum value "UPGRADE_AVAILABLE" + HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADEAVAILABLE HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus = "UPGRADE_AVAILABLE" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADERECOMMENDED captures enum value "UPGRADE_RECOMMENDED" + HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADERECOMMENDED HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus = "UPGRADE_RECOMMENDED" + + // HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADEREQUIRED captures enum value "UPGRADE_REQUIRED" + HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusUPGRADEREQUIRED HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus = "UPGRADE_REQUIRED" +) + +// for schema +var hashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum []interface{} + +func init() { + var res []HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID","VERSION_UP_TO_DATE","UPGRADE_AVAILABLE","UPGRADE_RECOMMENDED","UPGRADE_REQUIRED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum = append(hashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum, v) + } +} + +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) validateHashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum(path, location string, value HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster node version status +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 linked cluster node version status based on context it is used +func (m HashicorpCloudVaultLink20221107LinkedClusterNodeVersionStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_state.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_state.go new file mode 100644 index 00000000..d699796b --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_linked_cluster_state.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVaultLink20221107LinkedClusterState hashicorp cloud vault link 20221107 linked cluster state +// +// swagger:model hashicorp.cloud.vault_link_20221107.LinkedCluster.State +type HashicorpCloudVaultLink20221107LinkedClusterState string + +func NewHashicorpCloudVaultLink20221107LinkedClusterState(value HashicorpCloudVaultLink20221107LinkedClusterState) *HashicorpCloudVaultLink20221107LinkedClusterState { + return &value +} + +// Pointer returns a pointer to a freshly-allocated HashicorpCloudVaultLink20221107LinkedClusterState. +func (m HashicorpCloudVaultLink20221107LinkedClusterState) Pointer() *HashicorpCloudVaultLink20221107LinkedClusterState { + return &m +} + +const ( + + // HashicorpCloudVaultLink20221107LinkedClusterStateLINKEDCLUSTERSTATEINVALID captures enum value "LINKED_CLUSTER_STATE_INVALID" + HashicorpCloudVaultLink20221107LinkedClusterStateLINKEDCLUSTERSTATEINVALID HashicorpCloudVaultLink20221107LinkedClusterState = "LINKED_CLUSTER_STATE_INVALID" + + // HashicorpCloudVaultLink20221107LinkedClusterStateLINKING captures enum value "LINKING" + HashicorpCloudVaultLink20221107LinkedClusterStateLINKING HashicorpCloudVaultLink20221107LinkedClusterState = "LINKING" + + // HashicorpCloudVaultLink20221107LinkedClusterStateLINKED captures enum value "LINKED" + HashicorpCloudVaultLink20221107LinkedClusterStateLINKED HashicorpCloudVaultLink20221107LinkedClusterState = "LINKED" + + // HashicorpCloudVaultLink20221107LinkedClusterStateSEALED captures enum value "SEALED" + HashicorpCloudVaultLink20221107LinkedClusterStateSEALED HashicorpCloudVaultLink20221107LinkedClusterState = "SEALED" + + // HashicorpCloudVaultLink20221107LinkedClusterStateUNLINKING captures enum value "UNLINKING" + HashicorpCloudVaultLink20221107LinkedClusterStateUNLINKING HashicorpCloudVaultLink20221107LinkedClusterState = "UNLINKING" + + // HashicorpCloudVaultLink20221107LinkedClusterStateUNLINKED captures enum value "UNLINKED" + HashicorpCloudVaultLink20221107LinkedClusterStateUNLINKED HashicorpCloudVaultLink20221107LinkedClusterState = "UNLINKED" +) + +// for schema +var hashicorpCloudVaultLink20221107LinkedClusterStateEnum []interface{} + +func init() { + var res []HashicorpCloudVaultLink20221107LinkedClusterState + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_STATE_INVALID","LINKING","LINKED","SEALED","UNLINKING","UNLINKED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVaultLink20221107LinkedClusterStateEnum = append(hashicorpCloudVaultLink20221107LinkedClusterStateEnum, v) + } +} + +func (m HashicorpCloudVaultLink20221107LinkedClusterState) validateHashicorpCloudVaultLink20221107LinkedClusterStateEnum(path, location string, value HashicorpCloudVaultLink20221107LinkedClusterState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVaultLink20221107LinkedClusterStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vault link 20221107 linked cluster state +func (m HashicorpCloudVaultLink20221107LinkedClusterState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVaultLink20221107LinkedClusterStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 linked cluster state based on context it is used +func (m HashicorpCloudVaultLink20221107LinkedClusterState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_raft_quorum_status.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_raft_quorum_status.go new file mode 100644 index 00000000..3eb594d2 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_raft_quorum_status.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVaultLink20221107RaftQuorumStatus hashicorp cloud vault link 20221107 raft quorum status +// +// swagger:model hashicorp.cloud.vault_link_20221107.RaftQuorumStatus +type HashicorpCloudVaultLink20221107RaftQuorumStatus struct { + + // is healthy + IsHealthy bool `json:"isHealthy,omitempty"` + + // quorum number + QuorumNumber int32 `json:"quorumNumber,omitempty"` + + // warning + Warning string `json:"warning,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 raft quorum status +func (m *HashicorpCloudVaultLink20221107RaftQuorumStatus) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hashicorp cloud vault link 20221107 raft quorum status based on context it is used +func (m *HashicorpCloudVaultLink20221107RaftQuorumStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107RaftQuorumStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107RaftQuorumStatus) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107RaftQuorumStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_revoke_linked_cluster_credentials_response.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_revoke_linked_cluster_credentials_response.go new file mode 100644 index 00000000..62eb85e6 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_revoke_linked_cluster_credentials_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 + +// HashicorpCloudVaultLink20221107RevokeLinkedClusterCredentialsResponse hashicorp cloud vault link 20221107 revoke linked cluster credentials response +// +// swagger:model hashicorp.cloud.vault_link_20221107.RevokeLinkedClusterCredentialsResponse +type HashicorpCloudVaultLink20221107RevokeLinkedClusterCredentialsResponse interface{} diff --git a/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_rotate_linked_cluster_credentials_response.go b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_rotate_linked_cluster_credentials_response.go new file mode 100644 index 00000000..0b43c8d7 --- /dev/null +++ b/clients/cloud-vault-link-service/preview/2022-11-07/models/hashicorp_cloud_vault_link20221107_rotate_linked_cluster_credentials_response.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 ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse hashicorp cloud vault link 20221107 rotate linked cluster credentials response +// +// swagger:model hashicorp.cloud.vault_link_20221107.RotateLinkedClusterCredentialsResponse +type HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse struct { + + // client Id + ClientID string `json:"clientId,omitempty"` + + // client secret + ClientSecret string `json:"clientSecret,omitempty"` + + // cluster + Cluster *HashicorpCloudVaultLink20221107LinkedCluster `json:"cluster,omitempty"` + + // resource Id + ResourceID string `json:"resourceId,omitempty"` +} + +// Validate validates this hashicorp cloud vault link 20221107 rotate linked cluster credentials response +func (m *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) 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 *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud vault link 20221107 rotate linked cluster credentials response based on the context it is used +func (m *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVaultLink20221107RotateLinkedClusterCredentialsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/client/cloud_vault_link_service_client.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/cloud_vault_link_service_client.go new file mode 100644 index 00000000..110d8997 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/cloud_vault_link_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-link-service/stable/2022-11-07/client/vault_link_service" +) + +// Default cloud vault link 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 link service HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudVaultLinkService { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud vault link service HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudVaultLinkService { + // 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 link service client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudVaultLinkService { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudVaultLinkService) + cli.Transport = transport + cli.VaultLinkService = vault_link_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 +} + +// CloudVaultLinkService is a client for cloud vault link service +type CloudVaultLinkService struct { + VaultLinkService vault_link_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudVaultLinkService) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.VaultLinkService.SetTransport(transport) +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go new file mode 100644 index 00000000..5eaee430 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewGetLinkedClusterParams creates a new GetLinkedClusterParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLinkedClusterParams() *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLinkedClusterParamsWithTimeout creates a new GetLinkedClusterParams object +// with the ability to set a timeout on a request. +func NewGetLinkedClusterParamsWithTimeout(timeout time.Duration) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + timeout: timeout, + } +} + +// NewGetLinkedClusterParamsWithContext creates a new GetLinkedClusterParams object +// with the ability to set a context for a request. +func NewGetLinkedClusterParamsWithContext(ctx context.Context) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + Context: ctx, + } +} + +// NewGetLinkedClusterParamsWithHTTPClient creates a new GetLinkedClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLinkedClusterParamsWithHTTPClient(client *http.Client) *GetLinkedClusterParams { + return &GetLinkedClusterParams{ + HTTPClient: client, + } +} + +/* +GetLinkedClusterParams contains all the parameters to send to the API endpoint + + for the get linked cluster operation. + + Typically these are written to a http.Request. +*/ +type GetLinkedClusterParams 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 +} + +// WithDefaults hydrates default values in the get linked cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterParams) WithDefaults() *GetLinkedClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get linked cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get linked cluster params +func (o *GetLinkedClusterParams) WithTimeout(timeout time.Duration) *GetLinkedClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get linked cluster params +func (o *GetLinkedClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get linked cluster params +func (o *GetLinkedClusterParams) WithContext(ctx context.Context) *GetLinkedClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get linked cluster params +func (o *GetLinkedClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get linked cluster params +func (o *GetLinkedClusterParams) WithHTTPClient(client *http.Client) *GetLinkedClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get linked cluster params +func (o *GetLinkedClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get linked cluster params +func (o *GetLinkedClusterParams) WithClusterID(clusterID string) *GetLinkedClusterParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get linked cluster params +func (o *GetLinkedClusterParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationOrganizationID(locationOrganizationID string) *GetLinkedClusterParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationProjectID(locationProjectID string) *GetLinkedClusterParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationRegionProvider(locationRegionProvider *string) *GetLinkedClusterParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get linked cluster params +func (o *GetLinkedClusterParams) WithLocationRegionRegion(locationRegionRegion *string) *GetLinkedClusterParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get linked cluster params +func (o *GetLinkedClusterParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLinkedClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go new file mode 100644 index 00000000..dbf58602 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_parameters.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewGetLinkedClusterPolicyParams creates a new GetLinkedClusterPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLinkedClusterPolicyParams() *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLinkedClusterPolicyParamsWithTimeout creates a new GetLinkedClusterPolicyParams object +// with the ability to set a timeout on a request. +func NewGetLinkedClusterPolicyParamsWithTimeout(timeout time.Duration) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + timeout: timeout, + } +} + +// NewGetLinkedClusterPolicyParamsWithContext creates a new GetLinkedClusterPolicyParams object +// with the ability to set a context for a request. +func NewGetLinkedClusterPolicyParamsWithContext(ctx context.Context) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + Context: ctx, + } +} + +// NewGetLinkedClusterPolicyParamsWithHTTPClient creates a new GetLinkedClusterPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLinkedClusterPolicyParamsWithHTTPClient(client *http.Client) *GetLinkedClusterPolicyParams { + return &GetLinkedClusterPolicyParams{ + HTTPClient: client, + } +} + +/* +GetLinkedClusterPolicyParams contains all the parameters to send to the API endpoint + + for the get linked cluster policy operation. + + Typically these are written to a http.Request. +*/ +type GetLinkedClusterPolicyParams 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 +} + +// WithDefaults hydrates default values in the get linked cluster policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterPolicyParams) WithDefaults() *GetLinkedClusterPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get linked cluster policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLinkedClusterPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithTimeout(timeout time.Duration) *GetLinkedClusterPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithContext(ctx context.Context) *GetLinkedClusterPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithHTTPClient(client *http.Client) *GetLinkedClusterPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithClusterID(clusterID *string) *GetLinkedClusterPolicyParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationOrganizationID(locationOrganizationID string) *GetLinkedClusterPolicyParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationProjectID(locationProjectID string) *GetLinkedClusterPolicyParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationRegionProvider(locationRegionProvider *string) *GetLinkedClusterPolicyParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) WithLocationRegionRegion(locationRegionRegion *string) *GetLinkedClusterPolicyParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the get linked cluster policy params +func (o *GetLinkedClusterPolicyParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLinkedClusterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ClusterID != nil { + + // query param clusterId + var qrClusterID string + + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + + if err := r.SetQueryParam("clusterId", qClusterID); err != nil { + return err + } + } + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go new file mode 100644 index 00000000..8deb7230 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_policy_responses.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-link-service/stable/2022-11-07/models" +) + +// GetLinkedClusterPolicyReader is a Reader for the GetLinkedClusterPolicy structure. +type GetLinkedClusterPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLinkedClusterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLinkedClusterPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetLinkedClusterPolicyDefault(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 + } +} + +// NewGetLinkedClusterPolicyOK creates a GetLinkedClusterPolicyOK with default headers values +func NewGetLinkedClusterPolicyOK() *GetLinkedClusterPolicyOK { + return &GetLinkedClusterPolicyOK{} +} + +/* +GetLinkedClusterPolicyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetLinkedClusterPolicyOK struct { + Payload *models.VaultLink20221107GetLinkedClusterPolicyResponse +} + +// IsSuccess returns true when this get linked cluster policy o k response has a 2xx status code +func (o *GetLinkedClusterPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get linked cluster policy o k response has a 3xx status code +func (o *GetLinkedClusterPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get linked cluster policy o k response has a 4xx status code +func (o *GetLinkedClusterPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get linked cluster policy o k response has a 5xx status code +func (o *GetLinkedClusterPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get linked cluster policy o k response a status code equal to that given +func (o *GetLinkedClusterPolicyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetLinkedClusterPolicyOK) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] getLinkedClusterPolicyOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterPolicyOK) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] getLinkedClusterPolicyOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterPolicyOK) GetPayload() *models.VaultLink20221107GetLinkedClusterPolicyResponse { + return o.Payload +} + +func (o *GetLinkedClusterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VaultLink20221107GetLinkedClusterPolicyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLinkedClusterPolicyDefault creates a GetLinkedClusterPolicyDefault with default headers values +func NewGetLinkedClusterPolicyDefault(code int) *GetLinkedClusterPolicyDefault { + return &GetLinkedClusterPolicyDefault{ + _statusCode: code, + } +} + +/* +GetLinkedClusterPolicyDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetLinkedClusterPolicyDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// Code gets the status code for the get linked cluster policy default response +func (o *GetLinkedClusterPolicyDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this get linked cluster policy default response has a 2xx status code +func (o *GetLinkedClusterPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get linked cluster policy default response has a 3xx status code +func (o *GetLinkedClusterPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get linked cluster policy default response has a 4xx status code +func (o *GetLinkedClusterPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get linked cluster policy default response has a 5xx status code +func (o *GetLinkedClusterPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get linked cluster policy default response a status code equal to that given +func (o *GetLinkedClusterPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *GetLinkedClusterPolicyDefault) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] GetLinkedClusterPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterPolicyDefault) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy][%d] GetLinkedClusterPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterPolicyDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *GetLinkedClusterPolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // 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-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go new file mode 100644 index 00000000..b386f1b3 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/get_linked_cluster_responses.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-link-service/stable/2022-11-07/models" +) + +// GetLinkedClusterReader is a Reader for the GetLinkedCluster structure. +type GetLinkedClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLinkedClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLinkedClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetLinkedClusterDefault(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 + } +} + +// NewGetLinkedClusterOK creates a GetLinkedClusterOK with default headers values +func NewGetLinkedClusterOK() *GetLinkedClusterOK { + return &GetLinkedClusterOK{} +} + +/* +GetLinkedClusterOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetLinkedClusterOK struct { + Payload *models.VaultLink20221107GetLinkedClusterResponse +} + +// IsSuccess returns true when this get linked cluster o k response has a 2xx status code +func (o *GetLinkedClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get linked cluster o k response has a 3xx status code +func (o *GetLinkedClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get linked cluster o k response has a 4xx status code +func (o *GetLinkedClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get linked cluster o k response has a 5xx status code +func (o *GetLinkedClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get linked cluster o k response a status code equal to that given +func (o *GetLinkedClusterOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetLinkedClusterOK) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] getLinkedClusterOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterOK) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] getLinkedClusterOK %+v", 200, o.Payload) +} + +func (o *GetLinkedClusterOK) GetPayload() *models.VaultLink20221107GetLinkedClusterResponse { + return o.Payload +} + +func (o *GetLinkedClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VaultLink20221107GetLinkedClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLinkedClusterDefault creates a GetLinkedClusterDefault with default headers values +func NewGetLinkedClusterDefault(code int) *GetLinkedClusterDefault { + return &GetLinkedClusterDefault{ + _statusCode: code, + } +} + +/* +GetLinkedClusterDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetLinkedClusterDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// Code gets the status code for the get linked cluster default response +func (o *GetLinkedClusterDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this get linked cluster default response has a 2xx status code +func (o *GetLinkedClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get linked cluster default response has a 3xx status code +func (o *GetLinkedClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get linked cluster default response has a 4xx status code +func (o *GetLinkedClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get linked cluster default response has a 5xx status code +func (o *GetLinkedClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get linked cluster default response a status code equal to that given +func (o *GetLinkedClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *GetLinkedClusterDefault) Error() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] GetLinkedCluster default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterDefault) String() string { + return fmt.Sprintf("[GET /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}][%d] GetLinkedCluster default %+v", o._statusCode, o.Payload) +} + +func (o *GetLinkedClusterDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *GetLinkedClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // 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-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go new file mode 100644 index 00000000..f1aa4aa4 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewRevokeLinkedClusterCredentialsParams creates a new RevokeLinkedClusterCredentialsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRevokeLinkedClusterCredentialsParams() *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithTimeout creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a timeout on a request. +func NewRevokeLinkedClusterCredentialsParamsWithTimeout(timeout time.Duration) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + timeout: timeout, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithContext creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a context for a request. +func NewRevokeLinkedClusterCredentialsParamsWithContext(ctx context.Context) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + Context: ctx, + } +} + +// NewRevokeLinkedClusterCredentialsParamsWithHTTPClient creates a new RevokeLinkedClusterCredentialsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRevokeLinkedClusterCredentialsParamsWithHTTPClient(client *http.Client) *RevokeLinkedClusterCredentialsParams { + return &RevokeLinkedClusterCredentialsParams{ + HTTPClient: client, + } +} + +/* +RevokeLinkedClusterCredentialsParams contains all the parameters to send to the API endpoint + + for the revoke linked cluster credentials operation. + + Typically these are written to a http.Request. +*/ +type RevokeLinkedClusterCredentialsParams 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 +} + +// WithDefaults hydrates default values in the revoke linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeLinkedClusterCredentialsParams) WithDefaults() *RevokeLinkedClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeLinkedClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithTimeout(timeout time.Duration) *RevokeLinkedClusterCredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithContext(ctx context.Context) *RevokeLinkedClusterCredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithHTTPClient(client *http.Client) *RevokeLinkedClusterCredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithClusterID(clusterID string) *RevokeLinkedClusterCredentialsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationOrganizationID(locationOrganizationID string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationProjectID(locationProjectID string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationRegionProvider(locationRegionProvider *string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) WithLocationRegionRegion(locationRegionRegion *string) *RevokeLinkedClusterCredentialsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the revoke linked cluster credentials params +func (o *RevokeLinkedClusterCredentialsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *RevokeLinkedClusterCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", 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-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go new file mode 100644 index 00000000..4ca7b200 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/revoke_linked_cluster_credentials_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-link-service/stable/2022-11-07/models" +) + +// RevokeLinkedClusterCredentialsReader is a Reader for the RevokeLinkedClusterCredentials structure. +type RevokeLinkedClusterCredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RevokeLinkedClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRevokeLinkedClusterCredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRevokeLinkedClusterCredentialsDefault(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 + } +} + +// NewRevokeLinkedClusterCredentialsOK creates a RevokeLinkedClusterCredentialsOK with default headers values +func NewRevokeLinkedClusterCredentialsOK() *RevokeLinkedClusterCredentialsOK { + return &RevokeLinkedClusterCredentialsOK{} +} + +/* +RevokeLinkedClusterCredentialsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type RevokeLinkedClusterCredentialsOK struct { + Payload models.VaultLink20221107RevokeLinkedClusterCredentialsResponse +} + +// IsSuccess returns true when this revoke linked cluster credentials o k response has a 2xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this revoke linked cluster credentials o k response has a 3xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this revoke linked cluster credentials o k response has a 4xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this revoke linked cluster credentials o k response has a 5xx status code +func (o *RevokeLinkedClusterCredentialsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this revoke linked cluster credentials o k response a status code equal to that given +func (o *RevokeLinkedClusterCredentialsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RevokeLinkedClusterCredentialsOK) Error() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] revokeLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsOK) String() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] revokeLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsOK) GetPayload() models.VaultLink20221107RevokeLinkedClusterCredentialsResponse { + return o.Payload +} + +func (o *RevokeLinkedClusterCredentialsOK) 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 +} + +// NewRevokeLinkedClusterCredentialsDefault creates a RevokeLinkedClusterCredentialsDefault with default headers values +func NewRevokeLinkedClusterCredentialsDefault(code int) *RevokeLinkedClusterCredentialsDefault { + return &RevokeLinkedClusterCredentialsDefault{ + _statusCode: code, + } +} + +/* +RevokeLinkedClusterCredentialsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type RevokeLinkedClusterCredentialsDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// Code gets the status code for the revoke linked cluster credentials default response +func (o *RevokeLinkedClusterCredentialsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this revoke linked cluster credentials default response has a 2xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this revoke linked cluster credentials default response has a 3xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this revoke linked cluster credentials default response has a 4xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this revoke linked cluster credentials default response has a 5xx status code +func (o *RevokeLinkedClusterCredentialsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this revoke linked cluster credentials default response a status code equal to that given +func (o *RevokeLinkedClusterCredentialsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *RevokeLinkedClusterCredentialsDefault) Error() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] RevokeLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsDefault) String() string { + return fmt.Sprintf("[DELETE /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}][%d] RevokeLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeLinkedClusterCredentialsDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *RevokeLinkedClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // 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-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go new file mode 100644 index 00000000..30a94a92 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_parameters.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" +) + +// NewRotateLinkedClusterCredentialsParams creates a new RotateLinkedClusterCredentialsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRotateLinkedClusterCredentialsParams() *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithTimeout creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a timeout on a request. +func NewRotateLinkedClusterCredentialsParamsWithTimeout(timeout time.Duration) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + timeout: timeout, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithContext creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a context for a request. +func NewRotateLinkedClusterCredentialsParamsWithContext(ctx context.Context) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + Context: ctx, + } +} + +// NewRotateLinkedClusterCredentialsParamsWithHTTPClient creates a new RotateLinkedClusterCredentialsParams object +// with the ability to set a custom HTTPClient for a request. +func NewRotateLinkedClusterCredentialsParamsWithHTTPClient(client *http.Client) *RotateLinkedClusterCredentialsParams { + return &RotateLinkedClusterCredentialsParams{ + HTTPClient: client, + } +} + +/* +RotateLinkedClusterCredentialsParams contains all the parameters to send to the API endpoint + + for the rotate linked cluster credentials operation. + + Typically these are written to a http.Request. +*/ +type RotateLinkedClusterCredentialsParams struct { + + // 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 +} + +// WithDefaults hydrates default values in the rotate linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RotateLinkedClusterCredentialsParams) WithDefaults() *RotateLinkedClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the rotate linked cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RotateLinkedClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithTimeout(timeout time.Duration) *RotateLinkedClusterCredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithContext(ctx context.Context) *RotateLinkedClusterCredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithHTTPClient(client *http.Client) *RotateLinkedClusterCredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithClusterID(clusterID string) *RotateLinkedClusterCredentialsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithLocationOrganizationID(locationOrganizationID string) *RotateLinkedClusterCredentialsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) WithLocationProjectID(locationProjectID string) *RotateLinkedClusterCredentialsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the rotate linked cluster credentials params +func (o *RotateLinkedClusterCredentialsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *RotateLinkedClusterCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterId + if err := r.SetPathParam("clusterId", o.ClusterID); err != nil { + return err + } + + // path param location.organizationId + if err := r.SetPathParam("location.organizationId", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.projectId + if err := r.SetPathParam("location.projectId", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go new file mode 100644 index 00000000..2bfd2fae --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/rotate_linked_cluster_credentials_responses.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-link-service/stable/2022-11-07/models" +) + +// RotateLinkedClusterCredentialsReader is a Reader for the RotateLinkedClusterCredentials structure. +type RotateLinkedClusterCredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RotateLinkedClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRotateLinkedClusterCredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRotateLinkedClusterCredentialsDefault(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 + } +} + +// NewRotateLinkedClusterCredentialsOK creates a RotateLinkedClusterCredentialsOK with default headers values +func NewRotateLinkedClusterCredentialsOK() *RotateLinkedClusterCredentialsOK { + return &RotateLinkedClusterCredentialsOK{} +} + +/* +RotateLinkedClusterCredentialsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type RotateLinkedClusterCredentialsOK struct { + Payload *models.VaultLink20221107RotateLinkedClusterCredentialsResponse +} + +// IsSuccess returns true when this rotate linked cluster credentials o k response has a 2xx status code +func (o *RotateLinkedClusterCredentialsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this rotate linked cluster credentials o k response has a 3xx status code +func (o *RotateLinkedClusterCredentialsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this rotate linked cluster credentials o k response has a 4xx status code +func (o *RotateLinkedClusterCredentialsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this rotate linked cluster credentials o k response has a 5xx status code +func (o *RotateLinkedClusterCredentialsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this rotate linked cluster credentials o k response a status code equal to that given +func (o *RotateLinkedClusterCredentialsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RotateLinkedClusterCredentialsOK) Error() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] rotateLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsOK) String() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] rotateLinkedClusterCredentialsOK %+v", 200, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsOK) GetPayload() *models.VaultLink20221107RotateLinkedClusterCredentialsResponse { + return o.Payload +} + +func (o *RotateLinkedClusterCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VaultLink20221107RotateLinkedClusterCredentialsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRotateLinkedClusterCredentialsDefault creates a RotateLinkedClusterCredentialsDefault with default headers values +func NewRotateLinkedClusterCredentialsDefault(code int) *RotateLinkedClusterCredentialsDefault { + return &RotateLinkedClusterCredentialsDefault{ + _statusCode: code, + } +} + +/* +RotateLinkedClusterCredentialsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type RotateLinkedClusterCredentialsDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// Code gets the status code for the rotate linked cluster credentials default response +func (o *RotateLinkedClusterCredentialsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this rotate linked cluster credentials default response has a 2xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this rotate linked cluster credentials default response has a 3xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this rotate linked cluster credentials default response has a 4xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this rotate linked cluster credentials default response has a 5xx status code +func (o *RotateLinkedClusterCredentialsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this rotate linked cluster credentials default response a status code equal to that given +func (o *RotateLinkedClusterCredentialsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *RotateLinkedClusterCredentialsDefault) Error() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] RotateLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsDefault) String() string { + return fmt.Sprintf("[POST /vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}][%d] RotateLinkedClusterCredentials default %+v", o._statusCode, o.Payload) +} + +func (o *RotateLinkedClusterCredentialsDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *RotateLinkedClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // 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-link-service/stable/2022-11-07/client/vault_link_service/vault_link_service_client.go b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/vault_link_service_client.go new file mode 100644 index 00000000..7333e344 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/client/vault_link_service/vault_link_service_client.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package vault_link_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 link service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vault link service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetLinkedCluster(params *GetLinkedClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterOK, error) + + GetLinkedClusterPolicy(params *GetLinkedClusterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterPolicyOK, error) + + RevokeLinkedClusterCredentials(params *RevokeLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeLinkedClusterCredentialsOK, error) + + RotateLinkedClusterCredentials(params *RotateLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RotateLinkedClusterCredentialsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetLinkedCluster get linked cluster API +*/ +func (a *Client) GetLinkedCluster(params *GetLinkedClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLinkedClusterParams() + } + op := &runtime.ClientOperation{ + ID: "GetLinkedCluster", + Method: "GET", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/clusters/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLinkedClusterReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLinkedClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetLinkedClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetLinkedClusterPolicy get linked cluster policy API +*/ +func (a *Client) GetLinkedClusterPolicy(params *GetLinkedClusterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLinkedClusterPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLinkedClusterPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "GetLinkedClusterPolicy", + Method: "GET", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/link/policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLinkedClusterPolicyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetLinkedClusterPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetLinkedClusterPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +RevokeLinkedClusterCredentials revoke linked cluster credentials API +*/ +func (a *Client) RevokeLinkedClusterCredentials(params *RevokeLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeLinkedClusterCredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRevokeLinkedClusterCredentialsParams() + } + op := &runtime.ClientOperation{ + ID: "RevokeLinkedClusterCredentials", + Method: "DELETE", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/revoke-credentials/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RevokeLinkedClusterCredentialsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RevokeLinkedClusterCredentialsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RevokeLinkedClusterCredentialsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +RotateLinkedClusterCredentials rotate linked cluster credentials API +*/ +func (a *Client) RotateLinkedClusterCredentials(params *RotateLinkedClusterCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RotateLinkedClusterCredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRotateLinkedClusterCredentialsParams() + } + op := &runtime.ClientOperation{ + ID: "RotateLinkedClusterCredentials", + Method: "POST", + PathPattern: "/vault-link/2022-11-07/organizations/{location.organizationId}/projects/{location.projectId}/rotate-credentials/{clusterId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RotateLinkedClusterCredentialsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RotateLinkedClusterCredentialsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RotateLinkedClusterCredentialsDefault) + 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-link-service/stable/2022-11-07/models/cloudlocation_location.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/cloudlocation_location.go new file mode 100644 index 00000000..953fbaa6 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/cloudlocation_location.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CloudlocationLocation Location represents a target for an operation in HCP. +// +// swagger:model cloudlocationLocation +type CloudlocationLocation struct { + + // organization_id is the id of the organization. + OrganizationID string `json:"organization_id,omitempty"` + + // project_id is the projects id. + ProjectID string `json:"project_id,omitempty"` + + // region is the region that the resource is located in. It is + // optional if the object being referenced is a global object. + Region *LocationRegion `json:"region,omitempty"` +} + +// Validate validates this cloudlocation location +func (m *CloudlocationLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRegion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudlocationLocation) validateRegion(formats strfmt.Registry) error { + if swag.IsZero(m.Region) { // not required + return nil + } + + if m.Region != nil { + if err := m.Region.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("region") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("region") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloudlocation location based on the context it is used +func (m *CloudlocationLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRegion(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudlocationLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { + + if m.Region != nil { + if err := m.Region.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("region") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("region") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CloudlocationLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CloudlocationLocation) UnmarshalBinary(b []byte) error { + var res CloudlocationLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_leader_status.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_leader_status.go new file mode 100644 index 00000000..afefabb7 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_leader_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// LinkedClusterNodeLeaderStatus linked cluster node leader status +// +// swagger:model LinkedClusterNodeLeaderStatus +type LinkedClusterNodeLeaderStatus string + +func NewLinkedClusterNodeLeaderStatus(value LinkedClusterNodeLeaderStatus) *LinkedClusterNodeLeaderStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated LinkedClusterNodeLeaderStatus. +func (m LinkedClusterNodeLeaderStatus) Pointer() *LinkedClusterNodeLeaderStatus { + return &m +} + +const ( + + // LinkedClusterNodeLeaderStatusLEADERSTATUSCLUSTERSTATEINVALID captures enum value "LEADER_STATUS_CLUSTER_STATE_INVALID" + LinkedClusterNodeLeaderStatusLEADERSTATUSCLUSTERSTATEINVALID LinkedClusterNodeLeaderStatus = "LEADER_STATUS_CLUSTER_STATE_INVALID" + + // LinkedClusterNodeLeaderStatusLEADER captures enum value "LEADER" + LinkedClusterNodeLeaderStatusLEADER LinkedClusterNodeLeaderStatus = "LEADER" + + // LinkedClusterNodeLeaderStatusFOLLOWER captures enum value "FOLLOWER" + LinkedClusterNodeLeaderStatusFOLLOWER LinkedClusterNodeLeaderStatus = "FOLLOWER" +) + +// for schema +var linkedClusterNodeLeaderStatusEnum []interface{} + +func init() { + var res []LinkedClusterNodeLeaderStatus + if err := json.Unmarshal([]byte(`["LEADER_STATUS_CLUSTER_STATE_INVALID","LEADER","FOLLOWER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + linkedClusterNodeLeaderStatusEnum = append(linkedClusterNodeLeaderStatusEnum, v) + } +} + +func (m LinkedClusterNodeLeaderStatus) validateLinkedClusterNodeLeaderStatusEnum(path, location string, value LinkedClusterNodeLeaderStatus) error { + if err := validate.EnumCase(path, location, value, linkedClusterNodeLeaderStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this linked cluster node leader status +func (m LinkedClusterNodeLeaderStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateLinkedClusterNodeLeaderStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this linked cluster node leader status based on context it is used +func (m LinkedClusterNodeLeaderStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_log_level.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_log_level.go new file mode 100644 index 00000000..97ed87e4 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_log_level.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// LinkedClusterNodeLogLevel linked cluster node log level +// +// swagger:model LinkedClusterNodeLogLevel +type LinkedClusterNodeLogLevel string + +func NewLinkedClusterNodeLogLevel(value LinkedClusterNodeLogLevel) *LinkedClusterNodeLogLevel { + return &value +} + +// Pointer returns a pointer to a freshly-allocated LinkedClusterNodeLogLevel. +func (m LinkedClusterNodeLogLevel) Pointer() *LinkedClusterNodeLogLevel { + return &m +} + +const ( + + // LinkedClusterNodeLogLevelLOGLEVELCLUSTERSTATEINVALID captures enum value "LOG_LEVEL_CLUSTER_STATE_INVALID" + LinkedClusterNodeLogLevelLOGLEVELCLUSTERSTATEINVALID LinkedClusterNodeLogLevel = "LOG_LEVEL_CLUSTER_STATE_INVALID" + + // LinkedClusterNodeLogLevelTRACE captures enum value "TRACE" + LinkedClusterNodeLogLevelTRACE LinkedClusterNodeLogLevel = "TRACE" + + // LinkedClusterNodeLogLevelDEBUG captures enum value "DEBUG" + LinkedClusterNodeLogLevelDEBUG LinkedClusterNodeLogLevel = "DEBUG" + + // LinkedClusterNodeLogLevelINFO captures enum value "INFO" + LinkedClusterNodeLogLevelINFO LinkedClusterNodeLogLevel = "INFO" + + // LinkedClusterNodeLogLevelWARN captures enum value "WARN" + LinkedClusterNodeLogLevelWARN LinkedClusterNodeLogLevel = "WARN" + + // LinkedClusterNodeLogLevelERROR captures enum value "ERROR" + LinkedClusterNodeLogLevelERROR LinkedClusterNodeLogLevel = "ERROR" +) + +// for schema +var linkedClusterNodeLogLevelEnum []interface{} + +func init() { + var res []LinkedClusterNodeLogLevel + if err := json.Unmarshal([]byte(`["LOG_LEVEL_CLUSTER_STATE_INVALID","TRACE","DEBUG","INFO","WARN","ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + linkedClusterNodeLogLevelEnum = append(linkedClusterNodeLogLevelEnum, v) + } +} + +func (m LinkedClusterNodeLogLevel) validateLinkedClusterNodeLogLevelEnum(path, location string, value LinkedClusterNodeLogLevel) error { + if err := validate.EnumCase(path, location, value, linkedClusterNodeLogLevelEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this linked cluster node log level +func (m LinkedClusterNodeLogLevel) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateLinkedClusterNodeLogLevelEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this linked cluster node log level based on context it is used +func (m LinkedClusterNodeLogLevel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_version_status.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_version_status.go new file mode 100644 index 00000000..9eb8ab37 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/linked_cluster_node_version_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// LinkedClusterNodeVersionStatus - VERSION_UP_TO_DATE: VERSION_UP_TO_DATE is used when node is running the latest Vault Version. +// - UPGRADE_AVAILABLE: UPGRADE_AVAILABLE is used when node is running the latest minor release of a Vault Version, but there is a new major Vault version available for upgrade. +// - UPGRADE_RECOMMENDED: UPGRADE_RECOMMENDED is used when node is running an outdated but still supported version, but there is a new minor or major Vault versions available for upgrade. +// - UPGRADE_REQUIRED: UPGRADE_REQUIRED is used when node is running a no longer supported version and there are minor and major versions available for upgrade. +// +// swagger:model LinkedClusterNodeVersionStatus +type LinkedClusterNodeVersionStatus string + +func NewLinkedClusterNodeVersionStatus(value LinkedClusterNodeVersionStatus) *LinkedClusterNodeVersionStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated LinkedClusterNodeVersionStatus. +func (m LinkedClusterNodeVersionStatus) Pointer() *LinkedClusterNodeVersionStatus { + return &m +} + +const ( + + // LinkedClusterNodeVersionStatusLINKEDCLUSTERNODEVERSIONSTATUSINVALID captures enum value "LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID" + LinkedClusterNodeVersionStatusLINKEDCLUSTERNODEVERSIONSTATUSINVALID LinkedClusterNodeVersionStatus = "LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID" + + // LinkedClusterNodeVersionStatusVERSIONUPTODATE captures enum value "VERSION_UP_TO_DATE" + LinkedClusterNodeVersionStatusVERSIONUPTODATE LinkedClusterNodeVersionStatus = "VERSION_UP_TO_DATE" + + // LinkedClusterNodeVersionStatusUPGRADEAVAILABLE captures enum value "UPGRADE_AVAILABLE" + LinkedClusterNodeVersionStatusUPGRADEAVAILABLE LinkedClusterNodeVersionStatus = "UPGRADE_AVAILABLE" + + // LinkedClusterNodeVersionStatusUPGRADERECOMMENDED captures enum value "UPGRADE_RECOMMENDED" + LinkedClusterNodeVersionStatusUPGRADERECOMMENDED LinkedClusterNodeVersionStatus = "UPGRADE_RECOMMENDED" + + // LinkedClusterNodeVersionStatusUPGRADEREQUIRED captures enum value "UPGRADE_REQUIRED" + LinkedClusterNodeVersionStatusUPGRADEREQUIRED LinkedClusterNodeVersionStatus = "UPGRADE_REQUIRED" +) + +// for schema +var linkedClusterNodeVersionStatusEnum []interface{} + +func init() { + var res []LinkedClusterNodeVersionStatus + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_NODE_VERSION_STATUS_INVALID","VERSION_UP_TO_DATE","UPGRADE_AVAILABLE","UPGRADE_RECOMMENDED","UPGRADE_REQUIRED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + linkedClusterNodeVersionStatusEnum = append(linkedClusterNodeVersionStatusEnum, v) + } +} + +func (m LinkedClusterNodeVersionStatus) validateLinkedClusterNodeVersionStatusEnum(path, location string, value LinkedClusterNodeVersionStatus) error { + if err := validate.EnumCase(path, location, value, linkedClusterNodeVersionStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this linked cluster node version status +func (m LinkedClusterNodeVersionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateLinkedClusterNodeVersionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this linked cluster node version status based on context it is used +func (m LinkedClusterNodeVersionStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/location_region.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/location_region.go new file mode 100644 index 00000000..ba5c4569 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/location_region.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LocationRegion Region identifies a Cloud data-plane region. +// +// swagger:model locationRegion +type LocationRegion struct { + + // provider is the named cloud provider ("aws", "gcp", "azure") + Provider string `json:"provider,omitempty"` + + // region is the cloud region ("us-west1", "us-east1") + Region string `json:"region,omitempty"` +} + +// Validate validates this location region +func (m *LocationRegion) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this location region based on context it is used +func (m *LocationRegion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LocationRegion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LocationRegion) UnmarshalBinary(b []byte) error { + var res LocationRegion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/protobuf_any.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/protobuf_any.go new file mode 100644 index 00000000..de6efe80 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/protobuf_any.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// # JSON +// +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +// swagger:model protobufAny +type ProtobufAny struct { + + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + AtType string `json:"@type,omitempty"` +} + +// Validate validates this protobuf any +func (m *ProtobufAny) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protobuf any based on context it is used +func (m *ProtobufAny) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtobufAny) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtobufAny) UnmarshalBinary(b []byte) error { + var res ProtobufAny + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/rpc_status.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/rpc_status.go new file mode 100644 index 00000000..30c9b063 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/rpc_status.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RPCStatus The `Status` type defines a logical error model that is suitable for +// different programming environments, including REST APIs and RPC APIs. It is +// used by [gRPC](https://github.com/grpc). Each `Status` message contains +// three pieces of data: error code, error message, and error details. +// +// You can find out more about this error model and how to work with it in the +// [API Design Guide](https://cloud.google.com/apis/design/errors). +// +// swagger:model rpcStatus +type RPCStatus struct { + + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + Code int32 `json:"code,omitempty"` + + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + Details []*ProtobufAny `json:"details"` + + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message string `json:"message,omitempty"` +} + +// Validate validates this rpc status +func (m *RPCStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RPCStatus) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(m.Details) { // not required + return nil + } + + for i := 0; i < len(m.Details); i++ { + if swag.IsZero(m.Details[i]) { // not required + continue + } + + if m.Details[i] != nil { + if err := m.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this rpc status based on the context it is used +func (m *RPCStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RPCStatus) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Details); i++ { + + if m.Details[i] != nil { + if err := m.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RPCStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RPCStatus) UnmarshalBinary(b []byte) error { + var res RPCStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_policy_response.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_policy_response.go new file mode 100644 index 00000000..f69e10bf --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_policy_response.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 ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VaultLink20221107GetLinkedClusterPolicyResponse vault link 20221107 get linked cluster policy response +// +// swagger:model vault_link_20221107GetLinkedClusterPolicyResponse +type VaultLink20221107GetLinkedClusterPolicyResponse struct { + + // policy refers to the HCL formatted policy + Policy string `json:"policy,omitempty"` +} + +// Validate validates this vault link 20221107 get linked cluster policy response +func (m *VaultLink20221107GetLinkedClusterPolicyResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this vault link 20221107 get linked cluster policy response based on context it is used +func (m *VaultLink20221107GetLinkedClusterPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107GetLinkedClusterPolicyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107GetLinkedClusterPolicyResponse) UnmarshalBinary(b []byte) error { + var res VaultLink20221107GetLinkedClusterPolicyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_response.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_response.go new file mode 100644 index 00000000..54163c30 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_get_linked_cluster_response.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VaultLink20221107GetLinkedClusterResponse vault link 20221107 get linked cluster response +// +// swagger:model vault_link_20221107GetLinkedClusterResponse +type VaultLink20221107GetLinkedClusterResponse struct { + + // cluster + Cluster *VaultLink20221107LinkedCluster `json:"cluster,omitempty"` +} + +// Validate validates this vault link 20221107 get linked cluster response +func (m *VaultLink20221107GetLinkedClusterResponse) 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 *VaultLink20221107GetLinkedClusterResponse) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vault link 20221107 get linked cluster response based on the context it is used +func (m *VaultLink20221107GetLinkedClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VaultLink20221107GetLinkedClusterResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107GetLinkedClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107GetLinkedClusterResponse) UnmarshalBinary(b []byte) error { + var res VaultLink20221107GetLinkedClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster.go new file mode 100644 index 00000000..ff0f35ec --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster.go @@ -0,0 +1,300 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VaultLink20221107LinkedCluster vault link 20221107 linked cluster +// +// swagger:model vault_link_20221107LinkedCluster +type VaultLink20221107LinkedCluster struct { + + // autopilot enabled + AutopilotEnabled bool `json:"autopilotEnabled,omitempty"` + + // This is the self-managed cluster name and it differs from the HCP's internal id and HCP's slug id because + // it is configured directly in the self-managed cluster. + ClusterName string `json:"clusterName,omitempty"` + + // current version + CurrentVersion string `json:"currentVersion,omitempty"` + + // ha enabled + HaEnabled bool `json:"haEnabled,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // internal Id + InternalID string `json:"internalId,omitempty"` + + // is sealed + IsSealed bool `json:"isSealed,omitempty"` + + // linked at + // Format: date-time + LinkedAt strfmt.DateTime `json:"linkedAt,omitempty"` + + // location + Location *CloudlocationLocation `json:"location,omitempty"` + + // node statuses + NodeStatuses []*VaultLink20221107LinkedClusterNode `json:"nodeStatuses"` + + // raft quorum status + RaftQuorumStatus *VaultLink20221107RaftQuorumStatus `json:"raftQuorumStatus,omitempty"` + + // state + State *VaultLink20221107LinkedClusterState `json:"state,omitempty"` + + // storage type + StorageType string `json:"storageType,omitempty"` +} + +// Validate validates this vault link 20221107 linked cluster +func (m *VaultLink20221107LinkedCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLinkedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeStatuses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRaftQuorumStatus(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 *VaultLink20221107LinkedCluster) validateLinkedAt(formats strfmt.Registry) error { + if swag.IsZero(m.LinkedAt) { // not required + return nil + } + + if err := validate.FormatOf("linkedAt", "body", "date-time", m.LinkedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) validateNodeStatuses(formats strfmt.Registry) error { + if swag.IsZero(m.NodeStatuses) { // not required + return nil + } + + for i := 0; i < len(m.NodeStatuses); i++ { + if swag.IsZero(m.NodeStatuses[i]) { // not required + continue + } + + if m.NodeStatuses[i] != nil { + if err := m.NodeStatuses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) validateRaftQuorumStatus(formats strfmt.Registry) error { + if swag.IsZero(m.RaftQuorumStatus) { // not required + return nil + } + + if m.RaftQuorumStatus != nil { + if err := m.RaftQuorumStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("raftQuorumStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("raftQuorumStatus") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("state") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vault link 20221107 linked cluster based on the context it is used +func (m *VaultLink20221107LinkedCluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNodeStatuses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRaftQuorumStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateState(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VaultLink20221107LinkedCluster) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.Location != nil { + if err := m.Location.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) contextValidateNodeStatuses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NodeStatuses); i++ { + + if m.NodeStatuses[i] != nil { + if err := m.NodeStatuses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeStatuses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) contextValidateRaftQuorumStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.RaftQuorumStatus != nil { + if err := m.RaftQuorumStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("raftQuorumStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("raftQuorumStatus") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedCluster) contextValidateState(ctx context.Context, formats strfmt.Registry) error { + + if m.State != nil { + if err := m.State.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107LinkedCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107LinkedCluster) UnmarshalBinary(b []byte) error { + var res VaultLink20221107LinkedCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node.go new file mode 100644 index 00000000..a44f1032 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VaultLink20221107LinkedClusterNode vault link 20221107 linked cluster node +// +// swagger:model vault_link_20221107LinkedClusterNode +type VaultLink20221107LinkedClusterNode struct { + + // alternative_versions is a list of versions that should also be considered for + // an update as they might come with additional improvements and features. + AlternativeVersions []string `json:"alternativeVersions"` + + // current report + // Format: date-time + CurrentReport strfmt.DateTime `json:"currentReport,omitempty"` + + // current_version is the node's current version in semantic version format. + CurrentVersion string `json:"currentVersion,omitempty"` + + // has_security_flaw will be true if the current version has a security flaw. + HasSecurityFlaws bool `json:"hasSecurityFlaws,omitempty"` + + // hostname + Hostname string `json:"hostname,omitempty"` + + // internal Id + InternalID string `json:"internalId,omitempty"` + + // last reported at + // Format: date-time + LastReportedAt strfmt.DateTime `json:"lastReportedAt,omitempty"` + + // leader status + LeaderStatus *LinkedClusterNodeLeaderStatus `json:"leaderStatus,omitempty"` + + // linked cluster internal Id + LinkedClusterInternalID string `json:"linkedClusterInternalId,omitempty"` + + // listener addresses + ListenerAddresses []string `json:"listenerAddresses"` + + // log level + LogLevel *LinkedClusterNodeLogLevel `json:"logLevel,omitempty"` + + // node_binary_architecture is the lower-case architecture of the client binary + // (e.g. amd64, arm, ...). + NodeBinaryArchitecture string `json:"nodeBinaryArchitecture,omitempty"` + + // node_id is the node identification. + NodeID string `json:"nodeId,omitempty"` + + // node_initialized indicates if the node has been initialized. + NodeInitialized bool `json:"nodeInitialized,omitempty"` + + // node_os is the lower-case name of the operating system the client is + // running on (e.g. linux, windows). + NodeOs string `json:"nodeOs,omitempty"` + + // node_sealed indicates if the node is sealed. + NodeSealed bool `json:"nodeSealed,omitempty"` + + // node state + NodeState *VaultLink20221107LinkedClusterNodeState `json:"nodeState,omitempty"` + + // node_type indicates the node type. + NodeType string `json:"nodeType,omitempty"` + + // recommended_version is the version the product should ideally be updated to. + RecommendedVersion string `json:"recommendedVersion,omitempty"` + + // status is the status of the current version. The status may help to + // determine the urgency of the update. + Status *LinkedClusterNodeVersionStatus `json:"status,omitempty"` + + // status_version is the version of the status message format. To ensure + // that the version is not omitted by accident the initial version is 1. + StatusVersion int64 `json:"statusVersion,omitempty"` + + // storage type + StorageType string `json:"storageType,omitempty"` +} + +// Validate validates this vault link 20221107 linked cluster node +func (m *VaultLink20221107LinkedClusterNode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentReport(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastReportedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLeaderStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLogLevel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateCurrentReport(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentReport) { // not required + return nil + } + + if err := validate.FormatOf("currentReport", "body", "date-time", m.CurrentReport.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateLastReportedAt(formats strfmt.Registry) error { + if swag.IsZero(m.LastReportedAt) { // not required + return nil + } + + if err := validate.FormatOf("lastReportedAt", "body", "date-time", m.LastReportedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateLeaderStatus(formats strfmt.Registry) error { + if swag.IsZero(m.LeaderStatus) { // not required + return nil + } + + if m.LeaderStatus != nil { + if err := m.LeaderStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leaderStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leaderStatus") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateLogLevel(formats strfmt.Registry) error { + if swag.IsZero(m.LogLevel) { // not required + return nil + } + + if m.LogLevel != nil { + if err := m.LogLevel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logLevel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logLevel") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateNodeState(formats strfmt.Registry) error { + if swag.IsZero(m.NodeState) { // not required + return nil + } + + if m.NodeState != nil { + if err := m.NodeState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeState") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vault link 20221107 linked cluster node based on the context it is used +func (m *VaultLink20221107LinkedClusterNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLeaderStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLogLevel(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNodeState(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) contextValidateLeaderStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.LeaderStatus != nil { + if err := m.LeaderStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leaderStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leaderStatus") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) contextValidateLogLevel(ctx context.Context, formats strfmt.Registry) error { + + if m.LogLevel != nil { + if err := m.LogLevel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logLevel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logLevel") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) contextValidateNodeState(ctx context.Context, formats strfmt.Registry) error { + + if m.NodeState != nil { + if err := m.NodeState.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nodeState") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("nodeState") + } + return err + } + } + + return nil +} + +func (m *VaultLink20221107LinkedClusterNode) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107LinkedClusterNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107LinkedClusterNode) UnmarshalBinary(b []byte) error { + var res VaultLink20221107LinkedClusterNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node_state.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node_state.go new file mode 100644 index 00000000..4243e879 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_node_state.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// VaultLink20221107LinkedClusterNodeState vault link 20221107 linked cluster node state +// +// swagger:model vault_link_20221107LinkedClusterNodeState +type VaultLink20221107LinkedClusterNodeState string + +func NewVaultLink20221107LinkedClusterNodeState(value VaultLink20221107LinkedClusterNodeState) *VaultLink20221107LinkedClusterNodeState { + return &value +} + +// Pointer returns a pointer to a freshly-allocated VaultLink20221107LinkedClusterNodeState. +func (m VaultLink20221107LinkedClusterNodeState) Pointer() *VaultLink20221107LinkedClusterNodeState { + return &m +} + +const ( + + // VaultLink20221107LinkedClusterNodeStateLINKEDCLUSTERSTATEINVALID captures enum value "LINKED_CLUSTER_STATE_INVALID" + VaultLink20221107LinkedClusterNodeStateLINKEDCLUSTERSTATEINVALID VaultLink20221107LinkedClusterNodeState = "LINKED_CLUSTER_STATE_INVALID" + + // VaultLink20221107LinkedClusterNodeStateLINKING captures enum value "LINKING" + VaultLink20221107LinkedClusterNodeStateLINKING VaultLink20221107LinkedClusterNodeState = "LINKING" + + // VaultLink20221107LinkedClusterNodeStateLINKED captures enum value "LINKED" + VaultLink20221107LinkedClusterNodeStateLINKED VaultLink20221107LinkedClusterNodeState = "LINKED" + + // VaultLink20221107LinkedClusterNodeStateUNLINKING captures enum value "UNLINKING" + VaultLink20221107LinkedClusterNodeStateUNLINKING VaultLink20221107LinkedClusterNodeState = "UNLINKING" + + // VaultLink20221107LinkedClusterNodeStateUNLINKED captures enum value "UNLINKED" + VaultLink20221107LinkedClusterNodeStateUNLINKED VaultLink20221107LinkedClusterNodeState = "UNLINKED" +) + +// for schema +var vaultLink20221107LinkedClusterNodeStateEnum []interface{} + +func init() { + var res []VaultLink20221107LinkedClusterNodeState + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_STATE_INVALID","LINKING","LINKED","UNLINKING","UNLINKED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + vaultLink20221107LinkedClusterNodeStateEnum = append(vaultLink20221107LinkedClusterNodeStateEnum, v) + } +} + +func (m VaultLink20221107LinkedClusterNodeState) validateVaultLink20221107LinkedClusterNodeStateEnum(path, location string, value VaultLink20221107LinkedClusterNodeState) error { + if err := validate.EnumCase(path, location, value, vaultLink20221107LinkedClusterNodeStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this vault link 20221107 linked cluster node state +func (m VaultLink20221107LinkedClusterNodeState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateVaultLink20221107LinkedClusterNodeStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this vault link 20221107 linked cluster node state based on context it is used +func (m VaultLink20221107LinkedClusterNodeState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_state.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_state.go new file mode 100644 index 00000000..1e83bbcb --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_linked_cluster_state.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// VaultLink20221107LinkedClusterState vault link 20221107 linked cluster state +// +// swagger:model vault_link_20221107LinkedClusterState +type VaultLink20221107LinkedClusterState string + +func NewVaultLink20221107LinkedClusterState(value VaultLink20221107LinkedClusterState) *VaultLink20221107LinkedClusterState { + return &value +} + +// Pointer returns a pointer to a freshly-allocated VaultLink20221107LinkedClusterState. +func (m VaultLink20221107LinkedClusterState) Pointer() *VaultLink20221107LinkedClusterState { + return &m +} + +const ( + + // VaultLink20221107LinkedClusterStateLINKEDCLUSTERSTATEINVALID captures enum value "LINKED_CLUSTER_STATE_INVALID" + VaultLink20221107LinkedClusterStateLINKEDCLUSTERSTATEINVALID VaultLink20221107LinkedClusterState = "LINKED_CLUSTER_STATE_INVALID" + + // VaultLink20221107LinkedClusterStateLINKING captures enum value "LINKING" + VaultLink20221107LinkedClusterStateLINKING VaultLink20221107LinkedClusterState = "LINKING" + + // VaultLink20221107LinkedClusterStateLINKED captures enum value "LINKED" + VaultLink20221107LinkedClusterStateLINKED VaultLink20221107LinkedClusterState = "LINKED" + + // VaultLink20221107LinkedClusterStateSEALED captures enum value "SEALED" + VaultLink20221107LinkedClusterStateSEALED VaultLink20221107LinkedClusterState = "SEALED" + + // VaultLink20221107LinkedClusterStateUNLINKING captures enum value "UNLINKING" + VaultLink20221107LinkedClusterStateUNLINKING VaultLink20221107LinkedClusterState = "UNLINKING" + + // VaultLink20221107LinkedClusterStateUNLINKED captures enum value "UNLINKED" + VaultLink20221107LinkedClusterStateUNLINKED VaultLink20221107LinkedClusterState = "UNLINKED" +) + +// for schema +var vaultLink20221107LinkedClusterStateEnum []interface{} + +func init() { + var res []VaultLink20221107LinkedClusterState + if err := json.Unmarshal([]byte(`["LINKED_CLUSTER_STATE_INVALID","LINKING","LINKED","SEALED","UNLINKING","UNLINKED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + vaultLink20221107LinkedClusterStateEnum = append(vaultLink20221107LinkedClusterStateEnum, v) + } +} + +func (m VaultLink20221107LinkedClusterState) validateVaultLink20221107LinkedClusterStateEnum(path, location string, value VaultLink20221107LinkedClusterState) error { + if err := validate.EnumCase(path, location, value, vaultLink20221107LinkedClusterStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this vault link 20221107 linked cluster state +func (m VaultLink20221107LinkedClusterState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateVaultLink20221107LinkedClusterStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this vault link 20221107 linked cluster state based on context it is used +func (m VaultLink20221107LinkedClusterState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_raft_quorum_status.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_raft_quorum_status.go new file mode 100644 index 00000000..5e69d69f --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_raft_quorum_status.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VaultLink20221107RaftQuorumStatus vault link 20221107 raft quorum status +// +// swagger:model vault_link_20221107RaftQuorumStatus +type VaultLink20221107RaftQuorumStatus struct { + + // is healthy + IsHealthy bool `json:"isHealthy,omitempty"` + + // quorum number + QuorumNumber int32 `json:"quorumNumber,omitempty"` + + // warning + Warning string `json:"warning,omitempty"` +} + +// Validate validates this vault link 20221107 raft quorum status +func (m *VaultLink20221107RaftQuorumStatus) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this vault link 20221107 raft quorum status based on context it is used +func (m *VaultLink20221107RaftQuorumStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107RaftQuorumStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107RaftQuorumStatus) UnmarshalBinary(b []byte) error { + var res VaultLink20221107RaftQuorumStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_revoke_linked_cluster_credentials_response.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_revoke_linked_cluster_credentials_response.go new file mode 100644 index 00000000..ae0aab88 --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_revoke_linked_cluster_credentials_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 + +// VaultLink20221107RevokeLinkedClusterCredentialsResponse vault link 20221107 revoke linked cluster credentials response +// +// swagger:model vault_link_20221107RevokeLinkedClusterCredentialsResponse +type VaultLink20221107RevokeLinkedClusterCredentialsResponse interface{} diff --git a/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_rotate_linked_cluster_credentials_response.go b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_rotate_linked_cluster_credentials_response.go new file mode 100644 index 00000000..cd32715b --- /dev/null +++ b/clients/cloud-vault-link-service/stable/2022-11-07/models/vault_link20221107_rotate_linked_cluster_credentials_response.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 ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VaultLink20221107RotateLinkedClusterCredentialsResponse vault link 20221107 rotate linked cluster credentials response +// +// swagger:model vault_link_20221107RotateLinkedClusterCredentialsResponse +type VaultLink20221107RotateLinkedClusterCredentialsResponse struct { + + // client Id + ClientID string `json:"clientId,omitempty"` + + // client secret + ClientSecret string `json:"clientSecret,omitempty"` + + // cluster + Cluster *VaultLink20221107LinkedCluster `json:"cluster,omitempty"` + + // resource Id + ResourceID string `json:"resourceId,omitempty"` +} + +// Validate validates this vault link 20221107 rotate linked cluster credentials response +func (m *VaultLink20221107RotateLinkedClusterCredentialsResponse) 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 *VaultLink20221107RotateLinkedClusterCredentialsResponse) 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") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vault link 20221107 rotate linked cluster credentials response based on the context it is used +func (m *VaultLink20221107RotateLinkedClusterCredentialsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VaultLink20221107RotateLinkedClusterCredentialsResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VaultLink20221107RotateLinkedClusterCredentialsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VaultLink20221107RotateLinkedClusterCredentialsResponse) UnmarshalBinary(b []byte) error { + var res VaultLink20221107RotateLinkedClusterCredentialsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}