diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/cloud_packer_service_client.go b/clients/cloud-packer-service/preview/2022-04-11/client/cloud_packer_service_client.go new file mode 100644 index 00000000..04e5045c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/cloud_packer_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-packer-service/preview/2022-04-11/client/packer_service" +) + +// Default cloud packer 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 packer service HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudPackerService { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud packer service HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudPackerService { + // 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 packer service client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudPackerService { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudPackerService) + cli.Transport = transport + cli.PackerService = packer_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 +} + +// CloudPackerService is a client for cloud packer service +type CloudPackerService struct { + PackerService packer_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudPackerService) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.PackerService.SetTransport(transport) +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_client.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_client.go new file mode 100644 index 00000000..40f512a1 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_client.go @@ -0,0 +1,1042 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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 packer service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for packer service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + PackerServiceCreateBucket(params *PackerServiceCreateBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateBucketOK, error) + + PackerServiceCreateBuild(params *PackerServiceCreateBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateBuildOK, error) + + PackerServiceCreateChannel(params *PackerServiceCreateChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateChannelOK, error) + + PackerServiceCreateIteration(params *PackerServiceCreateIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateIterationOK, error) + + PackerServiceCreateRegistry(params *PackerServiceCreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateRegistryOK, error) + + PackerServiceDeleteBucket(params *PackerServiceDeleteBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteBucketOK, error) + + PackerServiceDeleteBuild(params *PackerServiceDeleteBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteBuildOK, error) + + PackerServiceDeleteChannel(params *PackerServiceDeleteChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteChannelOK, error) + + PackerServiceDeleteIteration(params *PackerServiceDeleteIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteIterationOK, error) + + PackerServiceDeleteRegistry(params *PackerServiceDeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteRegistryOK, error) + + PackerServiceGetBucket(params *PackerServiceGetBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetBucketOK, error) + + PackerServiceGetBuild(params *PackerServiceGetBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetBuildOK, error) + + PackerServiceGetChannel(params *PackerServiceGetChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetChannelOK, error) + + PackerServiceGetIteration(params *PackerServiceGetIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetIterationOK, error) + + PackerServiceGetRegistry(params *PackerServiceGetRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetRegistryOK, error) + + PackerServiceGetRegistryTFCRunTaskAPI(params *PackerServiceGetRegistryTFCRunTaskAPIParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetRegistryTFCRunTaskAPIOK, error) + + PackerServiceListBucketAncestry(params *PackerServiceListBucketAncestryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBucketAncestryOK, error) + + PackerServiceListBuckets(params *PackerServiceListBucketsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBucketsOK, error) + + PackerServiceListBuilds(params *PackerServiceListBuildsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBuildsOK, error) + + PackerServiceListChannels(params *PackerServiceListChannelsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListChannelsOK, error) + + PackerServiceListIterations(params *PackerServiceListIterationsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListIterationsOK, error) + + PackerServiceRegenerateTFCRunTaskHmacKey(params *PackerServiceRegenerateTFCRunTaskHmacKeyParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceRegenerateTFCRunTaskHmacKeyOK, error) + + PackerServiceTFCImageValidationRunTask(params *PackerServiceTFCImageValidationRunTaskParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceTFCImageValidationRunTaskOK, error) + + PackerServiceUpdateBucket(params *PackerServiceUpdateBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateBucketOK, error) + + PackerServiceUpdateBuild(params *PackerServiceUpdateBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateBuildOK, error) + + PackerServiceUpdateChannel(params *PackerServiceUpdateChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateChannelOK, error) + + PackerServiceUpdateIteration(params *PackerServiceUpdateIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateIterationOK, error) + + PackerServiceUpdateRegistry(params *PackerServiceUpdateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateRegistryOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PackerServiceCreateBucket creates an image bucket in the h c p packer registry +*/ +func (a *Client) PackerServiceCreateBucket(params *PackerServiceCreateBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateBucketOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceCreateBucketParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_CreateBucket", + Method: "PUT", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceCreateBucketReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceCreateBucketOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceCreateBucketDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceCreateBuild creates an image build in the provided image iteration it is called once for each build source in a packer build run the request will error if the build for a given cloud provider already exists +*/ +func (a *Client) PackerServiceCreateBuild(params *PackerServiceCreateBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateBuildOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceCreateBuildParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_CreateBuild", + Method: "POST", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceCreateBuildReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceCreateBuildOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceCreateBuildDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceCreateChannel creates a channel either empty or assigned to an iteration +*/ +func (a *Client) PackerServiceCreateChannel(params *PackerServiceCreateChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateChannelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceCreateChannelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_CreateChannel", + Method: "POST", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceCreateChannelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceCreateChannelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceCreateChannelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceCreateIteration creates an empty iteration to be written to this API is called at the beginning of a new packer build and does not create individual builds for the iteration +*/ +func (a *Client) PackerServiceCreateIteration(params *PackerServiceCreateIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateIterationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceCreateIterationParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_CreateIteration", + Method: "POST", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceCreateIterationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceCreateIterationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceCreateIterationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceCreateRegistry creates a h c p packer registry and starts billing for it +*/ +func (a *Client) PackerServiceCreateRegistry(params *PackerServiceCreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceCreateRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceCreateRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_CreateRegistry", + Method: "PUT", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceCreateRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceCreateRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceCreateRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceDeleteBucket deletes a bucket and all its information such as iterations and builds +*/ +func (a *Client) PackerServiceDeleteBucket(params *PackerServiceDeleteBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteBucketOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceDeleteBucketParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_DeleteBucket", + Method: "DELETE", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceDeleteBucketReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceDeleteBucketOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceDeleteBucketDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceDeleteBuild deletes a build in the provided iteration +*/ +func (a *Client) PackerServiceDeleteBuild(params *PackerServiceDeleteBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteBuildOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceDeleteBuildParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_DeleteBuild", + Method: "DELETE", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceDeleteBuildReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceDeleteBuildOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceDeleteBuildDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceDeleteChannel deletes a channel +*/ +func (a *Client) PackerServiceDeleteChannel(params *PackerServiceDeleteChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteChannelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceDeleteChannelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_DeleteChannel", + Method: "DELETE", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceDeleteChannelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceDeleteChannelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceDeleteChannelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceDeleteIteration deletes an iteration and all its information such as its builds +*/ +func (a *Client) PackerServiceDeleteIteration(params *PackerServiceDeleteIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteIterationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceDeleteIterationParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_DeleteIteration", + Method: "DELETE", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceDeleteIterationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceDeleteIterationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceDeleteIterationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceDeleteRegistry deactivates an active h c p packer registry deactivating a registry will stop any additional billing for the resource setting the hard delete param to true will delete the registry and any associated resources from the database +*/ +func (a *Client) PackerServiceDeleteRegistry(params *PackerServiceDeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceDeleteRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceDeleteRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_DeleteRegistry", + Method: "DELETE", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceDeleteRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceDeleteRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceDeleteRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetBucket gets a bucket with its latest completed iteration +*/ +func (a *Client) PackerServiceGetBucket(params *PackerServiceGetBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetBucketOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetBucketParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetBucket", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetBucketReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetBucketOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetBucketDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetBuild gets a build with its list of images +*/ +func (a *Client) PackerServiceGetBuild(params *PackerServiceGetBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetBuildOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetBuildParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetBuild", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetBuildReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetBuildOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetBuildDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetChannel gets a channel with the iteration that it is currently assigned if any +*/ +func (a *Client) PackerServiceGetChannel(params *PackerServiceGetChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetChannelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetChannelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetChannel", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetChannelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetChannelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetChannelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetIteration allows the user to get an iteration using one of the following identifiers iteration id incremental version fingerprint these are supplied as a query parameter e g images bucket slug iteration fingerprint fingerprint +*/ +func (a *Client) PackerServiceGetIteration(params *PackerServiceGetIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetIterationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetIterationParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetIteration", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iteration", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetIterationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetIterationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetIterationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetRegistry gets a h c p packer registry +*/ +func (a *Client) PackerServiceGetRegistry(params *PackerServiceGetRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetRegistry", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceGetRegistryTFCRunTaskAPI gets the h c p packer registry API URL and h m a c key to integrate with terraform cloud as a run task +*/ +func (a *Client) PackerServiceGetRegistryTFCRunTaskAPI(params *PackerServiceGetRegistryTFCRunTaskAPIParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceGetRegistryTFCRunTaskAPIOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceGetRegistryTFCRunTaskAPIParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_GetRegistryTFCRunTaskAPI", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/{task_type}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceGetRegistryTFCRunTaskAPIReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceGetRegistryTFCRunTaskAPIOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceGetRegistryTFCRunTaskAPIDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceListBucketAncestry packer service list bucket ancestry API +*/ +func (a *Client) PackerServiceListBucketAncestry(params *PackerServiceListBucketAncestryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBucketAncestryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceListBucketAncestryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_ListBucketAncestry", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/ancestry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceListBucketAncestryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceListBucketAncestryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceListBucketAncestryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceListBuckets lists every existing bucket in the h c p packer registry and their last completed iteration +*/ +func (a *Client) PackerServiceListBuckets(params *PackerServiceListBucketsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBucketsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceListBucketsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_ListBuckets", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceListBucketsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceListBucketsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceListBucketsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceListBuilds lists every existing build and its images for an iteration +*/ +func (a *Client) PackerServiceListBuilds(params *PackerServiceListBuildsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListBuildsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceListBuildsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_ListBuilds", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}/builds", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceListBuildsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceListBuildsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceListBuildsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceListChannels lists all channels of a given bucket +*/ +func (a *Client) PackerServiceListChannels(params *PackerServiceListChannelsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListChannelsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceListChannelsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_ListChannels", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceListChannelsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceListChannelsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceListChannelsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceListIterations lists every existing iteration of a bucket +*/ +func (a *Client) PackerServiceListIterations(params *PackerServiceListIterationsParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceListIterationsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceListIterationsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_ListIterations", + Method: "GET", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceListIterationsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceListIterationsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceListIterationsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceRegenerateTFCRunTaskHmacKey regenerates the h m a c key used to sign requests from terraform cloud to h c p packer run tasks +*/ +func (a *Client) PackerServiceRegenerateTFCRunTaskHmacKey(params *PackerServiceRegenerateTFCRunTaskHmacKeyParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceRegenerateTFCRunTaskHmacKeyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceRegenerateTFCRunTaskHmacKeyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_RegenerateTFCRunTaskHmacKey", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/hmac", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceRegenerateTFCRunTaskHmacKeyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceRegenerateTFCRunTaskHmacKeyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceRegenerateTFCRunTaskHmacKeyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceTFCImageValidationRunTask terraforms cloud run task hook for validating an h c p packer artifact used in the terraform plan to block a terraform apply for artifacts that are in an invalid state such as revoked iterations +*/ +func (a *Client) PackerServiceTFCImageValidationRunTask(params *PackerServiceTFCImageValidationRunTaskParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceTFCImageValidationRunTaskOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceTFCImageValidationRunTaskParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_TFCImageValidationRunTask", + Method: "POST", + PathPattern: "/packer/2022-04-11/terraform-cloud/validation/{api_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceTFCImageValidationRunTaskReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceTFCImageValidationRunTaskOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceTFCImageValidationRunTaskDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceUpdateBucket updates a bucket s information +*/ +func (a *Client) PackerServiceUpdateBucket(params *PackerServiceUpdateBucketParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateBucketOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceUpdateBucketParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_UpdateBucket", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceUpdateBucketReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceUpdateBucketOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceUpdateBucketDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceUpdateBuild updates an image build this may be most often used for modifying the status of a currently running build +*/ +func (a *Client) PackerServiceUpdateBuild(params *PackerServiceUpdateBuildParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateBuildOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceUpdateBuildParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_UpdateBuild", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceUpdateBuildReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceUpdateBuildOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceUpdateBuildDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceUpdateChannel updates a channel to clear or point to a new iteration +*/ +func (a *Client) PackerServiceUpdateChannel(params *PackerServiceUpdateChannelParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateChannelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceUpdateChannelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_UpdateChannel", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceUpdateChannelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceUpdateChannelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceUpdateChannelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceUpdateIteration this API can be used to revoke restore or complete an iteration revoking can be done at any time to complete or incomplete iterations immediately or in the future depending on the passing timestamp when an iteration is revoked all its descendants will automatically get revoked unless skip descendants revocation is set descendants will get revoked asynchronously to the request revoked iterations cannot be updated unless restored to make build specific updates for builds within the iteration use the update build endpoint +*/ +func (a *Client) PackerServiceUpdateIteration(params *PackerServiceUpdateIterationParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateIterationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceUpdateIterationParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_UpdateIteration", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceUpdateIterationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceUpdateIterationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceUpdateIterationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + PackerServiceUpdateRegistry updates the feature tier of an h c p packer registry +*/ +func (a *Client) PackerServiceUpdateRegistry(params *PackerServiceUpdateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PackerServiceUpdateRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPackerServiceUpdateRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PackerService_UpdateRegistry", + Method: "PATCH", + PathPattern: "/packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PackerServiceUpdateRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PackerServiceUpdateRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PackerServiceUpdateRegistryDefault) + 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-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_parameters.go new file mode 100644 index 00000000..c676ba91 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceCreateBucketParams creates a new PackerServiceCreateBucketParams object +// with the default values initialized. +func NewPackerServiceCreateBucketParams() *PackerServiceCreateBucketParams { + var () + return &PackerServiceCreateBucketParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceCreateBucketParamsWithTimeout creates a new PackerServiceCreateBucketParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceCreateBucketParamsWithTimeout(timeout time.Duration) *PackerServiceCreateBucketParams { + var () + return &PackerServiceCreateBucketParams{ + + timeout: timeout, + } +} + +// NewPackerServiceCreateBucketParamsWithContext creates a new PackerServiceCreateBucketParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceCreateBucketParamsWithContext(ctx context.Context) *PackerServiceCreateBucketParams { + var () + return &PackerServiceCreateBucketParams{ + + Context: ctx, + } +} + +// NewPackerServiceCreateBucketParamsWithHTTPClient creates a new PackerServiceCreateBucketParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceCreateBucketParamsWithHTTPClient(client *http.Client) *PackerServiceCreateBucketParams { + var () + return &PackerServiceCreateBucketParams{ + HTTPClient: client, + } +} + +/*PackerServiceCreateBucketParams contains all the parameters to send to the API endpoint +for the packer service create bucket operation typically these are written to a http.Request +*/ +type PackerServiceCreateBucketParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411CreateBucketRequest + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithTimeout(timeout time.Duration) *PackerServiceCreateBucketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithContext(ctx context.Context) *PackerServiceCreateBucketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithHTTPClient(client *http.Client) *PackerServiceCreateBucketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithBody(body *models.HashicorpCloudPacker20220411CreateBucketRequest) *PackerServiceCreateBucketParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetBody(body *models.HashicorpCloudPacker20220411CreateBucketRequest) { + o.Body = body +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceCreateBucketParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) WithLocationProjectID(locationProjectID string) *PackerServiceCreateBucketParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service create bucket params +func (o *PackerServiceCreateBucketParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceCreateBucketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_responses.go new file mode 100644 index 00000000..24db0499 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_bucket_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceCreateBucketReader is a Reader for the PackerServiceCreateBucket structure. +type PackerServiceCreateBucketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceCreateBucketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceCreateBucketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceCreateBucketDefault(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 + } +} + +// NewPackerServiceCreateBucketOK creates a PackerServiceCreateBucketOK with default headers values +func NewPackerServiceCreateBucketOK() *PackerServiceCreateBucketOK { + return &PackerServiceCreateBucketOK{} +} + +/*PackerServiceCreateBucketOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceCreateBucketOK struct { + Payload *models.HashicorpCloudPacker20220411CreateBucketResponse +} + +func (o *PackerServiceCreateBucketOK) Error() string { + return fmt.Sprintf("[PUT /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images][%d] packerServiceCreateBucketOK %+v", 200, o.Payload) +} + +func (o *PackerServiceCreateBucketOK) GetPayload() *models.HashicorpCloudPacker20220411CreateBucketResponse { + return o.Payload +} + +func (o *PackerServiceCreateBucketOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411CreateBucketResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceCreateBucketDefault creates a PackerServiceCreateBucketDefault with default headers values +func NewPackerServiceCreateBucketDefault(code int) *PackerServiceCreateBucketDefault { + return &PackerServiceCreateBucketDefault{ + _statusCode: code, + } +} + +/*PackerServiceCreateBucketDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceCreateBucketDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service create bucket default response +func (o *PackerServiceCreateBucketDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceCreateBucketDefault) Error() string { + return fmt.Sprintf("[PUT /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images][%d] PackerService_CreateBucket default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceCreateBucketDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceCreateBucketDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_parameters.go new file mode 100644 index 00000000..4e394ea2 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceCreateBuildParams creates a new PackerServiceCreateBuildParams object +// with the default values initialized. +func NewPackerServiceCreateBuildParams() *PackerServiceCreateBuildParams { + var () + return &PackerServiceCreateBuildParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceCreateBuildParamsWithTimeout creates a new PackerServiceCreateBuildParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceCreateBuildParamsWithTimeout(timeout time.Duration) *PackerServiceCreateBuildParams { + var () + return &PackerServiceCreateBuildParams{ + + timeout: timeout, + } +} + +// NewPackerServiceCreateBuildParamsWithContext creates a new PackerServiceCreateBuildParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceCreateBuildParamsWithContext(ctx context.Context) *PackerServiceCreateBuildParams { + var () + return &PackerServiceCreateBuildParams{ + + Context: ctx, + } +} + +// NewPackerServiceCreateBuildParamsWithHTTPClient creates a new PackerServiceCreateBuildParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceCreateBuildParamsWithHTTPClient(client *http.Client) *PackerServiceCreateBuildParams { + var () + return &PackerServiceCreateBuildParams{ + HTTPClient: client, + } +} + +/*PackerServiceCreateBuildParams contains all the parameters to send to the API endpoint +for the packer service create build operation typically these are written to a http.Request +*/ +type PackerServiceCreateBuildParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411CreateBuildRequest + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*IterationID + ULID of the iteration that this build should be associated with. + + */ + IterationID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithTimeout(timeout time.Duration) *PackerServiceCreateBuildParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithContext(ctx context.Context) *PackerServiceCreateBuildParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithHTTPClient(client *http.Client) *PackerServiceCreateBuildParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithBody(body *models.HashicorpCloudPacker20220411CreateBuildRequest) *PackerServiceCreateBuildParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetBody(body *models.HashicorpCloudPacker20220411CreateBuildRequest) { + o.Body = body +} + +// WithBucketSlug adds the bucketSlug to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithBucketSlug(bucketSlug string) *PackerServiceCreateBuildParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithIterationID adds the iterationID to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithIterationID(iterationID string) *PackerServiceCreateBuildParams { + o.SetIterationID(iterationID) + return o +} + +// SetIterationID adds the iterationId to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetIterationID(iterationID string) { + o.IterationID = iterationID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceCreateBuildParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service create build params +func (o *PackerServiceCreateBuildParams) WithLocationProjectID(locationProjectID string) *PackerServiceCreateBuildParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service create build params +func (o *PackerServiceCreateBuildParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceCreateBuildParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param iteration_id + if err := r.SetPathParam("iteration_id", o.IterationID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_responses.go new file mode 100644 index 00000000..83725ff1 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_build_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceCreateBuildReader is a Reader for the PackerServiceCreateBuild structure. +type PackerServiceCreateBuildReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceCreateBuildReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceCreateBuildOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceCreateBuildDefault(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 + } +} + +// NewPackerServiceCreateBuildOK creates a PackerServiceCreateBuildOK with default headers values +func NewPackerServiceCreateBuildOK() *PackerServiceCreateBuildOK { + return &PackerServiceCreateBuildOK{} +} + +/*PackerServiceCreateBuildOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceCreateBuildOK struct { + Payload *models.HashicorpCloudPacker20220411CreateBuildResponse +} + +func (o *PackerServiceCreateBuildOK) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}][%d] packerServiceCreateBuildOK %+v", 200, o.Payload) +} + +func (o *PackerServiceCreateBuildOK) GetPayload() *models.HashicorpCloudPacker20220411CreateBuildResponse { + return o.Payload +} + +func (o *PackerServiceCreateBuildOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411CreateBuildResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceCreateBuildDefault creates a PackerServiceCreateBuildDefault with default headers values +func NewPackerServiceCreateBuildDefault(code int) *PackerServiceCreateBuildDefault { + return &PackerServiceCreateBuildDefault{ + _statusCode: code, + } +} + +/*PackerServiceCreateBuildDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceCreateBuildDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service create build default response +func (o *PackerServiceCreateBuildDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceCreateBuildDefault) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}][%d] PackerService_CreateBuild default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceCreateBuildDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceCreateBuildDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_parameters.go new file mode 100644 index 00000000..f624b0ae --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceCreateChannelParams creates a new PackerServiceCreateChannelParams object +// with the default values initialized. +func NewPackerServiceCreateChannelParams() *PackerServiceCreateChannelParams { + var () + return &PackerServiceCreateChannelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceCreateChannelParamsWithTimeout creates a new PackerServiceCreateChannelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceCreateChannelParamsWithTimeout(timeout time.Duration) *PackerServiceCreateChannelParams { + var () + return &PackerServiceCreateChannelParams{ + + timeout: timeout, + } +} + +// NewPackerServiceCreateChannelParamsWithContext creates a new PackerServiceCreateChannelParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceCreateChannelParamsWithContext(ctx context.Context) *PackerServiceCreateChannelParams { + var () + return &PackerServiceCreateChannelParams{ + + Context: ctx, + } +} + +// NewPackerServiceCreateChannelParamsWithHTTPClient creates a new PackerServiceCreateChannelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceCreateChannelParamsWithHTTPClient(client *http.Client) *PackerServiceCreateChannelParams { + var () + return &PackerServiceCreateChannelParams{ + HTTPClient: client, + } +} + +/*PackerServiceCreateChannelParams contains all the parameters to send to the API endpoint +for the packer service create channel operation typically these are written to a http.Request +*/ +type PackerServiceCreateChannelParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411CreateChannelRequest + /*BucketSlug + Human-readable name for the bucket to associate the channel with. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithTimeout(timeout time.Duration) *PackerServiceCreateChannelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithContext(ctx context.Context) *PackerServiceCreateChannelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithHTTPClient(client *http.Client) *PackerServiceCreateChannelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithBody(body *models.HashicorpCloudPacker20220411CreateChannelRequest) *PackerServiceCreateChannelParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetBody(body *models.HashicorpCloudPacker20220411CreateChannelRequest) { + o.Body = body +} + +// WithBucketSlug adds the bucketSlug to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithBucketSlug(bucketSlug string) *PackerServiceCreateChannelParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceCreateChannelParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service create channel params +func (o *PackerServiceCreateChannelParams) WithLocationProjectID(locationProjectID string) *PackerServiceCreateChannelParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service create channel params +func (o *PackerServiceCreateChannelParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceCreateChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_responses.go new file mode 100644 index 00000000..36ec29ae --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_channel_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceCreateChannelReader is a Reader for the PackerServiceCreateChannel structure. +type PackerServiceCreateChannelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceCreateChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceCreateChannelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceCreateChannelDefault(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 + } +} + +// NewPackerServiceCreateChannelOK creates a PackerServiceCreateChannelOK with default headers values +func NewPackerServiceCreateChannelOK() *PackerServiceCreateChannelOK { + return &PackerServiceCreateChannelOK{} +} + +/*PackerServiceCreateChannelOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceCreateChannelOK struct { + Payload *models.HashicorpCloudPacker20220411CreateChannelResponse +} + +func (o *PackerServiceCreateChannelOK) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels][%d] packerServiceCreateChannelOK %+v", 200, o.Payload) +} + +func (o *PackerServiceCreateChannelOK) GetPayload() *models.HashicorpCloudPacker20220411CreateChannelResponse { + return o.Payload +} + +func (o *PackerServiceCreateChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411CreateChannelResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceCreateChannelDefault creates a PackerServiceCreateChannelDefault with default headers values +func NewPackerServiceCreateChannelDefault(code int) *PackerServiceCreateChannelDefault { + return &PackerServiceCreateChannelDefault{ + _statusCode: code, + } +} + +/*PackerServiceCreateChannelDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceCreateChannelDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service create channel default response +func (o *PackerServiceCreateChannelDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceCreateChannelDefault) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels][%d] PackerService_CreateChannel default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceCreateChannelDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceCreateChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_parameters.go new file mode 100644 index 00000000..9d5d087c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceCreateIterationParams creates a new PackerServiceCreateIterationParams object +// with the default values initialized. +func NewPackerServiceCreateIterationParams() *PackerServiceCreateIterationParams { + var () + return &PackerServiceCreateIterationParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceCreateIterationParamsWithTimeout creates a new PackerServiceCreateIterationParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceCreateIterationParamsWithTimeout(timeout time.Duration) *PackerServiceCreateIterationParams { + var () + return &PackerServiceCreateIterationParams{ + + timeout: timeout, + } +} + +// NewPackerServiceCreateIterationParamsWithContext creates a new PackerServiceCreateIterationParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceCreateIterationParamsWithContext(ctx context.Context) *PackerServiceCreateIterationParams { + var () + return &PackerServiceCreateIterationParams{ + + Context: ctx, + } +} + +// NewPackerServiceCreateIterationParamsWithHTTPClient creates a new PackerServiceCreateIterationParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceCreateIterationParamsWithHTTPClient(client *http.Client) *PackerServiceCreateIterationParams { + var () + return &PackerServiceCreateIterationParams{ + HTTPClient: client, + } +} + +/*PackerServiceCreateIterationParams contains all the parameters to send to the API endpoint +for the packer service create iteration operation typically these are written to a http.Request +*/ +type PackerServiceCreateIterationParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411CreateIterationRequest + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithTimeout(timeout time.Duration) *PackerServiceCreateIterationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithContext(ctx context.Context) *PackerServiceCreateIterationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithHTTPClient(client *http.Client) *PackerServiceCreateIterationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithBody(body *models.HashicorpCloudPacker20220411CreateIterationRequest) *PackerServiceCreateIterationParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetBody(body *models.HashicorpCloudPacker20220411CreateIterationRequest) { + o.Body = body +} + +// WithBucketSlug adds the bucketSlug to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithBucketSlug(bucketSlug string) *PackerServiceCreateIterationParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceCreateIterationParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) WithLocationProjectID(locationProjectID string) *PackerServiceCreateIterationParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service create iteration params +func (o *PackerServiceCreateIterationParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceCreateIterationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_responses.go new file mode 100644 index 00000000..7813edc0 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_iteration_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceCreateIterationReader is a Reader for the PackerServiceCreateIteration structure. +type PackerServiceCreateIterationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceCreateIterationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceCreateIterationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceCreateIterationDefault(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 + } +} + +// NewPackerServiceCreateIterationOK creates a PackerServiceCreateIterationOK with default headers values +func NewPackerServiceCreateIterationOK() *PackerServiceCreateIterationOK { + return &PackerServiceCreateIterationOK{} +} + +/*PackerServiceCreateIterationOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceCreateIterationOK struct { + Payload *models.HashicorpCloudPacker20220411CreateIterationResponse +} + +func (o *PackerServiceCreateIterationOK) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations][%d] packerServiceCreateIterationOK %+v", 200, o.Payload) +} + +func (o *PackerServiceCreateIterationOK) GetPayload() *models.HashicorpCloudPacker20220411CreateIterationResponse { + return o.Payload +} + +func (o *PackerServiceCreateIterationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411CreateIterationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceCreateIterationDefault creates a PackerServiceCreateIterationDefault with default headers values +func NewPackerServiceCreateIterationDefault(code int) *PackerServiceCreateIterationDefault { + return &PackerServiceCreateIterationDefault{ + _statusCode: code, + } +} + +/*PackerServiceCreateIterationDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceCreateIterationDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service create iteration default response +func (o *PackerServiceCreateIterationDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceCreateIterationDefault) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations][%d] PackerService_CreateIteration default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceCreateIterationDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceCreateIterationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_parameters.go new file mode 100644 index 00000000..9bafc377 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceCreateRegistryParams creates a new PackerServiceCreateRegistryParams object +// with the default values initialized. +func NewPackerServiceCreateRegistryParams() *PackerServiceCreateRegistryParams { + var () + return &PackerServiceCreateRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceCreateRegistryParamsWithTimeout creates a new PackerServiceCreateRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceCreateRegistryParamsWithTimeout(timeout time.Duration) *PackerServiceCreateRegistryParams { + var () + return &PackerServiceCreateRegistryParams{ + + timeout: timeout, + } +} + +// NewPackerServiceCreateRegistryParamsWithContext creates a new PackerServiceCreateRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceCreateRegistryParamsWithContext(ctx context.Context) *PackerServiceCreateRegistryParams { + var () + return &PackerServiceCreateRegistryParams{ + + Context: ctx, + } +} + +// NewPackerServiceCreateRegistryParamsWithHTTPClient creates a new PackerServiceCreateRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceCreateRegistryParamsWithHTTPClient(client *http.Client) *PackerServiceCreateRegistryParams { + var () + return &PackerServiceCreateRegistryParams{ + HTTPClient: client, + } +} + +/*PackerServiceCreateRegistryParams contains all the parameters to send to the API endpoint +for the packer service create registry operation typically these are written to a http.Request +*/ +type PackerServiceCreateRegistryParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411CreateRegistryRequest + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithTimeout(timeout time.Duration) *PackerServiceCreateRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithContext(ctx context.Context) *PackerServiceCreateRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithHTTPClient(client *http.Client) *PackerServiceCreateRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithBody(body *models.HashicorpCloudPacker20220411CreateRegistryRequest) *PackerServiceCreateRegistryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetBody(body *models.HashicorpCloudPacker20220411CreateRegistryRequest) { + o.Body = body +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceCreateRegistryParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) WithLocationProjectID(locationProjectID string) *PackerServiceCreateRegistryParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service create registry params +func (o *PackerServiceCreateRegistryParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceCreateRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_responses.go new file mode 100644 index 00000000..87ba689a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_create_registry_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceCreateRegistryReader is a Reader for the PackerServiceCreateRegistry structure. +type PackerServiceCreateRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceCreateRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceCreateRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceCreateRegistryDefault(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 + } +} + +// NewPackerServiceCreateRegistryOK creates a PackerServiceCreateRegistryOK with default headers values +func NewPackerServiceCreateRegistryOK() *PackerServiceCreateRegistryOK { + return &PackerServiceCreateRegistryOK{} +} + +/*PackerServiceCreateRegistryOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceCreateRegistryOK struct { + Payload *models.HashicorpCloudPacker20220411CreateRegistryResponse +} + +func (o *PackerServiceCreateRegistryOK) Error() string { + return fmt.Sprintf("[PUT /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] packerServiceCreateRegistryOK %+v", 200, o.Payload) +} + +func (o *PackerServiceCreateRegistryOK) GetPayload() *models.HashicorpCloudPacker20220411CreateRegistryResponse { + return o.Payload +} + +func (o *PackerServiceCreateRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411CreateRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceCreateRegistryDefault creates a PackerServiceCreateRegistryDefault with default headers values +func NewPackerServiceCreateRegistryDefault(code int) *PackerServiceCreateRegistryDefault { + return &PackerServiceCreateRegistryDefault{ + _statusCode: code, + } +} + +/*PackerServiceCreateRegistryDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceCreateRegistryDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service create registry default response +func (o *PackerServiceCreateRegistryDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceCreateRegistryDefault) Error() string { + return fmt.Sprintf("[PUT /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] PackerService_CreateRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceCreateRegistryDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceCreateRegistryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_parameters.go new file mode 100644 index 00000000..fb15c383 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_parameters.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceDeleteBucketParams creates a new PackerServiceDeleteBucketParams object +// with the default values initialized. +func NewPackerServiceDeleteBucketParams() *PackerServiceDeleteBucketParams { + var () + return &PackerServiceDeleteBucketParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceDeleteBucketParamsWithTimeout creates a new PackerServiceDeleteBucketParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceDeleteBucketParamsWithTimeout(timeout time.Duration) *PackerServiceDeleteBucketParams { + var () + return &PackerServiceDeleteBucketParams{ + + timeout: timeout, + } +} + +// NewPackerServiceDeleteBucketParamsWithContext creates a new PackerServiceDeleteBucketParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceDeleteBucketParamsWithContext(ctx context.Context) *PackerServiceDeleteBucketParams { + var () + return &PackerServiceDeleteBucketParams{ + + Context: ctx, + } +} + +// NewPackerServiceDeleteBucketParamsWithHTTPClient creates a new PackerServiceDeleteBucketParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceDeleteBucketParamsWithHTTPClient(client *http.Client) *PackerServiceDeleteBucketParams { + var () + return &PackerServiceDeleteBucketParams{ + HTTPClient: client, + } +} + +/*PackerServiceDeleteBucketParams contains all the parameters to send to the API endpoint +for the packer service delete bucket operation typically these are written to a http.Request +*/ +type PackerServiceDeleteBucketParams struct { + + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithTimeout(timeout time.Duration) *PackerServiceDeleteBucketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithContext(ctx context.Context) *PackerServiceDeleteBucketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithHTTPClient(client *http.Client) *PackerServiceDeleteBucketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithBucketSlug(bucketSlug string) *PackerServiceDeleteBucketParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceDeleteBucketParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithLocationProjectID(locationProjectID string) *PackerServiceDeleteBucketParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceDeleteBucketParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceDeleteBucketParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service delete bucket params +func (o *PackerServiceDeleteBucketParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceDeleteBucketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_responses.go new file mode 100644 index 00000000..3cdb71e7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_bucket_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceDeleteBucketReader is a Reader for the PackerServiceDeleteBucket structure. +type PackerServiceDeleteBucketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceDeleteBucketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceDeleteBucketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceDeleteBucketDefault(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 + } +} + +// NewPackerServiceDeleteBucketOK creates a PackerServiceDeleteBucketOK with default headers values +func NewPackerServiceDeleteBucketOK() *PackerServiceDeleteBucketOK { + return &PackerServiceDeleteBucketOK{} +} + +/*PackerServiceDeleteBucketOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceDeleteBucketOK struct { + Payload models.HashicorpCloudPacker20220411DeleteBucketResponse +} + +func (o *PackerServiceDeleteBucketOK) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] packerServiceDeleteBucketOK %+v", 200, o.Payload) +} + +func (o *PackerServiceDeleteBucketOK) GetPayload() models.HashicorpCloudPacker20220411DeleteBucketResponse { + return o.Payload +} + +func (o *PackerServiceDeleteBucketOK) 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 +} + +// NewPackerServiceDeleteBucketDefault creates a PackerServiceDeleteBucketDefault with default headers values +func NewPackerServiceDeleteBucketDefault(code int) *PackerServiceDeleteBucketDefault { + return &PackerServiceDeleteBucketDefault{ + _statusCode: code, + } +} + +/*PackerServiceDeleteBucketDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceDeleteBucketDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service delete bucket default response +func (o *PackerServiceDeleteBucketDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceDeleteBucketDefault) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] PackerService_DeleteBucket default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceDeleteBucketDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceDeleteBucketDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_parameters.go new file mode 100644 index 00000000..5f58b440 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_parameters.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceDeleteBuildParams creates a new PackerServiceDeleteBuildParams object +// with the default values initialized. +func NewPackerServiceDeleteBuildParams() *PackerServiceDeleteBuildParams { + var () + return &PackerServiceDeleteBuildParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceDeleteBuildParamsWithTimeout creates a new PackerServiceDeleteBuildParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceDeleteBuildParamsWithTimeout(timeout time.Duration) *PackerServiceDeleteBuildParams { + var () + return &PackerServiceDeleteBuildParams{ + + timeout: timeout, + } +} + +// NewPackerServiceDeleteBuildParamsWithContext creates a new PackerServiceDeleteBuildParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceDeleteBuildParamsWithContext(ctx context.Context) *PackerServiceDeleteBuildParams { + var () + return &PackerServiceDeleteBuildParams{ + + Context: ctx, + } +} + +// NewPackerServiceDeleteBuildParamsWithHTTPClient creates a new PackerServiceDeleteBuildParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceDeleteBuildParamsWithHTTPClient(client *http.Client) *PackerServiceDeleteBuildParams { + var () + return &PackerServiceDeleteBuildParams{ + HTTPClient: client, + } +} + +/*PackerServiceDeleteBuildParams contains all the parameters to send to the API endpoint +for the packer service delete build operation typically these are written to a http.Request +*/ +type PackerServiceDeleteBuildParams struct { + + /*BuildID + ULID of the build that should be deleted. + + */ + BuildID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithTimeout(timeout time.Duration) *PackerServiceDeleteBuildParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithContext(ctx context.Context) *PackerServiceDeleteBuildParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithHTTPClient(client *http.Client) *PackerServiceDeleteBuildParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBuildID adds the buildID to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithBuildID(buildID string) *PackerServiceDeleteBuildParams { + o.SetBuildID(buildID) + return o +} + +// SetBuildID adds the buildId to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetBuildID(buildID string) { + o.BuildID = buildID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceDeleteBuildParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithLocationProjectID(locationProjectID string) *PackerServiceDeleteBuildParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceDeleteBuildParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceDeleteBuildParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service delete build params +func (o *PackerServiceDeleteBuildParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceDeleteBuildParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param build_id + if err := r.SetPathParam("build_id", o.BuildID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_responses.go new file mode 100644 index 00000000..8dec1fed --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_build_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceDeleteBuildReader is a Reader for the PackerServiceDeleteBuild structure. +type PackerServiceDeleteBuildReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceDeleteBuildReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceDeleteBuildOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceDeleteBuildDefault(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 + } +} + +// NewPackerServiceDeleteBuildOK creates a PackerServiceDeleteBuildOK with default headers values +func NewPackerServiceDeleteBuildOK() *PackerServiceDeleteBuildOK { + return &PackerServiceDeleteBuildOK{} +} + +/*PackerServiceDeleteBuildOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceDeleteBuildOK struct { + Payload models.HashicorpCloudPacker20220411DeleteBuildResponse +} + +func (o *PackerServiceDeleteBuildOK) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] packerServiceDeleteBuildOK %+v", 200, o.Payload) +} + +func (o *PackerServiceDeleteBuildOK) GetPayload() models.HashicorpCloudPacker20220411DeleteBuildResponse { + return o.Payload +} + +func (o *PackerServiceDeleteBuildOK) 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 +} + +// NewPackerServiceDeleteBuildDefault creates a PackerServiceDeleteBuildDefault with default headers values +func NewPackerServiceDeleteBuildDefault(code int) *PackerServiceDeleteBuildDefault { + return &PackerServiceDeleteBuildDefault{ + _statusCode: code, + } +} + +/*PackerServiceDeleteBuildDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceDeleteBuildDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service delete build default response +func (o *PackerServiceDeleteBuildDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceDeleteBuildDefault) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] PackerService_DeleteBuild default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceDeleteBuildDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceDeleteBuildDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_parameters.go new file mode 100644 index 00000000..4303f7bb --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_parameters.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceDeleteChannelParams creates a new PackerServiceDeleteChannelParams object +// with the default values initialized. +func NewPackerServiceDeleteChannelParams() *PackerServiceDeleteChannelParams { + var () + return &PackerServiceDeleteChannelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceDeleteChannelParamsWithTimeout creates a new PackerServiceDeleteChannelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceDeleteChannelParamsWithTimeout(timeout time.Duration) *PackerServiceDeleteChannelParams { + var () + return &PackerServiceDeleteChannelParams{ + + timeout: timeout, + } +} + +// NewPackerServiceDeleteChannelParamsWithContext creates a new PackerServiceDeleteChannelParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceDeleteChannelParamsWithContext(ctx context.Context) *PackerServiceDeleteChannelParams { + var () + return &PackerServiceDeleteChannelParams{ + + Context: ctx, + } +} + +// NewPackerServiceDeleteChannelParamsWithHTTPClient creates a new PackerServiceDeleteChannelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceDeleteChannelParamsWithHTTPClient(client *http.Client) *PackerServiceDeleteChannelParams { + var () + return &PackerServiceDeleteChannelParams{ + HTTPClient: client, + } +} + +/*PackerServiceDeleteChannelParams contains all the parameters to send to the API endpoint +for the packer service delete channel operation typically these are written to a http.Request +*/ +type PackerServiceDeleteChannelParams struct { + + /*BucketSlug + Human-readable name for the bucket that the channel is associated with. + + */ + BucketSlug 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 + /*Slug + Human-readable name for the channel. + + */ + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithTimeout(timeout time.Duration) *PackerServiceDeleteChannelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithContext(ctx context.Context) *PackerServiceDeleteChannelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithHTTPClient(client *http.Client) *PackerServiceDeleteChannelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithBucketSlug(bucketSlug string) *PackerServiceDeleteChannelParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceDeleteChannelParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithLocationProjectID(locationProjectID string) *PackerServiceDeleteChannelParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceDeleteChannelParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceDeleteChannelParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSlug adds the slug to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) WithSlug(slug string) *PackerServiceDeleteChannelParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the packer service delete channel params +func (o *PackerServiceDeleteChannelParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceDeleteChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_responses.go new file mode 100644 index 00000000..73c6e34e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_channel_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceDeleteChannelReader is a Reader for the PackerServiceDeleteChannel structure. +type PackerServiceDeleteChannelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceDeleteChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceDeleteChannelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceDeleteChannelDefault(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 + } +} + +// NewPackerServiceDeleteChannelOK creates a PackerServiceDeleteChannelOK with default headers values +func NewPackerServiceDeleteChannelOK() *PackerServiceDeleteChannelOK { + return &PackerServiceDeleteChannelOK{} +} + +/*PackerServiceDeleteChannelOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceDeleteChannelOK struct { + Payload models.HashicorpCloudPacker20220411DeleteChannelResponse +} + +func (o *PackerServiceDeleteChannelOK) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] packerServiceDeleteChannelOK %+v", 200, o.Payload) +} + +func (o *PackerServiceDeleteChannelOK) GetPayload() models.HashicorpCloudPacker20220411DeleteChannelResponse { + return o.Payload +} + +func (o *PackerServiceDeleteChannelOK) 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 +} + +// NewPackerServiceDeleteChannelDefault creates a PackerServiceDeleteChannelDefault with default headers values +func NewPackerServiceDeleteChannelDefault(code int) *PackerServiceDeleteChannelDefault { + return &PackerServiceDeleteChannelDefault{ + _statusCode: code, + } +} + +/*PackerServiceDeleteChannelDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceDeleteChannelDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service delete channel default response +func (o *PackerServiceDeleteChannelDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceDeleteChannelDefault) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] PackerService_DeleteChannel default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceDeleteChannelDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceDeleteChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_parameters.go new file mode 100644 index 00000000..829ecd64 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_parameters.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceDeleteIterationParams creates a new PackerServiceDeleteIterationParams object +// with the default values initialized. +func NewPackerServiceDeleteIterationParams() *PackerServiceDeleteIterationParams { + var () + return &PackerServiceDeleteIterationParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceDeleteIterationParamsWithTimeout creates a new PackerServiceDeleteIterationParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceDeleteIterationParamsWithTimeout(timeout time.Duration) *PackerServiceDeleteIterationParams { + var () + return &PackerServiceDeleteIterationParams{ + + timeout: timeout, + } +} + +// NewPackerServiceDeleteIterationParamsWithContext creates a new PackerServiceDeleteIterationParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceDeleteIterationParamsWithContext(ctx context.Context) *PackerServiceDeleteIterationParams { + var () + return &PackerServiceDeleteIterationParams{ + + Context: ctx, + } +} + +// NewPackerServiceDeleteIterationParamsWithHTTPClient creates a new PackerServiceDeleteIterationParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceDeleteIterationParamsWithHTTPClient(client *http.Client) *PackerServiceDeleteIterationParams { + var () + return &PackerServiceDeleteIterationParams{ + HTTPClient: client, + } +} + +/*PackerServiceDeleteIterationParams contains all the parameters to send to the API endpoint +for the packer service delete iteration operation typically these are written to a http.Request +*/ +type PackerServiceDeleteIterationParams struct { + + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug *string + /*IterationID + ULID of the iteration. This was created and set by the + HCP Packer registry when the iteration was created. + + */ + IterationID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithTimeout(timeout time.Duration) *PackerServiceDeleteIterationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithContext(ctx context.Context) *PackerServiceDeleteIterationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithHTTPClient(client *http.Client) *PackerServiceDeleteIterationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithBucketSlug(bucketSlug *string) *PackerServiceDeleteIterationParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetBucketSlug(bucketSlug *string) { + o.BucketSlug = bucketSlug +} + +// WithIterationID adds the iterationID to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithIterationID(iterationID string) *PackerServiceDeleteIterationParams { + o.SetIterationID(iterationID) + return o +} + +// SetIterationID adds the iterationId to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetIterationID(iterationID string) { + o.IterationID = iterationID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceDeleteIterationParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithLocationProjectID(locationProjectID string) *PackerServiceDeleteIterationParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceDeleteIterationParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceDeleteIterationParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service delete iteration params +func (o *PackerServiceDeleteIterationParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceDeleteIterationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BucketSlug != nil { + + // query param bucket_slug + var qrBucketSlug string + if o.BucketSlug != nil { + qrBucketSlug = *o.BucketSlug + } + qBucketSlug := qrBucketSlug + if qBucketSlug != "" { + if err := r.SetQueryParam("bucket_slug", qBucketSlug); err != nil { + return err + } + } + + } + + // path param iteration_id + if err := r.SetPathParam("iteration_id", o.IterationID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_responses.go new file mode 100644 index 00000000..b61accc1 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_iteration_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceDeleteIterationReader is a Reader for the PackerServiceDeleteIteration structure. +type PackerServiceDeleteIterationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceDeleteIterationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceDeleteIterationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceDeleteIterationDefault(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 + } +} + +// NewPackerServiceDeleteIterationOK creates a PackerServiceDeleteIterationOK with default headers values +func NewPackerServiceDeleteIterationOK() *PackerServiceDeleteIterationOK { + return &PackerServiceDeleteIterationOK{} +} + +/*PackerServiceDeleteIterationOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceDeleteIterationOK struct { + Payload models.HashicorpCloudPacker20220411DeleteIterationResponse +} + +func (o *PackerServiceDeleteIterationOK) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}][%d] packerServiceDeleteIterationOK %+v", 200, o.Payload) +} + +func (o *PackerServiceDeleteIterationOK) GetPayload() models.HashicorpCloudPacker20220411DeleteIterationResponse { + return o.Payload +} + +func (o *PackerServiceDeleteIterationOK) 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 +} + +// NewPackerServiceDeleteIterationDefault creates a PackerServiceDeleteIterationDefault with default headers values +func NewPackerServiceDeleteIterationDefault(code int) *PackerServiceDeleteIterationDefault { + return &PackerServiceDeleteIterationDefault{ + _statusCode: code, + } +} + +/*PackerServiceDeleteIterationDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceDeleteIterationDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service delete iteration default response +func (o *PackerServiceDeleteIterationDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceDeleteIterationDefault) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}][%d] PackerService_DeleteIteration default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceDeleteIterationDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceDeleteIterationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_parameters.go new file mode 100644 index 00000000..2f0b0aa8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_parameters.go @@ -0,0 +1,254 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceDeleteRegistryParams creates a new PackerServiceDeleteRegistryParams object +// with the default values initialized. +func NewPackerServiceDeleteRegistryParams() *PackerServiceDeleteRegistryParams { + var () + return &PackerServiceDeleteRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceDeleteRegistryParamsWithTimeout creates a new PackerServiceDeleteRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceDeleteRegistryParamsWithTimeout(timeout time.Duration) *PackerServiceDeleteRegistryParams { + var () + return &PackerServiceDeleteRegistryParams{ + + timeout: timeout, + } +} + +// NewPackerServiceDeleteRegistryParamsWithContext creates a new PackerServiceDeleteRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceDeleteRegistryParamsWithContext(ctx context.Context) *PackerServiceDeleteRegistryParams { + var () + return &PackerServiceDeleteRegistryParams{ + + Context: ctx, + } +} + +// NewPackerServiceDeleteRegistryParamsWithHTTPClient creates a new PackerServiceDeleteRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceDeleteRegistryParamsWithHTTPClient(client *http.Client) *PackerServiceDeleteRegistryParams { + var () + return &PackerServiceDeleteRegistryParams{ + HTTPClient: client, + } +} + +/*PackerServiceDeleteRegistryParams contains all the parameters to send to the API endpoint +for the packer service delete registry operation typically these are written to a http.Request +*/ +type PackerServiceDeleteRegistryParams struct { + + /*HardDelete + When set to true, the registry will be deleted from database + and recovery will no longer be possible. + + */ + HardDelete *bool + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithTimeout(timeout time.Duration) *PackerServiceDeleteRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithContext(ctx context.Context) *PackerServiceDeleteRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithHTTPClient(client *http.Client) *PackerServiceDeleteRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHardDelete adds the hardDelete to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithHardDelete(hardDelete *bool) *PackerServiceDeleteRegistryParams { + o.SetHardDelete(hardDelete) + return o +} + +// SetHardDelete adds the hardDelete to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetHardDelete(hardDelete *bool) { + o.HardDelete = hardDelete +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceDeleteRegistryParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithLocationProjectID(locationProjectID string) *PackerServiceDeleteRegistryParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceDeleteRegistryParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceDeleteRegistryParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service delete registry params +func (o *PackerServiceDeleteRegistryParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceDeleteRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.HardDelete != nil { + + // query param hard_delete + var qrHardDelete bool + if o.HardDelete != nil { + qrHardDelete = *o.HardDelete + } + qHardDelete := swag.FormatBool(qrHardDelete) + if qHardDelete != "" { + if err := r.SetQueryParam("hard_delete", qHardDelete); err != nil { + return err + } + } + + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_responses.go new file mode 100644 index 00000000..d12be6ef --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_delete_registry_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceDeleteRegistryReader is a Reader for the PackerServiceDeleteRegistry structure. +type PackerServiceDeleteRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceDeleteRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceDeleteRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceDeleteRegistryDefault(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 + } +} + +// NewPackerServiceDeleteRegistryOK creates a PackerServiceDeleteRegistryOK with default headers values +func NewPackerServiceDeleteRegistryOK() *PackerServiceDeleteRegistryOK { + return &PackerServiceDeleteRegistryOK{} +} + +/*PackerServiceDeleteRegistryOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceDeleteRegistryOK struct { + Payload *models.HashicorpCloudPacker20220411DeleteRegistryResponse +} + +func (o *PackerServiceDeleteRegistryOK) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] packerServiceDeleteRegistryOK %+v", 200, o.Payload) +} + +func (o *PackerServiceDeleteRegistryOK) GetPayload() *models.HashicorpCloudPacker20220411DeleteRegistryResponse { + return o.Payload +} + +func (o *PackerServiceDeleteRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411DeleteRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceDeleteRegistryDefault creates a PackerServiceDeleteRegistryDefault with default headers values +func NewPackerServiceDeleteRegistryDefault(code int) *PackerServiceDeleteRegistryDefault { + return &PackerServiceDeleteRegistryDefault{ + _statusCode: code, + } +} + +/*PackerServiceDeleteRegistryDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceDeleteRegistryDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service delete registry default response +func (o *PackerServiceDeleteRegistryDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceDeleteRegistryDefault) Error() string { + return fmt.Sprintf("[DELETE /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] PackerService_DeleteRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceDeleteRegistryDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceDeleteRegistryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_parameters.go new file mode 100644 index 00000000..a2cdcaca --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_parameters.go @@ -0,0 +1,273 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceGetBucketParams creates a new PackerServiceGetBucketParams object +// with the default values initialized. +func NewPackerServiceGetBucketParams() *PackerServiceGetBucketParams { + var () + return &PackerServiceGetBucketParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetBucketParamsWithTimeout creates a new PackerServiceGetBucketParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetBucketParamsWithTimeout(timeout time.Duration) *PackerServiceGetBucketParams { + var () + return &PackerServiceGetBucketParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetBucketParamsWithContext creates a new PackerServiceGetBucketParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetBucketParamsWithContext(ctx context.Context) *PackerServiceGetBucketParams { + var () + return &PackerServiceGetBucketParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetBucketParamsWithHTTPClient creates a new PackerServiceGetBucketParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetBucketParamsWithHTTPClient(client *http.Client) *PackerServiceGetBucketParams { + var () + return &PackerServiceGetBucketParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetBucketParams contains all the parameters to send to the API endpoint +for the packer service get bucket operation typically these are written to a http.Request +*/ +type PackerServiceGetBucketParams struct { + + /*BucketID + ULID of the bucket. + + */ + BucketID *string + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithTimeout(timeout time.Duration) *PackerServiceGetBucketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithContext(ctx context.Context) *PackerServiceGetBucketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithHTTPClient(client *http.Client) *PackerServiceGetBucketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketID adds the bucketID to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithBucketID(bucketID *string) *PackerServiceGetBucketParams { + o.SetBucketID(bucketID) + return o +} + +// SetBucketID adds the bucketId to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetBucketID(bucketID *string) { + o.BucketID = bucketID +} + +// WithBucketSlug adds the bucketSlug to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithBucketSlug(bucketSlug string) *PackerServiceGetBucketParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetBucketParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetBucketParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetBucketParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get bucket params +func (o *PackerServiceGetBucketParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetBucketParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get bucket params +func (o *PackerServiceGetBucketParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetBucketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BucketID != nil { + + // query param bucket_id + var qrBucketID string + if o.BucketID != nil { + qrBucketID = *o.BucketID + } + qBucketID := qrBucketID + if qBucketID != "" { + if err := r.SetQueryParam("bucket_id", qBucketID); err != nil { + return err + } + } + + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_responses.go new file mode 100644 index 00000000..c6ddeb3e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_bucket_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetBucketReader is a Reader for the PackerServiceGetBucket structure. +type PackerServiceGetBucketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetBucketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetBucketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetBucketDefault(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 + } +} + +// NewPackerServiceGetBucketOK creates a PackerServiceGetBucketOK with default headers values +func NewPackerServiceGetBucketOK() *PackerServiceGetBucketOK { + return &PackerServiceGetBucketOK{} +} + +/*PackerServiceGetBucketOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetBucketOK struct { + Payload *models.HashicorpCloudPacker20220411GetBucketResponse +} + +func (o *PackerServiceGetBucketOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] packerServiceGetBucketOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetBucketOK) GetPayload() *models.HashicorpCloudPacker20220411GetBucketResponse { + return o.Payload +} + +func (o *PackerServiceGetBucketOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetBucketResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetBucketDefault creates a PackerServiceGetBucketDefault with default headers values +func NewPackerServiceGetBucketDefault(code int) *PackerServiceGetBucketDefault { + return &PackerServiceGetBucketDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetBucketDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetBucketDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get bucket default response +func (o *PackerServiceGetBucketDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetBucketDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] PackerService_GetBucket default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetBucketDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetBucketDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_parameters.go new file mode 100644 index 00000000..a6134d93 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_parameters.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceGetBuildParams creates a new PackerServiceGetBuildParams object +// with the default values initialized. +func NewPackerServiceGetBuildParams() *PackerServiceGetBuildParams { + var () + return &PackerServiceGetBuildParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetBuildParamsWithTimeout creates a new PackerServiceGetBuildParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetBuildParamsWithTimeout(timeout time.Duration) *PackerServiceGetBuildParams { + var () + return &PackerServiceGetBuildParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetBuildParamsWithContext creates a new PackerServiceGetBuildParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetBuildParamsWithContext(ctx context.Context) *PackerServiceGetBuildParams { + var () + return &PackerServiceGetBuildParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetBuildParamsWithHTTPClient creates a new PackerServiceGetBuildParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetBuildParamsWithHTTPClient(client *http.Client) *PackerServiceGetBuildParams { + var () + return &PackerServiceGetBuildParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetBuildParams contains all the parameters to send to the API endpoint +for the packer service get build operation typically these are written to a http.Request +*/ +type PackerServiceGetBuildParams struct { + + /*BuildID + ULID of the build that should be retrieved. + + */ + BuildID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get build params +func (o *PackerServiceGetBuildParams) WithTimeout(timeout time.Duration) *PackerServiceGetBuildParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get build params +func (o *PackerServiceGetBuildParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get build params +func (o *PackerServiceGetBuildParams) WithContext(ctx context.Context) *PackerServiceGetBuildParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get build params +func (o *PackerServiceGetBuildParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get build params +func (o *PackerServiceGetBuildParams) WithHTTPClient(client *http.Client) *PackerServiceGetBuildParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get build params +func (o *PackerServiceGetBuildParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBuildID adds the buildID to the packer service get build params +func (o *PackerServiceGetBuildParams) WithBuildID(buildID string) *PackerServiceGetBuildParams { + o.SetBuildID(buildID) + return o +} + +// SetBuildID adds the buildId to the packer service get build params +func (o *PackerServiceGetBuildParams) SetBuildID(buildID string) { + o.BuildID = buildID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get build params +func (o *PackerServiceGetBuildParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetBuildParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get build params +func (o *PackerServiceGetBuildParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get build params +func (o *PackerServiceGetBuildParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetBuildParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get build params +func (o *PackerServiceGetBuildParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get build params +func (o *PackerServiceGetBuildParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetBuildParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get build params +func (o *PackerServiceGetBuildParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get build params +func (o *PackerServiceGetBuildParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetBuildParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get build params +func (o *PackerServiceGetBuildParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetBuildParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param build_id + if err := r.SetPathParam("build_id", o.BuildID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_responses.go new file mode 100644 index 00000000..64cbf27f --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_build_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetBuildReader is a Reader for the PackerServiceGetBuild structure. +type PackerServiceGetBuildReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetBuildReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetBuildOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetBuildDefault(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 + } +} + +// NewPackerServiceGetBuildOK creates a PackerServiceGetBuildOK with default headers values +func NewPackerServiceGetBuildOK() *PackerServiceGetBuildOK { + return &PackerServiceGetBuildOK{} +} + +/*PackerServiceGetBuildOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetBuildOK struct { + Payload *models.HashicorpCloudPacker20220411GetBuildResponse +} + +func (o *PackerServiceGetBuildOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] packerServiceGetBuildOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetBuildOK) GetPayload() *models.HashicorpCloudPacker20220411GetBuildResponse { + return o.Payload +} + +func (o *PackerServiceGetBuildOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetBuildResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetBuildDefault creates a PackerServiceGetBuildDefault with default headers values +func NewPackerServiceGetBuildDefault(code int) *PackerServiceGetBuildDefault { + return &PackerServiceGetBuildDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetBuildDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetBuildDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get build default response +func (o *PackerServiceGetBuildDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetBuildDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] PackerService_GetBuild default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetBuildDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetBuildDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_parameters.go new file mode 100644 index 00000000..7d44a9d8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_parameters.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceGetChannelParams creates a new PackerServiceGetChannelParams object +// with the default values initialized. +func NewPackerServiceGetChannelParams() *PackerServiceGetChannelParams { + var () + return &PackerServiceGetChannelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetChannelParamsWithTimeout creates a new PackerServiceGetChannelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetChannelParamsWithTimeout(timeout time.Duration) *PackerServiceGetChannelParams { + var () + return &PackerServiceGetChannelParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetChannelParamsWithContext creates a new PackerServiceGetChannelParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetChannelParamsWithContext(ctx context.Context) *PackerServiceGetChannelParams { + var () + return &PackerServiceGetChannelParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetChannelParamsWithHTTPClient creates a new PackerServiceGetChannelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetChannelParamsWithHTTPClient(client *http.Client) *PackerServiceGetChannelParams { + var () + return &PackerServiceGetChannelParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetChannelParams contains all the parameters to send to the API endpoint +for the packer service get channel operation typically these are written to a http.Request +*/ +type PackerServiceGetChannelParams struct { + + /*BucketSlug + Human-readable name for the bucket that the channel is associated with. + + */ + BucketSlug 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 + /*Slug + Human-readable name for the channel. + + */ + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithTimeout(timeout time.Duration) *PackerServiceGetChannelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithContext(ctx context.Context) *PackerServiceGetChannelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithHTTPClient(client *http.Client) *PackerServiceGetChannelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithBucketSlug(bucketSlug string) *PackerServiceGetChannelParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetChannelParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetChannelParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetChannelParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetChannelParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithSlug adds the slug to the packer service get channel params +func (o *PackerServiceGetChannelParams) WithSlug(slug string) *PackerServiceGetChannelParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the packer service get channel params +func (o *PackerServiceGetChannelParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_responses.go new file mode 100644 index 00000000..28a8d934 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_channel_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetChannelReader is a Reader for the PackerServiceGetChannel structure. +type PackerServiceGetChannelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetChannelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetChannelDefault(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 + } +} + +// NewPackerServiceGetChannelOK creates a PackerServiceGetChannelOK with default headers values +func NewPackerServiceGetChannelOK() *PackerServiceGetChannelOK { + return &PackerServiceGetChannelOK{} +} + +/*PackerServiceGetChannelOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetChannelOK struct { + Payload *models.HashicorpCloudPacker20220411GetChannelResponse +} + +func (o *PackerServiceGetChannelOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] packerServiceGetChannelOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetChannelOK) GetPayload() *models.HashicorpCloudPacker20220411GetChannelResponse { + return o.Payload +} + +func (o *PackerServiceGetChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetChannelResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetChannelDefault creates a PackerServiceGetChannelDefault with default headers values +func NewPackerServiceGetChannelDefault(code int) *PackerServiceGetChannelDefault { + return &PackerServiceGetChannelDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetChannelDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetChannelDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get channel default response +func (o *PackerServiceGetChannelDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetChannelDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] PackerService_GetChannel default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetChannelDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_parameters.go new file mode 100644 index 00000000..81c93017 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_parameters.go @@ -0,0 +1,341 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceGetIterationParams creates a new PackerServiceGetIterationParams object +// with the default values initialized. +func NewPackerServiceGetIterationParams() *PackerServiceGetIterationParams { + var () + return &PackerServiceGetIterationParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetIterationParamsWithTimeout creates a new PackerServiceGetIterationParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetIterationParamsWithTimeout(timeout time.Duration) *PackerServiceGetIterationParams { + var () + return &PackerServiceGetIterationParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetIterationParamsWithContext creates a new PackerServiceGetIterationParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetIterationParamsWithContext(ctx context.Context) *PackerServiceGetIterationParams { + var () + return &PackerServiceGetIterationParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetIterationParamsWithHTTPClient creates a new PackerServiceGetIterationParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetIterationParamsWithHTTPClient(client *http.Client) *PackerServiceGetIterationParams { + var () + return &PackerServiceGetIterationParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetIterationParams contains all the parameters to send to the API endpoint +for the packer service get iteration operation typically these are written to a http.Request +*/ +type PackerServiceGetIterationParams struct { + + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*Fingerprint + Fingerprint of the iteration. The fingerprint is set by Packer when you + call `packer build`. It will most often correspond to a git commit sha, + but can be manually overridden by setting the environment variable + `HCP_PACKER_BUILD_FINGERPRINT`. + + */ + Fingerprint *string + /*IncrementalVersion + The human-readable version number assigned to this iteration. + + */ + IncrementalVersion *int32 + /*IterationID + ULID of the iteration. + + */ + IterationID *string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithTimeout(timeout time.Duration) *PackerServiceGetIterationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithContext(ctx context.Context) *PackerServiceGetIterationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithHTTPClient(client *http.Client) *PackerServiceGetIterationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithBucketSlug(bucketSlug string) *PackerServiceGetIterationParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithFingerprint adds the fingerprint to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithFingerprint(fingerprint *string) *PackerServiceGetIterationParams { + o.SetFingerprint(fingerprint) + return o +} + +// SetFingerprint adds the fingerprint to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetFingerprint(fingerprint *string) { + o.Fingerprint = fingerprint +} + +// WithIncrementalVersion adds the incrementalVersion to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithIncrementalVersion(incrementalVersion *int32) *PackerServiceGetIterationParams { + o.SetIncrementalVersion(incrementalVersion) + return o +} + +// SetIncrementalVersion adds the incrementalVersion to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetIncrementalVersion(incrementalVersion *int32) { + o.IncrementalVersion = incrementalVersion +} + +// WithIterationID adds the iterationID to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithIterationID(iterationID *string) *PackerServiceGetIterationParams { + o.SetIterationID(iterationID) + return o +} + +// SetIterationID adds the iterationId to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetIterationID(iterationID *string) { + o.IterationID = iterationID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetIterationParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetIterationParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetIterationParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get iteration params +func (o *PackerServiceGetIterationParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetIterationParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get iteration params +func (o *PackerServiceGetIterationParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetIterationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + if o.Fingerprint != nil { + + // query param fingerprint + var qrFingerprint string + if o.Fingerprint != nil { + qrFingerprint = *o.Fingerprint + } + qFingerprint := qrFingerprint + if qFingerprint != "" { + if err := r.SetQueryParam("fingerprint", qFingerprint); err != nil { + return err + } + } + + } + + if o.IncrementalVersion != nil { + + // query param incremental_version + var qrIncrementalVersion int32 + if o.IncrementalVersion != nil { + qrIncrementalVersion = *o.IncrementalVersion + } + qIncrementalVersion := swag.FormatInt32(qrIncrementalVersion) + if qIncrementalVersion != "" { + if err := r.SetQueryParam("incremental_version", qIncrementalVersion); err != nil { + return err + } + } + + } + + if o.IterationID != nil { + + // query param iteration_id + var qrIterationID string + if o.IterationID != nil { + qrIterationID = *o.IterationID + } + qIterationID := qrIterationID + if qIterationID != "" { + if err := r.SetQueryParam("iteration_id", qIterationID); err != nil { + return err + } + } + + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_responses.go new file mode 100644 index 00000000..b567ff93 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_iteration_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetIterationReader is a Reader for the PackerServiceGetIteration structure. +type PackerServiceGetIterationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetIterationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetIterationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetIterationDefault(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 + } +} + +// NewPackerServiceGetIterationOK creates a PackerServiceGetIterationOK with default headers values +func NewPackerServiceGetIterationOK() *PackerServiceGetIterationOK { + return &PackerServiceGetIterationOK{} +} + +/*PackerServiceGetIterationOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetIterationOK struct { + Payload *models.HashicorpCloudPacker20220411GetIterationResponse +} + +func (o *PackerServiceGetIterationOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iteration][%d] packerServiceGetIterationOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetIterationOK) GetPayload() *models.HashicorpCloudPacker20220411GetIterationResponse { + return o.Payload +} + +func (o *PackerServiceGetIterationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetIterationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetIterationDefault creates a PackerServiceGetIterationDefault with default headers values +func NewPackerServiceGetIterationDefault(code int) *PackerServiceGetIterationDefault { + return &PackerServiceGetIterationDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetIterationDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetIterationDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get iteration default response +func (o *PackerServiceGetIterationDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetIterationDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iteration][%d] PackerService_GetIteration default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetIterationDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetIterationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_parameters.go new file mode 100644 index 00000000..d560e5f1 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_parameters.go @@ -0,0 +1,220 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceGetRegistryParams creates a new PackerServiceGetRegistryParams object +// with the default values initialized. +func NewPackerServiceGetRegistryParams() *PackerServiceGetRegistryParams { + var () + return &PackerServiceGetRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetRegistryParamsWithTimeout creates a new PackerServiceGetRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetRegistryParamsWithTimeout(timeout time.Duration) *PackerServiceGetRegistryParams { + var () + return &PackerServiceGetRegistryParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetRegistryParamsWithContext creates a new PackerServiceGetRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetRegistryParamsWithContext(ctx context.Context) *PackerServiceGetRegistryParams { + var () + return &PackerServiceGetRegistryParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetRegistryParamsWithHTTPClient creates a new PackerServiceGetRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetRegistryParamsWithHTTPClient(client *http.Client) *PackerServiceGetRegistryParams { + var () + return &PackerServiceGetRegistryParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetRegistryParams contains all the parameters to send to the API endpoint +for the packer service get registry operation typically these are written to a http.Request +*/ +type PackerServiceGetRegistryParams struct { + + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithTimeout(timeout time.Duration) *PackerServiceGetRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithContext(ctx context.Context) *PackerServiceGetRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithHTTPClient(client *http.Client) *PackerServiceGetRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetRegistryParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetRegistryParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetRegistryParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get registry params +func (o *PackerServiceGetRegistryParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetRegistryParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get registry params +func (o *PackerServiceGetRegistryParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_responses.go new file mode 100644 index 00000000..1def1925 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetRegistryReader is a Reader for the PackerServiceGetRegistry structure. +type PackerServiceGetRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetRegistryDefault(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 + } +} + +// NewPackerServiceGetRegistryOK creates a PackerServiceGetRegistryOK with default headers values +func NewPackerServiceGetRegistryOK() *PackerServiceGetRegistryOK { + return &PackerServiceGetRegistryOK{} +} + +/*PackerServiceGetRegistryOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetRegistryOK struct { + Payload *models.HashicorpCloudPacker20220411GetRegistryResponse +} + +func (o *PackerServiceGetRegistryOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] packerServiceGetRegistryOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetRegistryOK) GetPayload() *models.HashicorpCloudPacker20220411GetRegistryResponse { + return o.Payload +} + +func (o *PackerServiceGetRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetRegistryDefault creates a PackerServiceGetRegistryDefault with default headers values +func NewPackerServiceGetRegistryDefault(code int) *PackerServiceGetRegistryDefault { + return &PackerServiceGetRegistryDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetRegistryDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetRegistryDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get registry default response +func (o *PackerServiceGetRegistryDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetRegistryDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] PackerService_GetRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetRegistryDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetRegistryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_parameters.go new file mode 100644 index 00000000..e3852bcf --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_parameters.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceGetRegistryTFCRunTaskAPIParams creates a new PackerServiceGetRegistryTFCRunTaskAPIParams object +// with the default values initialized. +func NewPackerServiceGetRegistryTFCRunTaskAPIParams() *PackerServiceGetRegistryTFCRunTaskAPIParams { + var () + return &PackerServiceGetRegistryTFCRunTaskAPIParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithTimeout creates a new PackerServiceGetRegistryTFCRunTaskAPIParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithTimeout(timeout time.Duration) *PackerServiceGetRegistryTFCRunTaskAPIParams { + var () + return &PackerServiceGetRegistryTFCRunTaskAPIParams{ + + timeout: timeout, + } +} + +// NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithContext creates a new PackerServiceGetRegistryTFCRunTaskAPIParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithContext(ctx context.Context) *PackerServiceGetRegistryTFCRunTaskAPIParams { + var () + return &PackerServiceGetRegistryTFCRunTaskAPIParams{ + + Context: ctx, + } +} + +// NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithHTTPClient creates a new PackerServiceGetRegistryTFCRunTaskAPIParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceGetRegistryTFCRunTaskAPIParamsWithHTTPClient(client *http.Client) *PackerServiceGetRegistryTFCRunTaskAPIParams { + var () + return &PackerServiceGetRegistryTFCRunTaskAPIParams{ + HTTPClient: client, + } +} + +/*PackerServiceGetRegistryTFCRunTaskAPIParams contains all the parameters to send to the API endpoint +for the packer service get registry t f c run task API operation typically these are written to a http.Request +*/ +type PackerServiceGetRegistryTFCRunTaskAPIParams struct { + + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + /*TaskType + The HCP Packer Terraform Cloud run task type. + Currently, the only existing type is `validation`. + + */ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithTimeout(timeout time.Duration) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithContext(ctx context.Context) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithHTTPClient(client *http.Client) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithLocationProjectID(locationProjectID string) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithTaskType adds the taskType to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WithTaskType(taskType string) *PackerServiceGetRegistryTFCRunTaskAPIParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the packer service get registry t f c run task API params +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceGetRegistryTFCRunTaskAPIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_responses.go new file mode 100644 index 00000000..deb963b5 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_get_registry_t_f_c_run_task_api_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceGetRegistryTFCRunTaskAPIReader is a Reader for the PackerServiceGetRegistryTFCRunTaskAPI structure. +type PackerServiceGetRegistryTFCRunTaskAPIReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceGetRegistryTFCRunTaskAPIReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceGetRegistryTFCRunTaskAPIOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceGetRegistryTFCRunTaskAPIDefault(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 + } +} + +// NewPackerServiceGetRegistryTFCRunTaskAPIOK creates a PackerServiceGetRegistryTFCRunTaskAPIOK with default headers values +func NewPackerServiceGetRegistryTFCRunTaskAPIOK() *PackerServiceGetRegistryTFCRunTaskAPIOK { + return &PackerServiceGetRegistryTFCRunTaskAPIOK{} +} + +/*PackerServiceGetRegistryTFCRunTaskAPIOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceGetRegistryTFCRunTaskAPIOK struct { + Payload *models.HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/{task_type}][%d] packerServiceGetRegistryTFCRunTaskApiOK %+v", 200, o.Payload) +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIOK) GetPayload() *models.HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse { + return o.Payload +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceGetRegistryTFCRunTaskAPIDefault creates a PackerServiceGetRegistryTFCRunTaskAPIDefault with default headers values +func NewPackerServiceGetRegistryTFCRunTaskAPIDefault(code int) *PackerServiceGetRegistryTFCRunTaskAPIDefault { + return &PackerServiceGetRegistryTFCRunTaskAPIDefault{ + _statusCode: code, + } +} + +/*PackerServiceGetRegistryTFCRunTaskAPIDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceGetRegistryTFCRunTaskAPIDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service get registry t f c run task API default response +func (o *PackerServiceGetRegistryTFCRunTaskAPIDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/{task_type}][%d] PackerService_GetRegistryTFCRunTaskAPI default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceGetRegistryTFCRunTaskAPIDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_parameters.go new file mode 100644 index 00000000..62714924 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_parameters.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceListBucketAncestryParams creates a new PackerServiceListBucketAncestryParams object +// with the default values initialized. +func NewPackerServiceListBucketAncestryParams() *PackerServiceListBucketAncestryParams { + var () + return &PackerServiceListBucketAncestryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceListBucketAncestryParamsWithTimeout creates a new PackerServiceListBucketAncestryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceListBucketAncestryParamsWithTimeout(timeout time.Duration) *PackerServiceListBucketAncestryParams { + var () + return &PackerServiceListBucketAncestryParams{ + + timeout: timeout, + } +} + +// NewPackerServiceListBucketAncestryParamsWithContext creates a new PackerServiceListBucketAncestryParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceListBucketAncestryParamsWithContext(ctx context.Context) *PackerServiceListBucketAncestryParams { + var () + return &PackerServiceListBucketAncestryParams{ + + Context: ctx, + } +} + +// NewPackerServiceListBucketAncestryParamsWithHTTPClient creates a new PackerServiceListBucketAncestryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceListBucketAncestryParamsWithHTTPClient(client *http.Client) *PackerServiceListBucketAncestryParams { + var () + return &PackerServiceListBucketAncestryParams{ + HTTPClient: client, + } +} + +/*PackerServiceListBucketAncestryParams contains all the parameters to send to the API endpoint +for the packer service list bucket ancestry operation typically these are written to a http.Request +*/ +type PackerServiceListBucketAncestryParams struct { + + /*BucketSlug + Human-readable name for the bucket you want to list ancestry for. + + */ + BucketSlug string + /*Channel + The channel of the bucket used to filter children. + All listed children were built from iterations when assigned to this channel. + By default, an unspecified channel will list all children based on any iteration of this bucket. + + */ + Channel *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 + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*Type + The type of ancestry relations to list. Type 'parents' will list all the ancestral relations where this bucket is a child. + Type 'children' will list all the ancestral relations where this bucket is a parent. + By default, an unspecified type will list the ancestral relations where this bucket is either a parent or a child. + + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithTimeout(timeout time.Duration) *PackerServiceListBucketAncestryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithContext(ctx context.Context) *PackerServiceListBucketAncestryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithHTTPClient(client *http.Client) *PackerServiceListBucketAncestryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithBucketSlug(bucketSlug string) *PackerServiceListBucketAncestryParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithChannel adds the channel to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithChannel(channel *string) *PackerServiceListBucketAncestryParams { + o.SetChannel(channel) + return o +} + +// SetChannel adds the channel to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetChannel(channel *string) { + o.Channel = channel +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceListBucketAncestryParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithLocationProjectID(locationProjectID string) *PackerServiceListBucketAncestryParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceListBucketAncestryParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceListBucketAncestryParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithPaginationNextPageToken(paginationNextPageToken *string) *PackerServiceListBucketAncestryParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithPaginationPageSize(paginationPageSize *int64) *PackerServiceListBucketAncestryParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *PackerServiceListBucketAncestryParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithType adds the typeVar to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) WithType(typeVar *string) *PackerServiceListBucketAncestryParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the packer service list bucket ancestry params +func (o *PackerServiceListBucketAncestryParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceListBucketAncestryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + if o.Channel != nil { + + // query param channel + var qrChannel string + if o.Channel != nil { + qrChannel = *o.Channel + } + qChannel := qrChannel + if qChannel != "" { + if err := r.SetQueryParam("channel", qChannel); err != nil { + return err + } + } + + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_responses.go new file mode 100644 index 00000000..42f0055c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_bucket_ancestry_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceListBucketAncestryReader is a Reader for the PackerServiceListBucketAncestry structure. +type PackerServiceListBucketAncestryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceListBucketAncestryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceListBucketAncestryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceListBucketAncestryDefault(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 + } +} + +// NewPackerServiceListBucketAncestryOK creates a PackerServiceListBucketAncestryOK with default headers values +func NewPackerServiceListBucketAncestryOK() *PackerServiceListBucketAncestryOK { + return &PackerServiceListBucketAncestryOK{} +} + +/*PackerServiceListBucketAncestryOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceListBucketAncestryOK struct { + Payload *models.HashicorpCloudPacker20220411ListBucketAncestryResponse +} + +func (o *PackerServiceListBucketAncestryOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/ancestry][%d] packerServiceListBucketAncestryOK %+v", 200, o.Payload) +} + +func (o *PackerServiceListBucketAncestryOK) GetPayload() *models.HashicorpCloudPacker20220411ListBucketAncestryResponse { + return o.Payload +} + +func (o *PackerServiceListBucketAncestryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411ListBucketAncestryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceListBucketAncestryDefault creates a PackerServiceListBucketAncestryDefault with default headers values +func NewPackerServiceListBucketAncestryDefault(code int) *PackerServiceListBucketAncestryDefault { + return &PackerServiceListBucketAncestryDefault{ + _statusCode: code, + } +} + +/*PackerServiceListBucketAncestryDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceListBucketAncestryDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service list bucket ancestry default response +func (o *PackerServiceListBucketAncestryDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceListBucketAncestryDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/ancestry][%d] PackerService_ListBucketAncestry default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceListBucketAncestryDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceListBucketAncestryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_parameters.go new file mode 100644 index 00000000..4550f14e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_parameters.go @@ -0,0 +1,357 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceListBucketsParams creates a new PackerServiceListBucketsParams object +// with the default values initialized. +func NewPackerServiceListBucketsParams() *PackerServiceListBucketsParams { + var () + return &PackerServiceListBucketsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceListBucketsParamsWithTimeout creates a new PackerServiceListBucketsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceListBucketsParamsWithTimeout(timeout time.Duration) *PackerServiceListBucketsParams { + var () + return &PackerServiceListBucketsParams{ + + timeout: timeout, + } +} + +// NewPackerServiceListBucketsParamsWithContext creates a new PackerServiceListBucketsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceListBucketsParamsWithContext(ctx context.Context) *PackerServiceListBucketsParams { + var () + return &PackerServiceListBucketsParams{ + + Context: ctx, + } +} + +// NewPackerServiceListBucketsParamsWithHTTPClient creates a new PackerServiceListBucketsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceListBucketsParamsWithHTTPClient(client *http.Client) *PackerServiceListBucketsParams { + var () + return &PackerServiceListBucketsParams{ + HTTPClient: client, + } +} + +/*PackerServiceListBucketsParams contains all the parameters to send to the API endpoint +for the packer service list buckets operation typically these are written to a http.Request +*/ +type PackerServiceListBucketsParams struct { + + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*SortingOrderBy + Specifies the list of per field ordering that should be used for sorting. + The order matters as rows are sorted in order by fields and when the field + matches, the next field is used to tie break the ordering. + The per field default ordering is ascending. + + The fields should be immutabile, unique, and orderable. If the field is + not unique, more than one sort fields should be passed. + + Example: oder_by=name,age desc,created_at asc + In that case, 'name' will get the default 'ascending' order. + + */ + SortingOrderBy []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithTimeout(timeout time.Duration) *PackerServiceListBucketsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithContext(ctx context.Context) *PackerServiceListBucketsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithHTTPClient(client *http.Client) *PackerServiceListBucketsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceListBucketsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithLocationProjectID(locationProjectID string) *PackerServiceListBucketsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceListBucketsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceListBucketsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *PackerServiceListBucketsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithPaginationPageSize(paginationPageSize *int64) *PackerServiceListBucketsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *PackerServiceListBucketsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithSortingOrderBy adds the sortingOrderBy to the packer service list buckets params +func (o *PackerServiceListBucketsParams) WithSortingOrderBy(sortingOrderBy []string) *PackerServiceListBucketsParams { + o.SetSortingOrderBy(sortingOrderBy) + return o +} + +// SetSortingOrderBy adds the sortingOrderBy to the packer service list buckets params +func (o *PackerServiceListBucketsParams) SetSortingOrderBy(sortingOrderBy []string) { + o.SortingOrderBy = sortingOrderBy +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceListBucketsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + valuesSortingOrderBy := o.SortingOrderBy + + joinedSortingOrderBy := swag.JoinByFormat(valuesSortingOrderBy, "multi") + // query array param sorting.order_by + if err := r.SetQueryParam("sorting.order_by", joinedSortingOrderBy...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_responses.go new file mode 100644 index 00000000..309557a7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_buckets_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceListBucketsReader is a Reader for the PackerServiceListBuckets structure. +type PackerServiceListBucketsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceListBucketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceListBucketsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceListBucketsDefault(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 + } +} + +// NewPackerServiceListBucketsOK creates a PackerServiceListBucketsOK with default headers values +func NewPackerServiceListBucketsOK() *PackerServiceListBucketsOK { + return &PackerServiceListBucketsOK{} +} + +/*PackerServiceListBucketsOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceListBucketsOK struct { + Payload *models.HashicorpCloudPacker20220411ListBucketsResponse +} + +func (o *PackerServiceListBucketsOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images][%d] packerServiceListBucketsOK %+v", 200, o.Payload) +} + +func (o *PackerServiceListBucketsOK) GetPayload() *models.HashicorpCloudPacker20220411ListBucketsResponse { + return o.Payload +} + +func (o *PackerServiceListBucketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411ListBucketsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceListBucketsDefault creates a PackerServiceListBucketsDefault with default headers values +func NewPackerServiceListBucketsDefault(code int) *PackerServiceListBucketsDefault { + return &PackerServiceListBucketsDefault{ + _statusCode: code, + } +} + +/*PackerServiceListBucketsDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceListBucketsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service list buckets default response +func (o *PackerServiceListBucketsDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceListBucketsDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images][%d] PackerService_ListBuckets default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceListBucketsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceListBucketsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_parameters.go new file mode 100644 index 00000000..18745fd6 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_parameters.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceListBuildsParams creates a new PackerServiceListBuildsParams object +// with the default values initialized. +func NewPackerServiceListBuildsParams() *PackerServiceListBuildsParams { + var () + return &PackerServiceListBuildsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceListBuildsParamsWithTimeout creates a new PackerServiceListBuildsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceListBuildsParamsWithTimeout(timeout time.Duration) *PackerServiceListBuildsParams { + var () + return &PackerServiceListBuildsParams{ + + timeout: timeout, + } +} + +// NewPackerServiceListBuildsParamsWithContext creates a new PackerServiceListBuildsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceListBuildsParamsWithContext(ctx context.Context) *PackerServiceListBuildsParams { + var () + return &PackerServiceListBuildsParams{ + + Context: ctx, + } +} + +// NewPackerServiceListBuildsParamsWithHTTPClient creates a new PackerServiceListBuildsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceListBuildsParamsWithHTTPClient(client *http.Client) *PackerServiceListBuildsParams { + var () + return &PackerServiceListBuildsParams{ + HTTPClient: client, + } +} + +/*PackerServiceListBuildsParams contains all the parameters to send to the API endpoint +for the packer service list builds operation typically these are written to a http.Request +*/ +type PackerServiceListBuildsParams struct { + + /*BucketSlug + Human-readable name for the bucket to list builds for. + + */ + BucketSlug string + /*IterationID + ULID of the iteration to list builds for. + + */ + IterationID 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 + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*SortingOrderBy + Specifies the list of per field ordering that should be used for sorting. + The order matters as rows are sorted in order by fields and when the field + matches, the next field is used to tie break the ordering. + The per field default ordering is ascending. + + The fields should be immutabile, unique, and orderable. If the field is + not unique, more than one sort fields should be passed. + + Example: oder_by=name,age desc,created_at asc + In that case, 'name' will get the default 'ascending' order. + + */ + SortingOrderBy []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithTimeout(timeout time.Duration) *PackerServiceListBuildsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithContext(ctx context.Context) *PackerServiceListBuildsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithHTTPClient(client *http.Client) *PackerServiceListBuildsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithBucketSlug(bucketSlug string) *PackerServiceListBuildsParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithIterationID adds the iterationID to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithIterationID(iterationID string) *PackerServiceListBuildsParams { + o.SetIterationID(iterationID) + return o +} + +// SetIterationID adds the iterationId to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetIterationID(iterationID string) { + o.IterationID = iterationID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceListBuildsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithLocationProjectID(locationProjectID string) *PackerServiceListBuildsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceListBuildsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceListBuildsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *PackerServiceListBuildsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithPaginationPageSize(paginationPageSize *int64) *PackerServiceListBuildsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *PackerServiceListBuildsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithSortingOrderBy adds the sortingOrderBy to the packer service list builds params +func (o *PackerServiceListBuildsParams) WithSortingOrderBy(sortingOrderBy []string) *PackerServiceListBuildsParams { + o.SetSortingOrderBy(sortingOrderBy) + return o +} + +// SetSortingOrderBy adds the sortingOrderBy to the packer service list builds params +func (o *PackerServiceListBuildsParams) SetSortingOrderBy(sortingOrderBy []string) { + o.SortingOrderBy = sortingOrderBy +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceListBuildsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param iteration_id + if err := r.SetPathParam("iteration_id", o.IterationID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + valuesSortingOrderBy := o.SortingOrderBy + + joinedSortingOrderBy := swag.JoinByFormat(valuesSortingOrderBy, "multi") + // query array param sorting.order_by + if err := r.SetQueryParam("sorting.order_by", joinedSortingOrderBy...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_responses.go new file mode 100644 index 00000000..b5b90611 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_builds_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceListBuildsReader is a Reader for the PackerServiceListBuilds structure. +type PackerServiceListBuildsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceListBuildsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceListBuildsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceListBuildsDefault(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 + } +} + +// NewPackerServiceListBuildsOK creates a PackerServiceListBuildsOK with default headers values +func NewPackerServiceListBuildsOK() *PackerServiceListBuildsOK { + return &PackerServiceListBuildsOK{} +} + +/*PackerServiceListBuildsOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceListBuildsOK struct { + Payload *models.HashicorpCloudPacker20220411ListBuildsResponse +} + +func (o *PackerServiceListBuildsOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}/builds][%d] packerServiceListBuildsOK %+v", 200, o.Payload) +} + +func (o *PackerServiceListBuildsOK) GetPayload() *models.HashicorpCloudPacker20220411ListBuildsResponse { + return o.Payload +} + +func (o *PackerServiceListBuildsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411ListBuildsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceListBuildsDefault creates a PackerServiceListBuildsDefault with default headers values +func NewPackerServiceListBuildsDefault(code int) *PackerServiceListBuildsDefault { + return &PackerServiceListBuildsDefault{ + _statusCode: code, + } +} + +/*PackerServiceListBuildsDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceListBuildsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service list builds default response +func (o *PackerServiceListBuildsDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceListBuildsDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations/{iteration_id}/builds][%d] PackerService_ListBuilds default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceListBuildsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceListBuildsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_parameters.go new file mode 100644 index 00000000..c1f7db51 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_parameters.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceListChannelsParams creates a new PackerServiceListChannelsParams object +// with the default values initialized. +func NewPackerServiceListChannelsParams() *PackerServiceListChannelsParams { + var () + return &PackerServiceListChannelsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceListChannelsParamsWithTimeout creates a new PackerServiceListChannelsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceListChannelsParamsWithTimeout(timeout time.Duration) *PackerServiceListChannelsParams { + var () + return &PackerServiceListChannelsParams{ + + timeout: timeout, + } +} + +// NewPackerServiceListChannelsParamsWithContext creates a new PackerServiceListChannelsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceListChannelsParamsWithContext(ctx context.Context) *PackerServiceListChannelsParams { + var () + return &PackerServiceListChannelsParams{ + + Context: ctx, + } +} + +// NewPackerServiceListChannelsParamsWithHTTPClient creates a new PackerServiceListChannelsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceListChannelsParamsWithHTTPClient(client *http.Client) *PackerServiceListChannelsParams { + var () + return &PackerServiceListChannelsParams{ + HTTPClient: client, + } +} + +/*PackerServiceListChannelsParams contains all the parameters to send to the API endpoint +for the packer service list channels operation typically these are written to a http.Request +*/ +type PackerServiceListChannelsParams struct { + + /*BucketSlug + Human-readable name for the bucket you want to list channels for. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithTimeout(timeout time.Duration) *PackerServiceListChannelsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithContext(ctx context.Context) *PackerServiceListChannelsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithHTTPClient(client *http.Client) *PackerServiceListChannelsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithBucketSlug(bucketSlug string) *PackerServiceListChannelsParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceListChannelsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithLocationProjectID(locationProjectID string) *PackerServiceListChannelsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceListChannelsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service list channels params +func (o *PackerServiceListChannelsParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceListChannelsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service list channels params +func (o *PackerServiceListChannelsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceListChannelsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_responses.go new file mode 100644 index 00000000..3a0c66e4 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_channels_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceListChannelsReader is a Reader for the PackerServiceListChannels structure. +type PackerServiceListChannelsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceListChannelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceListChannelsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceListChannelsDefault(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 + } +} + +// NewPackerServiceListChannelsOK creates a PackerServiceListChannelsOK with default headers values +func NewPackerServiceListChannelsOK() *PackerServiceListChannelsOK { + return &PackerServiceListChannelsOK{} +} + +/*PackerServiceListChannelsOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceListChannelsOK struct { + Payload *models.HashicorpCloudPacker20220411ListChannelsResponse +} + +func (o *PackerServiceListChannelsOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels][%d] packerServiceListChannelsOK %+v", 200, o.Payload) +} + +func (o *PackerServiceListChannelsOK) GetPayload() *models.HashicorpCloudPacker20220411ListChannelsResponse { + return o.Payload +} + +func (o *PackerServiceListChannelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411ListChannelsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceListChannelsDefault creates a PackerServiceListChannelsDefault with default headers values +func NewPackerServiceListChannelsDefault(code int) *PackerServiceListChannelsDefault { + return &PackerServiceListChannelsDefault{ + _statusCode: code, + } +} + +/*PackerServiceListChannelsDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceListChannelsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service list channels default response +func (o *PackerServiceListChannelsDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceListChannelsDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels][%d] PackerService_ListChannels default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceListChannelsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceListChannelsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_parameters.go new file mode 100644 index 00000000..69b41a7d --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_parameters.go @@ -0,0 +1,378 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPackerServiceListIterationsParams creates a new PackerServiceListIterationsParams object +// with the default values initialized. +func NewPackerServiceListIterationsParams() *PackerServiceListIterationsParams { + var () + return &PackerServiceListIterationsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceListIterationsParamsWithTimeout creates a new PackerServiceListIterationsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceListIterationsParamsWithTimeout(timeout time.Duration) *PackerServiceListIterationsParams { + var () + return &PackerServiceListIterationsParams{ + + timeout: timeout, + } +} + +// NewPackerServiceListIterationsParamsWithContext creates a new PackerServiceListIterationsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceListIterationsParamsWithContext(ctx context.Context) *PackerServiceListIterationsParams { + var () + return &PackerServiceListIterationsParams{ + + Context: ctx, + } +} + +// NewPackerServiceListIterationsParamsWithHTTPClient creates a new PackerServiceListIterationsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceListIterationsParamsWithHTTPClient(client *http.Client) *PackerServiceListIterationsParams { + var () + return &PackerServiceListIterationsParams{ + HTTPClient: client, + } +} + +/*PackerServiceListIterationsParams contains all the parameters to send to the API endpoint +for the packer service list iterations operation typically these are written to a http.Request +*/ +type PackerServiceListIterationsParams struct { + + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug 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 + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*SortingOrderBy + Specifies the list of per field ordering that should be used for sorting. + The order matters as rows are sorted in order by fields and when the field + matches, the next field is used to tie break the ordering. + The per field default ordering is ascending. + + The fields should be immutabile, unique, and orderable. If the field is + not unique, more than one sort fields should be passed. + + Example: oder_by=name,age desc,created_at asc + In that case, 'name' will get the default 'ascending' order. + + */ + SortingOrderBy []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithTimeout(timeout time.Duration) *PackerServiceListIterationsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithContext(ctx context.Context) *PackerServiceListIterationsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithHTTPClient(client *http.Client) *PackerServiceListIterationsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSlug adds the bucketSlug to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithBucketSlug(bucketSlug string) *PackerServiceListIterationsParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceListIterationsParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithLocationProjectID(locationProjectID string) *PackerServiceListIterationsParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithLocationRegionProvider(locationRegionProvider *string) *PackerServiceListIterationsParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithLocationRegionRegion(locationRegionRegion *string) *PackerServiceListIterationsParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *PackerServiceListIterationsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithPaginationPageSize(paginationPageSize *int64) *PackerServiceListIterationsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *PackerServiceListIterationsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithSortingOrderBy adds the sortingOrderBy to the packer service list iterations params +func (o *PackerServiceListIterationsParams) WithSortingOrderBy(sortingOrderBy []string) *PackerServiceListIterationsParams { + o.SetSortingOrderBy(sortingOrderBy) + return o +} + +// SetSortingOrderBy adds the sortingOrderBy to the packer service list iterations params +func (o *PackerServiceListIterationsParams) SetSortingOrderBy(sortingOrderBy []string) { + o.SortingOrderBy = sortingOrderBy +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceListIterationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + valuesSortingOrderBy := o.SortingOrderBy + + joinedSortingOrderBy := swag.JoinByFormat(valuesSortingOrderBy, "multi") + // query array param sorting.order_by + if err := r.SetQueryParam("sorting.order_by", joinedSortingOrderBy...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_responses.go new file mode 100644 index 00000000..1740677e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_list_iterations_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceListIterationsReader is a Reader for the PackerServiceListIterations structure. +type PackerServiceListIterationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceListIterationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceListIterationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceListIterationsDefault(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 + } +} + +// NewPackerServiceListIterationsOK creates a PackerServiceListIterationsOK with default headers values +func NewPackerServiceListIterationsOK() *PackerServiceListIterationsOK { + return &PackerServiceListIterationsOK{} +} + +/*PackerServiceListIterationsOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceListIterationsOK struct { + Payload *models.HashicorpCloudPacker20220411ListIterationsResponse +} + +func (o *PackerServiceListIterationsOK) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations][%d] packerServiceListIterationsOK %+v", 200, o.Payload) +} + +func (o *PackerServiceListIterationsOK) GetPayload() *models.HashicorpCloudPacker20220411ListIterationsResponse { + return o.Payload +} + +func (o *PackerServiceListIterationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411ListIterationsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceListIterationsDefault creates a PackerServiceListIterationsDefault with default headers values +func NewPackerServiceListIterationsDefault(code int) *PackerServiceListIterationsDefault { + return &PackerServiceListIterationsDefault{ + _statusCode: code, + } +} + +/*PackerServiceListIterationsDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceListIterationsDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service list iterations default response +func (o *PackerServiceListIterationsDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceListIterationsDefault) Error() string { + return fmt.Sprintf("[GET /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/iterations][%d] PackerService_ListIterations default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceListIterationsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceListIterationsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_parameters.go new file mode 100644 index 00000000..ce0f34e8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyParams creates a new PackerServiceRegenerateTFCRunTaskHmacKeyParams object +// with the default values initialized. +func NewPackerServiceRegenerateTFCRunTaskHmacKeyParams() *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + var () + return &PackerServiceRegenerateTFCRunTaskHmacKeyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithTimeout creates a new PackerServiceRegenerateTFCRunTaskHmacKeyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithTimeout(timeout time.Duration) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + var () + return &PackerServiceRegenerateTFCRunTaskHmacKeyParams{ + + timeout: timeout, + } +} + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithContext creates a new PackerServiceRegenerateTFCRunTaskHmacKeyParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithContext(ctx context.Context) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + var () + return &PackerServiceRegenerateTFCRunTaskHmacKeyParams{ + + Context: ctx, + } +} + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithHTTPClient creates a new PackerServiceRegenerateTFCRunTaskHmacKeyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceRegenerateTFCRunTaskHmacKeyParamsWithHTTPClient(client *http.Client) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + var () + return &PackerServiceRegenerateTFCRunTaskHmacKeyParams{ + HTTPClient: client, + } +} + +/*PackerServiceRegenerateTFCRunTaskHmacKeyParams contains all the parameters to send to the API endpoint +for the packer service regenerate t f c run task hmac key operation typically these are written to a http.Request +*/ +type PackerServiceRegenerateTFCRunTaskHmacKeyParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithTimeout(timeout time.Duration) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithContext(ctx context.Context) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithHTTPClient(client *http.Client) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithBody(body *models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetBody(body *models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) { + o.Body = body +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WithLocationProjectID(locationProjectID string) *PackerServiceRegenerateTFCRunTaskHmacKeyParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service regenerate t f c run task hmac key params +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_responses.go new file mode 100644 index 00000000..fc716dd6 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_regenerate_t_f_c_run_task_hmac_key_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceRegenerateTFCRunTaskHmacKeyReader is a Reader for the PackerServiceRegenerateTFCRunTaskHmacKey structure. +type PackerServiceRegenerateTFCRunTaskHmacKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceRegenerateTFCRunTaskHmacKeyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceRegenerateTFCRunTaskHmacKeyDefault(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 + } +} + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyOK creates a PackerServiceRegenerateTFCRunTaskHmacKeyOK with default headers values +func NewPackerServiceRegenerateTFCRunTaskHmacKeyOK() *PackerServiceRegenerateTFCRunTaskHmacKeyOK { + return &PackerServiceRegenerateTFCRunTaskHmacKeyOK{} +} + +/*PackerServiceRegenerateTFCRunTaskHmacKeyOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceRegenerateTFCRunTaskHmacKeyOK struct { + Payload *models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/hmac][%d] packerServiceRegenerateTFCRunTaskHmacKeyOK %+v", 200, o.Payload) +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyOK) GetPayload() *models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse { + return o.Payload +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceRegenerateTFCRunTaskHmacKeyDefault creates a PackerServiceRegenerateTFCRunTaskHmacKeyDefault with default headers values +func NewPackerServiceRegenerateTFCRunTaskHmacKeyDefault(code int) *PackerServiceRegenerateTFCRunTaskHmacKeyDefault { + return &PackerServiceRegenerateTFCRunTaskHmacKeyDefault{ + _statusCode: code, + } +} + +/*PackerServiceRegenerateTFCRunTaskHmacKeyDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceRegenerateTFCRunTaskHmacKeyDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service regenerate t f c run task hmac key default response +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/runtasks/hmac][%d] PackerService_RegenerateTFCRunTaskHmacKey default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceRegenerateTFCRunTaskHmacKeyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_parameters.go new file mode 100644 index 00000000..193d6d9a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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" +) + +// NewPackerServiceTFCImageValidationRunTaskParams creates a new PackerServiceTFCImageValidationRunTaskParams object +// with the default values initialized. +func NewPackerServiceTFCImageValidationRunTaskParams() *PackerServiceTFCImageValidationRunTaskParams { + var () + return &PackerServiceTFCImageValidationRunTaskParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceTFCImageValidationRunTaskParamsWithTimeout creates a new PackerServiceTFCImageValidationRunTaskParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceTFCImageValidationRunTaskParamsWithTimeout(timeout time.Duration) *PackerServiceTFCImageValidationRunTaskParams { + var () + return &PackerServiceTFCImageValidationRunTaskParams{ + + timeout: timeout, + } +} + +// NewPackerServiceTFCImageValidationRunTaskParamsWithContext creates a new PackerServiceTFCImageValidationRunTaskParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceTFCImageValidationRunTaskParamsWithContext(ctx context.Context) *PackerServiceTFCImageValidationRunTaskParams { + var () + return &PackerServiceTFCImageValidationRunTaskParams{ + + Context: ctx, + } +} + +// NewPackerServiceTFCImageValidationRunTaskParamsWithHTTPClient creates a new PackerServiceTFCImageValidationRunTaskParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceTFCImageValidationRunTaskParamsWithHTTPClient(client *http.Client) *PackerServiceTFCImageValidationRunTaskParams { + var () + return &PackerServiceTFCImageValidationRunTaskParams{ + HTTPClient: client, + } +} + +/*PackerServiceTFCImageValidationRunTaskParams contains all the parameters to send to the API endpoint +for the packer service t f c image validation run task operation typically these are written to a http.Request +*/ +type PackerServiceTFCImageValidationRunTaskParams struct { + + /*APIID + UUID of the HCP Packer registry run task API. + + */ + APIID string + /*Body + The bytes for the JSON payload sent by Terraform Cloud when calling this run task. + + */ + Body strfmt.Base64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) WithTimeout(timeout time.Duration) *PackerServiceTFCImageValidationRunTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) WithContext(ctx context.Context) *PackerServiceTFCImageValidationRunTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) WithHTTPClient(client *http.Client) *PackerServiceTFCImageValidationRunTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAPIID adds the aPIID to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) WithAPIID(aPIID string) *PackerServiceTFCImageValidationRunTaskParams { + o.SetAPIID(aPIID) + return o +} + +// SetAPIID adds the apiId to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) SetAPIID(aPIID string) { + o.APIID = aPIID +} + +// WithBody adds the body to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) WithBody(body strfmt.Base64) *PackerServiceTFCImageValidationRunTaskParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service t f c image validation run task params +func (o *PackerServiceTFCImageValidationRunTaskParams) SetBody(body strfmt.Base64) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceTFCImageValidationRunTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param api_id + if err := r.SetPathParam("api_id", o.APIID); err != nil { + return err + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_responses.go new file mode 100644 index 00000000..e0c6602a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_t_f_c_image_validation_run_task_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceTFCImageValidationRunTaskReader is a Reader for the PackerServiceTFCImageValidationRunTask structure. +type PackerServiceTFCImageValidationRunTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceTFCImageValidationRunTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceTFCImageValidationRunTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceTFCImageValidationRunTaskDefault(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 + } +} + +// NewPackerServiceTFCImageValidationRunTaskOK creates a PackerServiceTFCImageValidationRunTaskOK with default headers values +func NewPackerServiceTFCImageValidationRunTaskOK() *PackerServiceTFCImageValidationRunTaskOK { + return &PackerServiceTFCImageValidationRunTaskOK{} +} + +/*PackerServiceTFCImageValidationRunTaskOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceTFCImageValidationRunTaskOK struct { + Payload models.HashicorpCloudPacker20220411TFCImageValidationRunTaskResponse +} + +func (o *PackerServiceTFCImageValidationRunTaskOK) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/terraform-cloud/validation/{api_id}][%d] packerServiceTFCImageValidationRunTaskOK %+v", 200, o.Payload) +} + +func (o *PackerServiceTFCImageValidationRunTaskOK) GetPayload() models.HashicorpCloudPacker20220411TFCImageValidationRunTaskResponse { + return o.Payload +} + +func (o *PackerServiceTFCImageValidationRunTaskOK) 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 +} + +// NewPackerServiceTFCImageValidationRunTaskDefault creates a PackerServiceTFCImageValidationRunTaskDefault with default headers values +func NewPackerServiceTFCImageValidationRunTaskDefault(code int) *PackerServiceTFCImageValidationRunTaskDefault { + return &PackerServiceTFCImageValidationRunTaskDefault{ + _statusCode: code, + } +} + +/*PackerServiceTFCImageValidationRunTaskDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceTFCImageValidationRunTaskDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service t f c image validation run task default response +func (o *PackerServiceTFCImageValidationRunTaskDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceTFCImageValidationRunTaskDefault) Error() string { + return fmt.Sprintf("[POST /packer/2022-04-11/terraform-cloud/validation/{api_id}][%d] PackerService_TFCImageValidationRunTask default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceTFCImageValidationRunTaskDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceTFCImageValidationRunTaskDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_parameters.go new file mode 100644 index 00000000..531ee32a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceUpdateBucketParams creates a new PackerServiceUpdateBucketParams object +// with the default values initialized. +func NewPackerServiceUpdateBucketParams() *PackerServiceUpdateBucketParams { + var () + return &PackerServiceUpdateBucketParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceUpdateBucketParamsWithTimeout creates a new PackerServiceUpdateBucketParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceUpdateBucketParamsWithTimeout(timeout time.Duration) *PackerServiceUpdateBucketParams { + var () + return &PackerServiceUpdateBucketParams{ + + timeout: timeout, + } +} + +// NewPackerServiceUpdateBucketParamsWithContext creates a new PackerServiceUpdateBucketParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceUpdateBucketParamsWithContext(ctx context.Context) *PackerServiceUpdateBucketParams { + var () + return &PackerServiceUpdateBucketParams{ + + Context: ctx, + } +} + +// NewPackerServiceUpdateBucketParamsWithHTTPClient creates a new PackerServiceUpdateBucketParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceUpdateBucketParamsWithHTTPClient(client *http.Client) *PackerServiceUpdateBucketParams { + var () + return &PackerServiceUpdateBucketParams{ + HTTPClient: client, + } +} + +/*PackerServiceUpdateBucketParams contains all the parameters to send to the API endpoint +for the packer service update bucket operation typically these are written to a http.Request +*/ +type PackerServiceUpdateBucketParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411UpdateBucketRequest + /*BucketSlug + Human-readable name for the bucket. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithTimeout(timeout time.Duration) *PackerServiceUpdateBucketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithContext(ctx context.Context) *PackerServiceUpdateBucketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithHTTPClient(client *http.Client) *PackerServiceUpdateBucketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithBody(body *models.HashicorpCloudPacker20220411UpdateBucketRequest) *PackerServiceUpdateBucketParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetBody(body *models.HashicorpCloudPacker20220411UpdateBucketRequest) { + o.Body = body +} + +// WithBucketSlug adds the bucketSlug to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithBucketSlug(bucketSlug string) *PackerServiceUpdateBucketParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceUpdateBucketParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) WithLocationProjectID(locationProjectID string) *PackerServiceUpdateBucketParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service update bucket params +func (o *PackerServiceUpdateBucketParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceUpdateBucketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_responses.go new file mode 100644 index 00000000..517823e3 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_bucket_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceUpdateBucketReader is a Reader for the PackerServiceUpdateBucket structure. +type PackerServiceUpdateBucketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceUpdateBucketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceUpdateBucketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceUpdateBucketDefault(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 + } +} + +// NewPackerServiceUpdateBucketOK creates a PackerServiceUpdateBucketOK with default headers values +func NewPackerServiceUpdateBucketOK() *PackerServiceUpdateBucketOK { + return &PackerServiceUpdateBucketOK{} +} + +/*PackerServiceUpdateBucketOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceUpdateBucketOK struct { + Payload *models.HashicorpCloudPacker20220411UpdateBucketResponse +} + +func (o *PackerServiceUpdateBucketOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] packerServiceUpdateBucketOK %+v", 200, o.Payload) +} + +func (o *PackerServiceUpdateBucketOK) GetPayload() *models.HashicorpCloudPacker20220411UpdateBucketResponse { + return o.Payload +} + +func (o *PackerServiceUpdateBucketOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411UpdateBucketResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceUpdateBucketDefault creates a PackerServiceUpdateBucketDefault with default headers values +func NewPackerServiceUpdateBucketDefault(code int) *PackerServiceUpdateBucketDefault { + return &PackerServiceUpdateBucketDefault{ + _statusCode: code, + } +} + +/*PackerServiceUpdateBucketDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceUpdateBucketDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service update bucket default response +func (o *PackerServiceUpdateBucketDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceUpdateBucketDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}][%d] PackerService_UpdateBucket default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceUpdateBucketDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceUpdateBucketDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_parameters.go new file mode 100644 index 00000000..f42279e8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceUpdateBuildParams creates a new PackerServiceUpdateBuildParams object +// with the default values initialized. +func NewPackerServiceUpdateBuildParams() *PackerServiceUpdateBuildParams { + var () + return &PackerServiceUpdateBuildParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceUpdateBuildParamsWithTimeout creates a new PackerServiceUpdateBuildParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceUpdateBuildParamsWithTimeout(timeout time.Duration) *PackerServiceUpdateBuildParams { + var () + return &PackerServiceUpdateBuildParams{ + + timeout: timeout, + } +} + +// NewPackerServiceUpdateBuildParamsWithContext creates a new PackerServiceUpdateBuildParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceUpdateBuildParamsWithContext(ctx context.Context) *PackerServiceUpdateBuildParams { + var () + return &PackerServiceUpdateBuildParams{ + + Context: ctx, + } +} + +// NewPackerServiceUpdateBuildParamsWithHTTPClient creates a new PackerServiceUpdateBuildParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceUpdateBuildParamsWithHTTPClient(client *http.Client) *PackerServiceUpdateBuildParams { + var () + return &PackerServiceUpdateBuildParams{ + HTTPClient: client, + } +} + +/*PackerServiceUpdateBuildParams contains all the parameters to send to the API endpoint +for the packer service update build operation typically these are written to a http.Request +*/ +type PackerServiceUpdateBuildParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411UpdateBuildRequest + /*BuildID + ULID of the build that should be updated. + + */ + BuildID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithTimeout(timeout time.Duration) *PackerServiceUpdateBuildParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithContext(ctx context.Context) *PackerServiceUpdateBuildParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithHTTPClient(client *http.Client) *PackerServiceUpdateBuildParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithBody(body *models.HashicorpCloudPacker20220411UpdateBuildRequest) *PackerServiceUpdateBuildParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetBody(body *models.HashicorpCloudPacker20220411UpdateBuildRequest) { + o.Body = body +} + +// WithBuildID adds the buildID to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithBuildID(buildID string) *PackerServiceUpdateBuildParams { + o.SetBuildID(buildID) + return o +} + +// SetBuildID adds the buildId to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetBuildID(buildID string) { + o.BuildID = buildID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceUpdateBuildParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service update build params +func (o *PackerServiceUpdateBuildParams) WithLocationProjectID(locationProjectID string) *PackerServiceUpdateBuildParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service update build params +func (o *PackerServiceUpdateBuildParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceUpdateBuildParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param build_id + if err := r.SetPathParam("build_id", o.BuildID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_responses.go new file mode 100644 index 00000000..27b4e692 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_build_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceUpdateBuildReader is a Reader for the PackerServiceUpdateBuild structure. +type PackerServiceUpdateBuildReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceUpdateBuildReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceUpdateBuildOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceUpdateBuildDefault(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 + } +} + +// NewPackerServiceUpdateBuildOK creates a PackerServiceUpdateBuildOK with default headers values +func NewPackerServiceUpdateBuildOK() *PackerServiceUpdateBuildOK { + return &PackerServiceUpdateBuildOK{} +} + +/*PackerServiceUpdateBuildOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceUpdateBuildOK struct { + Payload *models.HashicorpCloudPacker20220411UpdateBuildResponse +} + +func (o *PackerServiceUpdateBuildOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] packerServiceUpdateBuildOK %+v", 200, o.Payload) +} + +func (o *PackerServiceUpdateBuildOK) GetPayload() *models.HashicorpCloudPacker20220411UpdateBuildResponse { + return o.Payload +} + +func (o *PackerServiceUpdateBuildOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411UpdateBuildResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceUpdateBuildDefault creates a PackerServiceUpdateBuildDefault with default headers values +func NewPackerServiceUpdateBuildDefault(code int) *PackerServiceUpdateBuildDefault { + return &PackerServiceUpdateBuildDefault{ + _statusCode: code, + } +} + +/*PackerServiceUpdateBuildDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceUpdateBuildDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service update build default response +func (o *PackerServiceUpdateBuildDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceUpdateBuildDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][%d] PackerService_UpdateBuild default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceUpdateBuildDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceUpdateBuildDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_parameters.go new file mode 100644 index 00000000..b7dc993f --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceUpdateChannelParams creates a new PackerServiceUpdateChannelParams object +// with the default values initialized. +func NewPackerServiceUpdateChannelParams() *PackerServiceUpdateChannelParams { + var () + return &PackerServiceUpdateChannelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceUpdateChannelParamsWithTimeout creates a new PackerServiceUpdateChannelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceUpdateChannelParamsWithTimeout(timeout time.Duration) *PackerServiceUpdateChannelParams { + var () + return &PackerServiceUpdateChannelParams{ + + timeout: timeout, + } +} + +// NewPackerServiceUpdateChannelParamsWithContext creates a new PackerServiceUpdateChannelParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceUpdateChannelParamsWithContext(ctx context.Context) *PackerServiceUpdateChannelParams { + var () + return &PackerServiceUpdateChannelParams{ + + Context: ctx, + } +} + +// NewPackerServiceUpdateChannelParamsWithHTTPClient creates a new PackerServiceUpdateChannelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceUpdateChannelParamsWithHTTPClient(client *http.Client) *PackerServiceUpdateChannelParams { + var () + return &PackerServiceUpdateChannelParams{ + HTTPClient: client, + } +} + +/*PackerServiceUpdateChannelParams contains all the parameters to send to the API endpoint +for the packer service update channel operation typically these are written to a http.Request +*/ +type PackerServiceUpdateChannelParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411UpdateChannelRequest + /*BucketSlug + Human-readable name for the bucket that the channel is associated with. + + */ + BucketSlug string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + /*Slug + Human-readable name for the channel. + + */ + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithTimeout(timeout time.Duration) *PackerServiceUpdateChannelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithContext(ctx context.Context) *PackerServiceUpdateChannelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithHTTPClient(client *http.Client) *PackerServiceUpdateChannelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithBody(body *models.HashicorpCloudPacker20220411UpdateChannelRequest) *PackerServiceUpdateChannelParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetBody(body *models.HashicorpCloudPacker20220411UpdateChannelRequest) { + o.Body = body +} + +// WithBucketSlug adds the bucketSlug to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithBucketSlug(bucketSlug string) *PackerServiceUpdateChannelParams { + o.SetBucketSlug(bucketSlug) + return o +} + +// SetBucketSlug adds the bucketSlug to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetBucketSlug(bucketSlug string) { + o.BucketSlug = bucketSlug +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceUpdateChannelParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithLocationProjectID(locationProjectID string) *PackerServiceUpdateChannelParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WithSlug adds the slug to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) WithSlug(slug string) *PackerServiceUpdateChannelParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the packer service update channel params +func (o *PackerServiceUpdateChannelParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceUpdateChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param bucket_slug + if err := r.SetPathParam("bucket_slug", o.BucketSlug); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_responses.go new file mode 100644 index 00000000..4cc83281 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_channel_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceUpdateChannelReader is a Reader for the PackerServiceUpdateChannel structure. +type PackerServiceUpdateChannelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceUpdateChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceUpdateChannelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceUpdateChannelDefault(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 + } +} + +// NewPackerServiceUpdateChannelOK creates a PackerServiceUpdateChannelOK with default headers values +func NewPackerServiceUpdateChannelOK() *PackerServiceUpdateChannelOK { + return &PackerServiceUpdateChannelOK{} +} + +/*PackerServiceUpdateChannelOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceUpdateChannelOK struct { + Payload *models.HashicorpCloudPacker20220411UpdateChannelResponse +} + +func (o *PackerServiceUpdateChannelOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] packerServiceUpdateChannelOK %+v", 200, o.Payload) +} + +func (o *PackerServiceUpdateChannelOK) GetPayload() *models.HashicorpCloudPacker20220411UpdateChannelResponse { + return o.Payload +} + +func (o *PackerServiceUpdateChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411UpdateChannelResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceUpdateChannelDefault creates a PackerServiceUpdateChannelDefault with default headers values +func NewPackerServiceUpdateChannelDefault(code int) *PackerServiceUpdateChannelDefault { + return &PackerServiceUpdateChannelDefault{ + _statusCode: code, + } +} + +/*PackerServiceUpdateChannelDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceUpdateChannelDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service update channel default response +func (o *PackerServiceUpdateChannelDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceUpdateChannelDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels/{slug}][%d] PackerService_UpdateChannel default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceUpdateChannelDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceUpdateChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_parameters.go new file mode 100644 index 00000000..9d9672b8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceUpdateIterationParams creates a new PackerServiceUpdateIterationParams object +// with the default values initialized. +func NewPackerServiceUpdateIterationParams() *PackerServiceUpdateIterationParams { + var () + return &PackerServiceUpdateIterationParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceUpdateIterationParamsWithTimeout creates a new PackerServiceUpdateIterationParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceUpdateIterationParamsWithTimeout(timeout time.Duration) *PackerServiceUpdateIterationParams { + var () + return &PackerServiceUpdateIterationParams{ + + timeout: timeout, + } +} + +// NewPackerServiceUpdateIterationParamsWithContext creates a new PackerServiceUpdateIterationParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceUpdateIterationParamsWithContext(ctx context.Context) *PackerServiceUpdateIterationParams { + var () + return &PackerServiceUpdateIterationParams{ + + Context: ctx, + } +} + +// NewPackerServiceUpdateIterationParamsWithHTTPClient creates a new PackerServiceUpdateIterationParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceUpdateIterationParamsWithHTTPClient(client *http.Client) *PackerServiceUpdateIterationParams { + var () + return &PackerServiceUpdateIterationParams{ + HTTPClient: client, + } +} + +/*PackerServiceUpdateIterationParams contains all the parameters to send to the API endpoint +for the packer service update iteration operation typically these are written to a http.Request +*/ +type PackerServiceUpdateIterationParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411UpdateIterationRequest + /*IterationID + ULID of the iteration. + + */ + IterationID string + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithTimeout(timeout time.Duration) *PackerServiceUpdateIterationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithContext(ctx context.Context) *PackerServiceUpdateIterationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithHTTPClient(client *http.Client) *PackerServiceUpdateIterationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithBody(body *models.HashicorpCloudPacker20220411UpdateIterationRequest) *PackerServiceUpdateIterationParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetBody(body *models.HashicorpCloudPacker20220411UpdateIterationRequest) { + o.Body = body +} + +// WithIterationID adds the iterationID to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithIterationID(iterationID string) *PackerServiceUpdateIterationParams { + o.SetIterationID(iterationID) + return o +} + +// SetIterationID adds the iterationId to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetIterationID(iterationID string) { + o.IterationID = iterationID +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceUpdateIterationParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) WithLocationProjectID(locationProjectID string) *PackerServiceUpdateIterationParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service update iteration params +func (o *PackerServiceUpdateIterationParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceUpdateIterationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param iteration_id + if err := r.SetPathParam("iteration_id", o.IterationID); err != nil { + return err + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_responses.go new file mode 100644 index 00000000..3954c8a3 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_iteration_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceUpdateIterationReader is a Reader for the PackerServiceUpdateIteration structure. +type PackerServiceUpdateIterationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceUpdateIterationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceUpdateIterationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceUpdateIterationDefault(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 + } +} + +// NewPackerServiceUpdateIterationOK creates a PackerServiceUpdateIterationOK with default headers values +func NewPackerServiceUpdateIterationOK() *PackerServiceUpdateIterationOK { + return &PackerServiceUpdateIterationOK{} +} + +/*PackerServiceUpdateIterationOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceUpdateIterationOK struct { + Payload *models.HashicorpCloudPacker20220411UpdateIterationResponse +} + +func (o *PackerServiceUpdateIterationOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}][%d] packerServiceUpdateIterationOK %+v", 200, o.Payload) +} + +func (o *PackerServiceUpdateIterationOK) GetPayload() *models.HashicorpCloudPacker20220411UpdateIterationResponse { + return o.Payload +} + +func (o *PackerServiceUpdateIterationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411UpdateIterationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceUpdateIterationDefault creates a PackerServiceUpdateIterationDefault with default headers values +func NewPackerServiceUpdateIterationDefault(code int) *PackerServiceUpdateIterationDefault { + return &PackerServiceUpdateIterationDefault{ + _statusCode: code, + } +} + +/*PackerServiceUpdateIterationDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceUpdateIterationDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service update iteration default response +func (o *PackerServiceUpdateIterationDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceUpdateIterationDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/iterations/{iteration_id}][%d] PackerService_UpdateIteration default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceUpdateIterationDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceUpdateIterationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_parameters.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_parameters.go new file mode 100644 index 00000000..54407a5c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2022-04-11/models" +) + +// NewPackerServiceUpdateRegistryParams creates a new PackerServiceUpdateRegistryParams object +// with the default values initialized. +func NewPackerServiceUpdateRegistryParams() *PackerServiceUpdateRegistryParams { + var () + return &PackerServiceUpdateRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPackerServiceUpdateRegistryParamsWithTimeout creates a new PackerServiceUpdateRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPackerServiceUpdateRegistryParamsWithTimeout(timeout time.Duration) *PackerServiceUpdateRegistryParams { + var () + return &PackerServiceUpdateRegistryParams{ + + timeout: timeout, + } +} + +// NewPackerServiceUpdateRegistryParamsWithContext creates a new PackerServiceUpdateRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewPackerServiceUpdateRegistryParamsWithContext(ctx context.Context) *PackerServiceUpdateRegistryParams { + var () + return &PackerServiceUpdateRegistryParams{ + + Context: ctx, + } +} + +// NewPackerServiceUpdateRegistryParamsWithHTTPClient creates a new PackerServiceUpdateRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPackerServiceUpdateRegistryParamsWithHTTPClient(client *http.Client) *PackerServiceUpdateRegistryParams { + var () + return &PackerServiceUpdateRegistryParams{ + HTTPClient: client, + } +} + +/*PackerServiceUpdateRegistryParams contains all the parameters to send to the API endpoint +for the packer service update registry operation typically these are written to a http.Request +*/ +type PackerServiceUpdateRegistryParams struct { + + /*Body*/ + Body *models.HashicorpCloudPacker20220411UpdateRegistryRequest + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithTimeout(timeout time.Duration) *PackerServiceUpdateRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithContext(ctx context.Context) *PackerServiceUpdateRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithHTTPClient(client *http.Client) *PackerServiceUpdateRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithBody(body *models.HashicorpCloudPacker20220411UpdateRegistryRequest) *PackerServiceUpdateRegistryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetBody(body *models.HashicorpCloudPacker20220411UpdateRegistryRequest) { + o.Body = body +} + +// WithLocationOrganizationID adds the locationOrganizationID to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithLocationOrganizationID(locationOrganizationID string) *PackerServiceUpdateRegistryParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetLocationOrganizationID(locationOrganizationID string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) WithLocationProjectID(locationProjectID string) *PackerServiceUpdateRegistryParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the packer service update registry params +func (o *PackerServiceUpdateRegistryParams) SetLocationProjectID(locationProjectID string) { + o.LocationProjectID = locationProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *PackerServiceUpdateRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param location.organization_id + if err := r.SetPathParam("location.organization_id", o.LocationOrganizationID); err != nil { + return err + } + + // path param location.project_id + if err := r.SetPathParam("location.project_id", o.LocationProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_responses.go b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_responses.go new file mode 100644 index 00000000..c1ebad2c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/client/packer_service/packer_service_update_registry_responses.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package packer_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-packer-service/preview/2022-04-11/models" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// PackerServiceUpdateRegistryReader is a Reader for the PackerServiceUpdateRegistry structure. +type PackerServiceUpdateRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PackerServiceUpdateRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPackerServiceUpdateRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPackerServiceUpdateRegistryDefault(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 + } +} + +// NewPackerServiceUpdateRegistryOK creates a PackerServiceUpdateRegistryOK with default headers values +func NewPackerServiceUpdateRegistryOK() *PackerServiceUpdateRegistryOK { + return &PackerServiceUpdateRegistryOK{} +} + +/*PackerServiceUpdateRegistryOK handles this case with default header values. + +A successful response. +*/ +type PackerServiceUpdateRegistryOK struct { + Payload *models.HashicorpCloudPacker20220411UpdateRegistryResponse +} + +func (o *PackerServiceUpdateRegistryOK) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] packerServiceUpdateRegistryOK %+v", 200, o.Payload) +} + +func (o *PackerServiceUpdateRegistryOK) GetPayload() *models.HashicorpCloudPacker20220411UpdateRegistryResponse { + return o.Payload +} + +func (o *PackerServiceUpdateRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudPacker20220411UpdateRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPackerServiceUpdateRegistryDefault creates a PackerServiceUpdateRegistryDefault with default headers values +func NewPackerServiceUpdateRegistryDefault(code int) *PackerServiceUpdateRegistryDefault { + return &PackerServiceUpdateRegistryDefault{ + _statusCode: code, + } +} + +/*PackerServiceUpdateRegistryDefault handles this case with default header values. + +An unexpected error response. +*/ +type PackerServiceUpdateRegistryDefault struct { + _statusCode int + + Payload *cloud.GrpcGatewayRuntimeError +} + +// Code gets the status code for the packer service update registry default response +func (o *PackerServiceUpdateRegistryDefault) Code() int { + return o._statusCode +} + +func (o *PackerServiceUpdateRegistryDefault) Error() string { + return fmt.Sprintf("[PATCH /packer/2022-04-11/organizations/{location.organization_id}/projects/{location.project_id}/registry][%d] PackerService_UpdateRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *PackerServiceUpdateRegistryDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { + return o.Payload +} + +func (o *PackerServiceUpdateRegistryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud.GrpcGatewayRuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket.go new file mode 100644 index 00000000..b0cfb6ba --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411Bucket hashicorp cloud packer 20220411 bucket +// +// swagger:model hashicorp.cloud.packer_20220411.Bucket +type HashicorpCloudPacker20220411Bucket struct { + + // The information about this bucket's children. Children are the image buckets that used any iteration of this bucket + // as the base image of their latest complete iteration. + Children *HashicorpCloudPacker20220411BucketChildren `json:"children,omitempty"` + + // When the bucket was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // A short description of what this bucket's images are for. + Description string `json:"description,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the bucket. + ID string `json:"id,omitempty"` + + // The total number of iterations in this bucket. + IterationCount string `json:"iteration_count,omitempty"` + + // A key:value map for custom, user-settable metadata about your bucket. + Labels map[string]string `json:"labels,omitempty"` + + // The bucket's most recent iteration. This iteration may be complete or not. + LatestIteration *HashicorpCloudPacker20220411BucketLatestIteration `json:"latest_iteration,omitempty"` + + // The human-readable version of the most recent completed iteration in this bucket. + LatestVersion int32 `json:"latest_version,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // The information about this bucket's parents. Parents are the base images used to build the latest complete iteration + // of this bucket. + Parents *HashicorpCloudPacker20220411BucketParents `json:"parents,omitempty"` + + // A list of the cloud providers or other platforms that are included in the latest complete iteration. e.g aws, gcp, or azure. + Platforms []string `json:"platforms"` + + // Human-readable name for the bucket. + Slug string `json:"slug,omitempty"` + + // When the bucket was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket +func (m *HashicorpCloudPacker20220411Bucket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChildren(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLatestIteration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateChildren(formats strfmt.Registry) error { + + if swag.IsZero(m.Children) { // not required + return nil + } + + if m.Children != nil { + if err := m.Children.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("children") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateLatestIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.LatestIteration) { // not required + return nil + } + + if m.LatestIteration != nil { + if err := m.LatestIteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("latest_iteration") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateParents(formats strfmt.Registry) error { + + if swag.IsZero(m.Parents) { // not required + return nil + } + + if m.Parents != nil { + if err := m.Parents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parents") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Bucket) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Bucket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Bucket) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Bucket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry.go new file mode 100644 index 00000000..d802edbc --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketAncestry The ancestral relation between two buckets composed by a parent and a +// child. +// +// swagger:model hashicorp.cloud.packer_20220411.BucketAncestry +type HashicorpCloudPacker20220411BucketAncestry struct { + + // The child bucket and the iteration that relates to the parent. + Child *HashicorpCloudPacker20220411BucketAncestryChild `json:"child,omitempty"` + + // The parent bucket and the iteration that relates to the child. + Parent *HashicorpCloudPacker20220411BucketAncestryParent `json:"parent,omitempty"` + + // The status of the relation between the parent and child buckets. + Status HashicorpCloudPacker20220411BucketAncestryStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket ancestry +func (m *HashicorpCloudPacker20220411BucketAncestry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChild(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(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 *HashicorpCloudPacker20220411BucketAncestry) validateChild(formats strfmt.Registry) error { + + if swag.IsZero(m.Child) { // not required + return nil + } + + if m.Child != nil { + if err := m.Child.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("child") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketAncestry) validateParent(formats strfmt.Registry) error { + + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketAncestry) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestry) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketAncestry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_child.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_child.go new file mode 100644 index 00000000..bd84059c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_child.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketAncestryChild hashicorp cloud packer 20220411 bucket ancestry child +// +// swagger:model hashicorp.cloud.packer_20220411.BucketAncestry.Child +type HashicorpCloudPacker20220411BucketAncestryChild struct { + + // The child bucket slug. + BucketSlug string `json:"bucket_slug,omitempty"` + + // The child iteration fingerprint. + IterationFingerprint string `json:"iteration_fingerprint,omitempty"` + + // The child iteration ULID. + IterationID string `json:"iteration_id,omitempty"` + + // The child iteration incremental version. + IterationIncrementalVersion int32 `json:"iteration_incremental_version,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket ancestry child +func (m *HashicorpCloudPacker20220411BucketAncestryChild) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryChild) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryChild) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketAncestryChild + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent.go new file mode 100644 index 00000000..f28b1788 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent.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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketAncestryParent hashicorp cloud packer 20220411 bucket ancestry parent +// +// swagger:model hashicorp.cloud.packer_20220411.BucketAncestry.Parent +type HashicorpCloudPacker20220411BucketAncestryParent struct { + + // The parent bucket slug. + BucketSlug string `json:"bucket_slug,omitempty"` + + // The channel associated with this relationship. + Channel string `json:"channel,omitempty"` + + // The iteration that is currently assigned to the channel associated + // with this relationship. + ChannelIteration *HashicorpCloudPacker20220411BucketAncestryParentChannelIteration `json:"channel_iteration,omitempty"` + + // The parent iteration fingerprint. + IterationFingerprint string `json:"iteration_fingerprint,omitempty"` + + // The parent iteration ULID. + IterationID string `json:"iteration_id,omitempty"` + + // The parent iteration incremental version. + IterationIncrementalVersion int32 `json:"iteration_incremental_version,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket ancestry parent +func (m *HashicorpCloudPacker20220411BucketAncestryParent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelIteration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411BucketAncestryParent) validateChannelIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.ChannelIteration) { // not required + return nil + } + + if m.ChannelIteration != nil { + if err := m.ChannelIteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel_iteration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryParent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryParent) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketAncestryParent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent_channel_iteration.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent_channel_iteration.go new file mode 100644 index 00000000..b8802ed6 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_parent_channel_iteration.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketAncestryParentChannelIteration hashicorp cloud packer 20220411 bucket ancestry parent channel iteration +// +// swagger:model hashicorp.cloud.packer_20220411.BucketAncestry.Parent.ChannelIteration +type HashicorpCloudPacker20220411BucketAncestryParentChannelIteration struct { + + // The assigned iteration fingerprint. + Fingerprint string `json:"fingerprint,omitempty"` + + // The assigned iteration ULID. + ID string `json:"id,omitempty"` + + // The assigned iteration incremental version. + IncrementalVersion int32 `json:"incremental_version,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket ancestry parent channel iteration +func (m *HashicorpCloudPacker20220411BucketAncestryParentChannelIteration) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryParentChannelIteration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketAncestryParentChannelIteration) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketAncestryParentChannelIteration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_status.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_status.go new file mode 100644 index 00000000..9c4a83ed --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_ancestry_status.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411BucketAncestryStatus - UNDETERMINED: Status cannot be determined because either a channel wasn't used when +// building the child iteration, the configured channel no longer exists +// in the parent bucket, or the parent is not tracked by HCP Packer. +// - UP_TO_DATE: The child iteration is built from the iteration that is currently +// assigned to the channel that is used in its configuration. +// - OUT_OF_DATE: The child iteration is built from an iteration that is different from +// the one currently assigned to the channel +// that is used in its configuration. +// +// swagger:model hashicorp.cloud.packer_20220411.BucketAncestry.Status +type HashicorpCloudPacker20220411BucketAncestryStatus string + +const ( + + // HashicorpCloudPacker20220411BucketAncestryStatusUNDETERMINED captures enum value "UNDETERMINED" + HashicorpCloudPacker20220411BucketAncestryStatusUNDETERMINED HashicorpCloudPacker20220411BucketAncestryStatus = "UNDETERMINED" + + // HashicorpCloudPacker20220411BucketAncestryStatusUPTODATE captures enum value "UP_TO_DATE" + HashicorpCloudPacker20220411BucketAncestryStatusUPTODATE HashicorpCloudPacker20220411BucketAncestryStatus = "UP_TO_DATE" + + // HashicorpCloudPacker20220411BucketAncestryStatusOUTOFDATE captures enum value "OUT_OF_DATE" + HashicorpCloudPacker20220411BucketAncestryStatusOUTOFDATE HashicorpCloudPacker20220411BucketAncestryStatus = "OUT_OF_DATE" +) + +// for schema +var hashicorpCloudPacker20220411BucketAncestryStatusEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411BucketAncestryStatus + if err := json.Unmarshal([]byte(`["UNDETERMINED","UP_TO_DATE","OUT_OF_DATE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411BucketAncestryStatusEnum = append(hashicorpCloudPacker20220411BucketAncestryStatusEnum, v) + } +} + +func (m HashicorpCloudPacker20220411BucketAncestryStatus) validateHashicorpCloudPacker20220411BucketAncestryStatusEnum(path, location string, value HashicorpCloudPacker20220411BucketAncestryStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411BucketAncestryStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 bucket ancestry status +func (m HashicorpCloudPacker20220411BucketAncestryStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411BucketAncestryStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_children.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_children.go new file mode 100644 index 00000000..09b8b10f --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_children.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketChildren hashicorp cloud packer 20220411 bucket children +// +// swagger:model hashicorp.cloud.packer_20220411.BucketChildren +type HashicorpCloudPacker20220411BucketChildren struct { + + // The URL for the Bucket's descendants endpoint that takes to the next level of the ancestry tree listing all + // child buckets. + Href string `json:"href,omitempty"` + + // The children's overall status. If at least one children is out of date, the overall status will be 'OUT_OF_DATE'. + Status HashicorpCloudPacker20220411BucketAncestryStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket children +func (m *HashicorpCloudPacker20220411BucketChildren) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411BucketChildren) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketChildren) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketChildren) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketChildren + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_latest_iteration.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_latest_iteration.go new file mode 100644 index 00000000..69dcd0f7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_latest_iteration.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411BucketLatestIteration A simplified Iteration used in Bucket to represent a bucket's latest iteration. +// This iteration representation does not contain ancestry information to avoid repetition. +// +// swagger:model hashicorp.cloud.packer_20220411.BucketLatestIteration +type HashicorpCloudPacker20220411BucketLatestIteration struct { + + // The name of the person who created this iteration. + AuthorID string `json:"author_id,omitempty"` + + // Human-readable name for the bucket that this iteration is associated with. + BucketSlug string `json:"bucket_slug,omitempty"` + + // A list of all the builds associated with this iteration. + Builds []*HashicorpCloudPacker20220411LatestIterationBuild `json:"builds"` + + // If true, all builds associated with this iteration have successfully + // completed and uploaded metadata to the registry. When "complete" is true, + // This iteration is considered ready to use, and can have channels assigned + // to it. + Complete bool `json:"complete,omitempty"` + + // When the iteration was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the iteration. + ID string `json:"id,omitempty"` + + // The human-readable version number assigned to this iteration. This + // field will only be set if the iteration is "complete". + IncrementalVersion int32 `json:"incremental_version,omitempty"` + + // The unique identifier of the iteration that was used as a source + // for this iteration, if this iteration was built on a base layer. + // Deprecated: refer to 'parent' for source image information. + IterationAncestorID string `json:"iteration_ancestor_id,omitempty"` + + // Who revoked this iteration. For human authors (e.g. HCP Portal) this will be an email address. + // For machine authors using service principals, this is the customer-chosen name for this service principal. + RevocationAuthor string `json:"revocation_author,omitempty"` + + // The ancestor iteration from whom this iteration inherited the revocation state. + RevocationInheritedFrom *HashicorpCloudPacker20220411RevokedAncestor `json:"revocation_inherited_from,omitempty"` + + // A short explanation of why this iteration was revoked. + RevocationMessage string `json:"revocation_message,omitempty"` + + // Revocation type is 'manual' when self revoked or 'inherited' when inherited from a revoked ancestor. + RevocationType HashicorpCloudPacker20220411IterationRevocationType `json:"revocation_type,omitempty"` + + // Timestamp from when the iteration is revoked an no longer trusted to be secure. + // Format: date-time + RevokeAt strfmt.DateTime `json:"revoke_at,omitempty"` + + // When the iteration was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket latest iteration +func (m *HashicorpCloudPacker20220411BucketLatestIteration) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuilds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationInheritedFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevokeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateBuilds(formats strfmt.Registry) error { + + if swag.IsZero(m.Builds) { // not required + return nil + } + + for i := 0; i < len(m.Builds); i++ { + if swag.IsZero(m.Builds[i]) { // not required + continue + } + + if m.Builds[i] != nil { + if err := m.Builds[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("builds" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateRevocationInheritedFrom(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationInheritedFrom) { // not required + return nil + } + + if m.RevocationInheritedFrom != nil { + if err := m.RevocationInheritedFrom.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_inherited_from") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateRevocationType(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationType) { // not required + return nil + } + + if err := m.RevocationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_type") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateRevokeAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RevokeAt) { // not required + return nil + } + + if err := validate.FormatOf("revoke_at", "body", "date-time", m.RevokeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BucketLatestIteration) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketLatestIteration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketLatestIteration) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketLatestIteration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_parents.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_parents.go new file mode 100644 index 00000000..0894102b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_bucket_parents.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BucketParents hashicorp cloud packer 20220411 bucket parents +// +// swagger:model hashicorp.cloud.packer_20220411.BucketParents +type HashicorpCloudPacker20220411BucketParents struct { + + // The URL for the Bucket's ancestors endpoint that takes to the previous level of the ancestry tree listing all + // parent buckets. + Href string `json:"href,omitempty"` + + // The parents' overall status. If at least one parent is out of date, the overall status will be 'OUT_OF_DATE'. + Status HashicorpCloudPacker20220411BucketAncestryStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 bucket parents +func (m *HashicorpCloudPacker20220411BucketParents) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411BucketParents) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketParents) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BucketParents) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BucketParents + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build.go new file mode 100644 index 00000000..bd7f4968 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411Build hashicorp cloud packer 20220411 build +// +// swagger:model hashicorp.cloud.packer_20220411.Build +type HashicorpCloudPacker20220411Build struct { + + // The cloud provider that this build produced artifacts for. + // For example, AWS, GCP, or Azure. + CloudProvider string `json:"cloud_provider,omitempty"` + + // Internal Packer name for the builder or post-processor component used to + // build this. For example, "amazon-ebs" or "azure-arm". + ComponentType string `json:"component_type,omitempty"` + + // When the build was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the build. + ID string `json:"id,omitempty"` + + // List of images associated with this build. + Images []*HashicorpCloudPacker20220411Image `json:"images"` + + // Unique identifier of the iteration associated with this build; this was + // created and set by the HCP Packer registry when the iteration was created. + IterationID string `json:"iteration_id,omitempty"` + + // A key:value map for custom, user-settable metadata about your build. + Labels map[string]string `json:"labels,omitempty"` + + // The UUID specific to this call to Packer build. If you use the manifest + // post-processor, this UUID will match the UUID present there. + PackerRunUUID string `json:"packer_run_uuid,omitempty"` + + // The parent image used as source for this build. + Parent *HashicorpCloudPacker20220411ParentBuildStatus `json:"parent,omitempty"` + + // Unique identifier of the HCP Packer registry build used as the source + // for this build. Used for tracking dependencies for build pipelines. + SourceBuildUlid string `json:"source_build_ulid,omitempty"` + + // The ID or URL of the remote cloud source image. Used for tracking image + // dependencies for build pipelines. + SourceImageID string `json:"source_image_id,omitempty"` + + // Status of the build. The status can be RUNNING, DONE, CANCELLED, FAILED, + // or UNSET. + Status HashicorpCloudPacker20220411BuildStatus `json:"status,omitempty"` + + // When the build was most recently updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 build +func (m *HashicorpCloudPacker20220411Build) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Build) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Build) validateImages(formats strfmt.Registry) error { + + if swag.IsZero(m.Images) { // not required + return nil + } + + for i := 0; i < len(m.Images); i++ { + if swag.IsZero(m.Images[i]) { // not required + continue + } + + if m.Images[i] != nil { + if err := m.Images[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Build) validateParent(formats strfmt.Registry) error { + + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Build) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Build) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Build) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Build) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Build + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_create_body.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_create_body.go new file mode 100644 index 00000000..eeb02d84 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_create_body.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BuildCreateBody This message is used for build/create calls; it removes elements from the +// Build message that the user cannot set. +// +// swagger:model hashicorp.cloud.packer_20220411.BuildCreateBody +type HashicorpCloudPacker20220411BuildCreateBody struct { + + // The cloud provider that this build produced artifacts for. + // For example, AWS, GCP, or Azure. + CloudProvider string `json:"cloud_provider,omitempty"` + + // Internal Packer name for the builder or post-processor component used to + // build this. For example, "amazon-ebs" or "azure-arm" + ComponentType string `json:"component_type,omitempty"` + + // List of images associated with this build. + Images []*HashicorpCloudPacker20220411ImageCreateBody `json:"images"` + + // A key:value map for custom, user-settable metadata about your build. + Labels map[string]string `json:"labels,omitempty"` + + // The UUID specific to this call to Packer build. If you use the manifest + // post-processor, this UUID will match the UUID present there. + PackerRunUUID string `json:"packer_run_uuid,omitempty"` + + // The ID of the channel that it was used to fetch the source_iteration_id. + // When the source channel ID is set, the source iteration ID should also be set. + SourceChannelID string `json:"source_channel_id,omitempty"` + + // The ID or URL of the remote cloud source image. Used for tracking image + // dependencies for build pipelines. + SourceImageID string `json:"source_image_id,omitempty"` + + // The ID of the parent iteration associated with the `source_image_id`. + // When the source iteration ID is set, the source image ID should also be set. + SourceIterationID string `json:"source_iteration_id,omitempty"` + + // Status of the build. The status can be RUNNING, DONE, CANCELLED, FAILED, + // or UNSET. + Status HashicorpCloudPacker20220411BuildStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 build create body +func (m *HashicorpCloudPacker20220411BuildCreateBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImages(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 *HashicorpCloudPacker20220411BuildCreateBody) validateImages(formats strfmt.Registry) error { + + if swag.IsZero(m.Images) { // not required + return nil + } + + for i := 0; i < len(m.Images); i++ { + if swag.IsZero(m.Images[i]) { // not required + continue + } + + if m.Images[i] != nil { + if err := m.Images[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BuildCreateBody) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BuildCreateBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BuildCreateBody) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BuildCreateBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_status.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_status.go new file mode 100644 index 00000000..d45f6a73 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_status.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411BuildStatus - UNSET: UNSET is a sentinel zero value so that an uninitialized value can be +// detected. +// - RUNNING: Running means the `packer build` is currently running. +// - DONE: Done means the `packer build` has finished successfully. +// - CANCELLED: Cancelled means the `packer build` was cancelled by a user. +// - FAILED: Failed means the `packer build` failed and therefore image creation failed. +// +// swagger:model hashicorp.cloud.packer_20220411.BuildStatus +type HashicorpCloudPacker20220411BuildStatus string + +const ( + + // HashicorpCloudPacker20220411BuildStatusUNSET captures enum value "UNSET" + HashicorpCloudPacker20220411BuildStatusUNSET HashicorpCloudPacker20220411BuildStatus = "UNSET" + + // HashicorpCloudPacker20220411BuildStatusRUNNING captures enum value "RUNNING" + HashicorpCloudPacker20220411BuildStatusRUNNING HashicorpCloudPacker20220411BuildStatus = "RUNNING" + + // HashicorpCloudPacker20220411BuildStatusDONE captures enum value "DONE" + HashicorpCloudPacker20220411BuildStatusDONE HashicorpCloudPacker20220411BuildStatus = "DONE" + + // HashicorpCloudPacker20220411BuildStatusCANCELLED captures enum value "CANCELLED" + HashicorpCloudPacker20220411BuildStatusCANCELLED HashicorpCloudPacker20220411BuildStatus = "CANCELLED" + + // HashicorpCloudPacker20220411BuildStatusFAILED captures enum value "FAILED" + HashicorpCloudPacker20220411BuildStatusFAILED HashicorpCloudPacker20220411BuildStatus = "FAILED" +) + +// for schema +var hashicorpCloudPacker20220411BuildStatusEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411BuildStatus + if err := json.Unmarshal([]byte(`["UNSET","RUNNING","DONE","CANCELLED","FAILED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411BuildStatusEnum = append(hashicorpCloudPacker20220411BuildStatusEnum, v) + } +} + +func (m HashicorpCloudPacker20220411BuildStatus) validateHashicorpCloudPacker20220411BuildStatusEnum(path, location string, value HashicorpCloudPacker20220411BuildStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411BuildStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 build status +func (m HashicorpCloudPacker20220411BuildStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411BuildStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_updates.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_updates.go new file mode 100644 index 00000000..9384ea14 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_build_updates.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411BuildUpdates BuildUpdates is used to group the elements of a Build that are +// allowed to be updated after the build has been created. It is part of the +// UpdateBuildRequest. +// +// swagger:model hashicorp.cloud.packer_20220411.BuildUpdates +type HashicorpCloudPacker20220411BuildUpdates struct { + + // The cloud provider that this build produced artifacts for. + // For example, AWS, GCP, or Azure. + CloudProvider string `json:"cloud_provider,omitempty"` + + // A list of images to create and associate with this build. + Images []*HashicorpCloudPacker20220411ImageCreateBody `json:"images"` + + // A key:value map for custom, user-settable metadata about your build. + Labels map[string]string `json:"labels,omitempty"` + + // The UUID specific to this call to Packer build. If you use the manifest + // post-processor, this UUID will match the UUID present there. + PackerRunUUID string `json:"packer_run_uuid,omitempty"` + + // The ID of the channel that it was used to fetch the source_iteration_id. + // When the source channel ID is set, the source iteration ID should also be set. + SourceChannelID string `json:"source_channel_id,omitempty"` + + // The ID or URL of the remote cloud source image. Used for tracking image + // dependencies for build pipelines. + SourceImageID string `json:"source_image_id,omitempty"` + + // The ID of the parent iteration associated with the `source_image_id`. + // When the source iteration ID is set, the source image ID should also be set. + SourceIterationID string `json:"source_iteration_id,omitempty"` + + // Status of the build. The status can be RUNNING, DONE, CANCELLED, FAILED, + // or UNSET. + Status HashicorpCloudPacker20220411BuildStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 build updates +func (m *HashicorpCloudPacker20220411BuildUpdates) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImages(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 *HashicorpCloudPacker20220411BuildUpdates) validateImages(formats strfmt.Registry) error { + + if swag.IsZero(m.Images) { // not required + return nil + } + + for i := 0; i < len(m.Images); i++ { + if swag.IsZero(m.Images[i]) { // not required + continue + } + + if m.Images[i] != nil { + if err := m.Images[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411BuildUpdates) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BuildUpdates) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411BuildUpdates) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411BuildUpdates + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel.go new file mode 100644 index 00000000..e05ad77c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411Channel hashicorp cloud packer 20220411 channel +// +// swagger:model hashicorp.cloud.packer_20220411.Channel +type HashicorpCloudPacker20220411Channel struct { + + // The user who last updated the channel. + AuthorID string `json:"author_id,omitempty"` + + // Human-readable name for the bucket this channel is associated with. + BucketSlug string `json:"bucket_slug,omitempty"` + + // When the channel was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the channel. + ID string `json:"id,omitempty"` + + // The iteration the channel is pointing to. + Iteration *HashicorpCloudPacker20220411Iteration `json:"iteration,omitempty"` + + // If the channel is managed by HCP Packer (such as the latest channel). + Managed bool `json:"managed,omitempty"` + + // A pointer to the iteration currently associated with this channel. + // Deprecated: look at the Channel.iteration instead. + Pointer *HashicorpCloudPacker20220411ChannelIterationPointer `json:"pointer,omitempty"` + + // Human-readable name for the channel. + Slug string `json:"slug,omitempty"` + + // When the channel was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 channel +func (m *HashicorpCloudPacker20220411Channel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIteration(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePointer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Channel) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Channel) validateIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.Iteration) { // not required + return nil + } + + if m.Iteration != nil { + if err := m.Iteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iteration") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Channel) validatePointer(formats strfmt.Registry) error { + + if swag.IsZero(m.Pointer) { // not required + return nil + } + + if m.Pointer != nil { + if err := m.Pointer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pointer") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Channel) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Channel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Channel) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Channel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel_iteration_pointer.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel_iteration_pointer.go new file mode 100644 index 00000000..5afe03f4 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_channel_iteration_pointer.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411ChannelIterationPointer A Channel Pointer is a special object that tracks channel +// history by storing both which iteration the channel points to and also when +// the channel was updated to point at said iteration. +// Deprecated: The iteration object is directly embed to Channel. +// +// swagger:model hashicorp.cloud.packer_20220411.ChannelIterationPointer +type HashicorpCloudPacker20220411ChannelIterationPointer struct { + + // The user who pointed the channel to the iteration. + AuthorID string `json:"author_id,omitempty"` + + // When the channel pointer was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // The iteration the channel is pointing to. + Iteration *HashicorpCloudPacker20220411Iteration `json:"iteration,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 channel iteration pointer +func (m *HashicorpCloudPacker20220411ChannelIterationPointer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIteration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ChannelIterationPointer) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ChannelIterationPointer) validateIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.Iteration) { // not required + return nil + } + + if m.Iteration != nil { + if err := m.Iteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iteration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ChannelIterationPointer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ChannelIterationPointer) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ChannelIterationPointer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_request.go new file mode 100644 index 00000000..938a5edb --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_request.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateBucketRequest hashicorp cloud packer 20220411 create bucket request +// +// swagger:model hashicorp.cloud.packer_20220411.CreateBucketRequest +type HashicorpCloudPacker20220411CreateBucketRequest struct { + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // A short description of what this bucket's images are for. + Description string `json:"description,omitempty"` + + // A key:value map for custom, user-settable metadata about your bucket. + Labels map[string]string `json:"labels,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create bucket request +func (m *HashicorpCloudPacker20220411CreateBucketRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateBucketRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBucketRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBucketRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateBucketRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_response.go new file mode 100644 index 00000000..cd6ad3d3 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_bucket_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411CreateBucketResponse hashicorp cloud packer 20220411 create bucket response +// +// swagger:model hashicorp.cloud.packer_20220411.CreateBucketResponse +type HashicorpCloudPacker20220411CreateBucketResponse struct { + + // Information about the bucket that was created. + Bucket *HashicorpCloudPacker20220411Bucket `json:"bucket,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create bucket response +func (m *HashicorpCloudPacker20220411CreateBucketResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBucket(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateBucketResponse) validateBucket(formats strfmt.Registry) error { + + if swag.IsZero(m.Bucket) { // not required + return nil + } + + if m.Bucket != nil { + if err := m.Bucket.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bucket") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBucketResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBucketResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateBucketResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_request.go new file mode 100644 index 00000000..d13cfe75 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateBuildRequest hashicorp cloud packer 20220411 create build request +// +// swagger:model hashicorp.cloud.packer_20220411.CreateBuildRequest +type HashicorpCloudPacker20220411CreateBuildRequest struct { + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Information about the build to create. + Build *HashicorpCloudPacker20220411BuildCreateBody `json:"build,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // ULID of the iteration that this build should be associated with. + IterationID string `json:"iteration_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create build request +func (m *HashicorpCloudPacker20220411CreateBuildRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuild(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateBuildRequest) validateBuild(formats strfmt.Registry) error { + + if swag.IsZero(m.Build) { // not required + return nil + } + + if m.Build != nil { + if err := m.Build.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("build") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411CreateBuildRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBuildRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBuildRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateBuildRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_response.go new file mode 100644 index 00000000..f66a82ee --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_build_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411CreateBuildResponse hashicorp cloud packer 20220411 create build response +// +// swagger:model hashicorp.cloud.packer_20220411.CreateBuildResponse +type HashicorpCloudPacker20220411CreateBuildResponse struct { + + // Information about the build that was created. + Build *HashicorpCloudPacker20220411Build `json:"build,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create build response +func (m *HashicorpCloudPacker20220411CreateBuildResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuild(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateBuildResponse) validateBuild(formats strfmt.Registry) error { + + if swag.IsZero(m.Build) { // not required + return nil + } + + if m.Build != nil { + if err := m.Build.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("build") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBuildResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateBuildResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateBuildResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_request.go new file mode 100644 index 00000000..5e185c9d --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_request.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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateChannelRequest hashicorp cloud packer 20220411 create channel request +// +// swagger:model hashicorp.cloud.packer_20220411.CreateChannelRequest +type HashicorpCloudPacker20220411CreateChannelRequest struct { + + // Human-readable name for the bucket to associate the channel with. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // The human-readable version number assigned to this iteration. + IncrementalVersion int32 `json:"incremental_version,omitempty"` + + // ULID of the iteration. + IterationID string `json:"iteration_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Human-readable name for the channel. + Slug string `json:"slug,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create channel request +func (m *HashicorpCloudPacker20220411CreateChannelRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateChannelRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateChannelRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateChannelRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateChannelRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_response.go new file mode 100644 index 00000000..0f81071b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_channel_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411CreateChannelResponse hashicorp cloud packer 20220411 create channel response +// +// swagger:model hashicorp.cloud.packer_20220411.CreateChannelResponse +type HashicorpCloudPacker20220411CreateChannelResponse struct { + + // Information about the channel that was created. + Channel *HashicorpCloudPacker20220411Channel `json:"channel,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create channel response +func (m *HashicorpCloudPacker20220411CreateChannelResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateChannelResponse) validateChannel(formats strfmt.Registry) error { + + if swag.IsZero(m.Channel) { // not required + return nil + } + + if m.Channel != nil { + if err := m.Channel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateChannelResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateChannelResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateChannelResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_request.go new file mode 100644 index 00000000..9d7f66e8 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_request.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateIterationRequest hashicorp cloud packer 20220411 create iteration request +// +// swagger:model hashicorp.cloud.packer_20220411.CreateIterationRequest +type HashicorpCloudPacker20220411CreateIterationRequest struct { + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create iteration request +func (m *HashicorpCloudPacker20220411CreateIterationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateIterationRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateIterationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateIterationRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateIterationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_response.go new file mode 100644 index 00000000..c1c03648 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_iteration_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411CreateIterationResponse hashicorp cloud packer 20220411 create iteration response +// +// swagger:model hashicorp.cloud.packer_20220411.CreateIterationResponse +type HashicorpCloudPacker20220411CreateIterationResponse struct { + + // iteration + Iteration *HashicorpCloudPacker20220411Iteration `json:"iteration,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create iteration response +func (m *HashicorpCloudPacker20220411CreateIterationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIteration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateIterationResponse) validateIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.Iteration) { // not required + return nil + } + + if m.Iteration != nil { + if err := m.Iteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iteration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateIterationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateIterationResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateIterationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_request.go new file mode 100644 index 00000000..aa0f6030 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_request.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateRegistryRequest hashicorp cloud packer 20220411 create registry request +// +// swagger:model hashicorp.cloud.packer_20220411.CreateRegistryRequest +type HashicorpCloudPacker20220411CreateRegistryRequest struct { + + // Feature tier of the Registry. + FeatureTier HashicorpCloudPacker20220411RegistryConfigTier `json:"feature_tier,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create registry request +func (m *HashicorpCloudPacker20220411CreateRegistryRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFeatureTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateRegistryRequest) validateFeatureTier(formats strfmt.Registry) error { + + if swag.IsZero(m.FeatureTier) { // not required + return nil + } + + if err := m.FeatureTier.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature_tier") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411CreateRegistryRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateRegistryRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_response.go new file mode 100644 index 00000000..6fb8f8aa --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_create_registry_response.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411CreateRegistryResponse hashicorp cloud packer 20220411 create registry response +// +// swagger:model hashicorp.cloud.packer_20220411.CreateRegistryResponse +type HashicorpCloudPacker20220411CreateRegistryResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` + + // registry + Registry *HashicorpCloudPacker20220411Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 create registry response +func (m *HashicorpCloudPacker20220411CreateRegistryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411CreateRegistryResponse) validateOperation(formats strfmt.Registry) error { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411CreateRegistryResponse) validateRegistry(formats strfmt.Registry) error { + + if swag.IsZero(m.Registry) { // not required + return nil + } + + if m.Registry != nil { + if err := m.Registry.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registry") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411CreateRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411CreateRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_bucket_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_bucket_response.go new file mode 100644 index 00000000..1b4a6baf --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_bucket_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 + +// HashicorpCloudPacker20220411DeleteBucketResponse hashicorp cloud packer 20220411 delete bucket response +// +// swagger:model hashicorp.cloud.packer_20220411.DeleteBucketResponse +type HashicorpCloudPacker20220411DeleteBucketResponse interface{} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_build_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_build_response.go new file mode 100644 index 00000000..10e9e4e3 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_build_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 + +// HashicorpCloudPacker20220411DeleteBuildResponse hashicorp cloud packer 20220411 delete build response +// +// swagger:model hashicorp.cloud.packer_20220411.DeleteBuildResponse +type HashicorpCloudPacker20220411DeleteBuildResponse interface{} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_channel_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_channel_response.go new file mode 100644 index 00000000..78b1c2b2 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_channel_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 + +// HashicorpCloudPacker20220411DeleteChannelResponse hashicorp cloud packer 20220411 delete channel response +// +// swagger:model hashicorp.cloud.packer_20220411.DeleteChannelResponse +type HashicorpCloudPacker20220411DeleteChannelResponse interface{} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_iteration_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_iteration_response.go new file mode 100644 index 00000000..cfc203c2 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_iteration_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 + +// HashicorpCloudPacker20220411DeleteIterationResponse hashicorp cloud packer 20220411 delete iteration response +// +// swagger:model hashicorp.cloud.packer_20220411.DeleteIterationResponse +type HashicorpCloudPacker20220411DeleteIterationResponse interface{} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_registry_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_registry_response.go new file mode 100644 index 00000000..591cd30a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_delete_registry_response.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411DeleteRegistryResponse hashicorp cloud packer 20220411 delete registry response +// +// swagger:model hashicorp.cloud.packer_20220411.DeleteRegistryResponse +type HashicorpCloudPacker20220411DeleteRegistryResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` + + // registry + Registry *HashicorpCloudPacker20220411Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 delete registry response +func (m *HashicorpCloudPacker20220411DeleteRegistryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411DeleteRegistryResponse) validateOperation(formats strfmt.Registry) error { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411DeleteRegistryResponse) validateRegistry(formats strfmt.Registry) error { + + if swag.IsZero(m.Registry) { // not required + return nil + } + + if m.Registry != nil { + if err := m.Registry.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registry") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411DeleteRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411DeleteRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411DeleteRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_bucket_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_bucket_response.go new file mode 100644 index 00000000..f9c16f5b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_bucket_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetBucketResponse hashicorp cloud packer 20220411 get bucket response +// +// swagger:model hashicorp.cloud.packer_20220411.GetBucketResponse +type HashicorpCloudPacker20220411GetBucketResponse struct { + + // The requested information about the bucket. + Bucket *HashicorpCloudPacker20220411Bucket `json:"bucket,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get bucket response +func (m *HashicorpCloudPacker20220411GetBucketResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBucket(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411GetBucketResponse) validateBucket(formats strfmt.Registry) error { + + if swag.IsZero(m.Bucket) { // not required + return nil + } + + if m.Bucket != nil { + if err := m.Bucket.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bucket") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetBucketResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetBucketResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetBucketResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_build_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_build_response.go new file mode 100644 index 00000000..51934a5d --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_build_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetBuildResponse hashicorp cloud packer 20220411 get build response +// +// swagger:model hashicorp.cloud.packer_20220411.GetBuildResponse +type HashicorpCloudPacker20220411GetBuildResponse struct { + + // The requested build. + Build *HashicorpCloudPacker20220411Build `json:"build,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get build response +func (m *HashicorpCloudPacker20220411GetBuildResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuild(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411GetBuildResponse) validateBuild(formats strfmt.Registry) error { + + if swag.IsZero(m.Build) { // not required + return nil + } + + if m.Build != nil { + if err := m.Build.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("build") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetBuildResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetBuildResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetBuildResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_channel_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_channel_response.go new file mode 100644 index 00000000..0f9e25c5 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_channel_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetChannelResponse hashicorp cloud packer 20220411 get channel response +// +// swagger:model hashicorp.cloud.packer_20220411.GetChannelResponse +type HashicorpCloudPacker20220411GetChannelResponse struct { + + // The requested channel information. + Channel *HashicorpCloudPacker20220411Channel `json:"channel,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get channel response +func (m *HashicorpCloudPacker20220411GetChannelResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411GetChannelResponse) validateChannel(formats strfmt.Registry) error { + + if swag.IsZero(m.Channel) { // not required + return nil + } + + if m.Channel != nil { + if err := m.Channel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetChannelResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetChannelResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetChannelResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_iteration_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_iteration_response.go new file mode 100644 index 00000000..6d48f54c --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_iteration_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetIterationResponse hashicorp cloud packer 20220411 get iteration response +// +// swagger:model hashicorp.cloud.packer_20220411.GetIterationResponse +type HashicorpCloudPacker20220411GetIterationResponse struct { + + // The requested iteration. + Iteration *HashicorpCloudPacker20220411Iteration `json:"iteration,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get iteration response +func (m *HashicorpCloudPacker20220411GetIterationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIteration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411GetIterationResponse) validateIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.Iteration) { // not required + return nil + } + + if m.Iteration != nil { + if err := m.Iteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iteration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetIterationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetIterationResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetIterationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_response.go new file mode 100644 index 00000000..0d66e378 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetRegistryResponse hashicorp cloud packer 20220411 get registry response +// +// swagger:model hashicorp.cloud.packer_20220411.GetRegistryResponse +type HashicorpCloudPacker20220411GetRegistryResponse struct { + + // registry + Registry *HashicorpCloudPacker20220411Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get registry response +func (m *HashicorpCloudPacker20220411GetRegistryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411GetRegistryResponse) validateRegistry(formats strfmt.Registry) error { + + if swag.IsZero(m.Registry) { // not required + return nil + } + + if m.Registry != nil { + if err := m.Registry.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registry") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_t_f_c_run_task_api_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_t_f_c_run_task_api_response.go new file mode 100644 index 00000000..c3f49b53 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_get_registry_t_f_c_run_task_api_response.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse hashicorp cloud packer 20220411 get registry t f c run task API response +// +// swagger:model hashicorp.cloud.packer_20220411.GetRegistryTFCRunTaskAPIResponse +type HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse struct { + + // URL of the API used by Terraform Cloud to run HCP Packer Run Tasks. + APIURL string `json:"api_url,omitempty"` + + // HMAC key used by Terraform Cloud to sign the requests to the HCP Packer run task API. + HmacKey string `json:"hmac_key,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 get registry t f c run task API response +func (m *HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411GetRegistryTFCRunTaskAPIResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image.go new file mode 100644 index 00000000..63c7762a --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411Image Represents the actual region:image_id mapping for a single image, in a +// single build. +// +// swagger:model hashicorp.cloud.packer_20220411.Image +type HashicorpCloudPacker20220411Image struct { + + // Timestamp at which this image was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) for the image. + ID string `json:"id,omitempty"` + + // ID or URL of the remote cloud image as given by a build. For example, ami-12345. + ImageID string `json:"image_id,omitempty"` + + // Cloud-specific region as provided by `packer build`. For example, "ap-east-1". + Region string `json:"region,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 image +func (m *HashicorpCloudPacker20220411Image) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Image) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Image) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Image) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Image + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image_create_body.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image_create_body.go new file mode 100644 index 00000000..967bbb29 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_image_create_body.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411ImageCreateBody This message is used for build/create calls; it removes elements from the +// Image message that the user cannot set. +// +// swagger:model hashicorp.cloud.packer_20220411.ImageCreateBody +type HashicorpCloudPacker20220411ImageCreateBody struct { + + // ID or URL of the remote cloud image as given by a build. + ImageID string `json:"image_id,omitempty"` + + // Cloud-specific region as provided by `packer build`. For example, "ap-east-1". + Region string `json:"region,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 image create body +func (m *HashicorpCloudPacker20220411ImageCreateBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ImageCreateBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ImageCreateBody) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ImageCreateBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration.go new file mode 100644 index 00000000..78191d6e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411Iteration hashicorp cloud packer 20220411 iteration +// +// swagger:model hashicorp.cloud.packer_20220411.Iteration +type HashicorpCloudPacker20220411Iteration struct { + + // The name of the person who created this iteration. + AuthorID string `json:"author_id,omitempty"` + + // Human-readable name for the bucket that this iteration is associated with. + BucketSlug string `json:"bucket_slug,omitempty"` + + // A list of all the builds associated with this iteration. + Builds []*HashicorpCloudPacker20220411Build `json:"builds"` + + // If true, all builds associated with this iteration have successfully + // completed and uploaded metadata to the registry. When "complete" is true, + // This iteration is considered ready to use, and can have channels assigned + // to it. + Complete bool `json:"complete,omitempty"` + + // When the iteration was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the iteration. + ID string `json:"id,omitempty"` + + // The human-readable version number assigned to this iteration. This + // field will only be set if the iteration is "complete". + IncrementalVersion int32 `json:"incremental_version,omitempty"` + + // The unique identifier of the iteration that was used as a source + // for this iteration, if this iteration was built on a base layer. + // Deprecated: refer to 'parent' for source image information. + IterationAncestorID string `json:"iteration_ancestor_id,omitempty"` + + // Who revoked this iteration. For human authors (e.g. HCP Portal) this will be an email address. + // For machine authors using service principals, this is the customer-chosen name for this service principal. + RevocationAuthor string `json:"revocation_author,omitempty"` + + // The ancestor iteration from whom this iteration inherited the revocation state. + RevocationInheritedFrom *HashicorpCloudPacker20220411RevokedAncestor `json:"revocation_inherited_from,omitempty"` + + // A short explanation of why this iteration was revoked. + RevocationMessage string `json:"revocation_message,omitempty"` + + // Revocation type is 'manual' when self revoked or 'inherited' when inherited from a revoked ancestor. + RevocationType HashicorpCloudPacker20220411IterationRevocationType `json:"revocation_type,omitempty"` + + // Timestamp from when the iteration is revoked an no longer trusted to be secure. + // Format: date-time + RevokeAt strfmt.DateTime `json:"revoke_at,omitempty"` + + // When the iteration was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 iteration +func (m *HashicorpCloudPacker20220411Iteration) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuilds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationInheritedFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevokeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateBuilds(formats strfmt.Registry) error { + + if swag.IsZero(m.Builds) { // not required + return nil + } + + for i := 0; i < len(m.Builds); i++ { + if swag.IsZero(m.Builds[i]) { // not required + continue + } + + if m.Builds[i] != nil { + if err := m.Builds[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("builds" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateRevocationInheritedFrom(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationInheritedFrom) { // not required + return nil + } + + if m.RevocationInheritedFrom != nil { + if err := m.RevocationInheritedFrom.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_inherited_from") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateRevocationType(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationType) { // not required + return nil + } + + if err := m.RevocationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_type") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateRevokeAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RevokeAt) { // not required + return nil + } + + if err := validate.FormatOf("revoke_at", "body", "date-time", m.RevokeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Iteration) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Iteration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Iteration) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Iteration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration_revocation_type.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration_revocation_type.go new file mode 100644 index 00000000..830ea980 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iteration_revocation_type.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411IterationRevocationType - MANUAL: This iteration was revoked manually. +// - INHERITED: This iteration was revoked automatically through multi-level revocation and therefore is inherited. +// +// swagger:model hashicorp.cloud.packer_20220411.Iteration.RevocationType +type HashicorpCloudPacker20220411IterationRevocationType string + +const ( + + // HashicorpCloudPacker20220411IterationRevocationTypeUNSET captures enum value "UNSET" + HashicorpCloudPacker20220411IterationRevocationTypeUNSET HashicorpCloudPacker20220411IterationRevocationType = "UNSET" + + // HashicorpCloudPacker20220411IterationRevocationTypeMANUAL captures enum value "MANUAL" + HashicorpCloudPacker20220411IterationRevocationTypeMANUAL HashicorpCloudPacker20220411IterationRevocationType = "MANUAL" + + // HashicorpCloudPacker20220411IterationRevocationTypeINHERITED captures enum value "INHERITED" + HashicorpCloudPacker20220411IterationRevocationTypeINHERITED HashicorpCloudPacker20220411IterationRevocationType = "INHERITED" +) + +// for schema +var hashicorpCloudPacker20220411IterationRevocationTypeEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411IterationRevocationType + if err := json.Unmarshal([]byte(`["UNSET","MANUAL","INHERITED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411IterationRevocationTypeEnum = append(hashicorpCloudPacker20220411IterationRevocationTypeEnum, v) + } +} + +func (m HashicorpCloudPacker20220411IterationRevocationType) validateHashicorpCloudPacker20220411IterationRevocationTypeEnum(path, location string, value HashicorpCloudPacker20220411IterationRevocationType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411IterationRevocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 iteration revocation type +func (m HashicorpCloudPacker20220411IterationRevocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411IterationRevocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iterationfor_list.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iterationfor_list.go new file mode 100644 index 00000000..4bb77ce7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_iterationfor_list.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411IterationforList The list endpoint does not return build information. +// +// swagger:model hashicorp.cloud.packer_20220411.IterationforList +type HashicorpCloudPacker20220411IterationforList struct { + + // Who created the iteration. + AuthorID string `json:"author_id,omitempty"` + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Maps the build component type to its status enum, for displaying build + // status in the iterations view. + BuildStatuses map[string]string `json:"build_statuses,omitempty"` + + // If true, all builds associated with this iteration have successfully + // completed and uploaded metadata to the registry. When "complete" is true, + // This iteration is considered ready to use, and can have channels assigned + // to it. + Complete bool `json:"complete,omitempty"` + + // When the iteration was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the iteration. + ID string `json:"id,omitempty"` + + // The human-readable version number assigned to this iteration. This + // field will only be set if the iteration is "complete". + IncrementalVersion int32 `json:"incremental_version,omitempty"` + + // The unique identifier of the iteration that was used as a source + // for this iteration, if this iteration was built on a base layer. + // Deprecated: refer to 'parent' for source image information. + IterationAncestorID string `json:"iteration_ancestor_id,omitempty"` + + // Who revoked this iteration. For human authors (e.g. HCP Portal) this will be an email address. + // For machine authors using service principals, this is the customer-chosen name for this service principal. + RevocationAuthor string `json:"revocation_author,omitempty"` + + // The ancestor iteration from whom this iteration inherited the revocation state. + RevocationInheritedFrom *HashicorpCloudPacker20220411RevokedAncestor `json:"revocation_inherited_from,omitempty"` + + // A short explanation of why this iteration was revoked. + RevocationMessage string `json:"revocation_message,omitempty"` + + // Revocation type is 'manual' when self revoked or 'inherited' when inherited from a revoked ancestor. + RevocationType HashicorpCloudPacker20220411IterationRevocationType `json:"revocation_type,omitempty"` + + // Timestamp from when the iteration is revoked an no longer trusted to be secure. + // Format: date-time + RevokeAt strfmt.DateTime `json:"revoke_at,omitempty"` + + // When the iteration was most recently updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 iterationfor list +func (m *HashicorpCloudPacker20220411IterationforList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationInheritedFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevocationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevokeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411IterationforList) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411IterationforList) validateRevocationInheritedFrom(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationInheritedFrom) { // not required + return nil + } + + if m.RevocationInheritedFrom != nil { + if err := m.RevocationInheritedFrom.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_inherited_from") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411IterationforList) validateRevocationType(formats strfmt.Registry) error { + + if swag.IsZero(m.RevocationType) { // not required + return nil + } + + if err := m.RevocationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("revocation_type") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411IterationforList) validateRevokeAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RevokeAt) { // not required + return nil + } + + if err := validate.FormatOf("revoke_at", "body", "date-time", m.RevokeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411IterationforList) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411IterationforList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411IterationforList) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411IterationforList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_latest_iteration_build.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_latest_iteration_build.go new file mode 100644 index 00000000..c0e2faa1 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_latest_iteration_build.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411LatestIterationBuild A simplified Build used in BucketLatestIteration to represent the builds of a bucket's latest iteration. +// This build representation does not contain ancestry information to avoid repetition. +// +// swagger:model hashicorp.cloud.packer_20220411.LatestIterationBuild +type HashicorpCloudPacker20220411LatestIterationBuild struct { + + // The cloud provider that this build produced artifacts for. + // For example, AWS, GCP, or Azure. + CloudProvider string `json:"cloud_provider,omitempty"` + + // Internal Packer name for the builder or post-processor component used to + // build this. For example, "amazon-ebs" or "azure-arm". + ComponentType string `json:"component_type,omitempty"` + + // When the build was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Universally Unique Lexicographically Sortable Identifier (ULID) of the build. + ID string `json:"id,omitempty"` + + // List of images associated with this build. + Images []*HashicorpCloudPacker20220411Image `json:"images"` + + // Unique identifier of the iteration associated with this build; this was + // created and set by the HCP Packer registry when the iteration was created. + IterationID string `json:"iteration_id,omitempty"` + + // A key:value map for custom, user-settable metadata about your build. + Labels map[string]string `json:"labels,omitempty"` + + // The UUID specific to this call to Packer build. If you use the manifest + // post-processor, this UUID will match the UUID present there. + PackerRunUUID string `json:"packer_run_uuid,omitempty"` + + // Unique identifier of the HCP Packer registry build used as the source + // for this build. Used for tracking dependencies for build pipelines. + SourceBuildUlid string `json:"source_build_ulid,omitempty"` + + // The ID or URL of the remote cloud source image. Used for tracking image + // dependencies for build pipelines. + SourceImageID string `json:"source_image_id,omitempty"` + + // Status of the build. The status can be RUNNING, DONE, CANCELLED, FAILED, + // or UNSET. + Status HashicorpCloudPacker20220411BuildStatus `json:"status,omitempty"` + + // When the build was most recently updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 latest iteration build +func (m *HashicorpCloudPacker20220411LatestIterationBuild) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411LatestIterationBuild) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411LatestIterationBuild) validateImages(formats strfmt.Registry) error { + + if swag.IsZero(m.Images) { // not required + return nil + } + + for i := 0; i < len(m.Images); i++ { + if swag.IsZero(m.Images[i]) { // not required + continue + } + + if m.Images[i] != nil { + if err := m.Images[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411LatestIterationBuild) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411LatestIterationBuild) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411LatestIterationBuild) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411LatestIterationBuild) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411LatestIterationBuild + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_bucket_ancestry_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_bucket_ancestry_response.go new file mode 100644 index 00000000..5be1c03e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_bucket_ancestry_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411ListBucketAncestryResponse hashicorp cloud packer 20220411 list bucket ancestry response +// +// swagger:model hashicorp.cloud.packer_20220411.ListBucketAncestryResponse +type HashicorpCloudPacker20220411ListBucketAncestryResponse struct { + + // pagination + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // relations + Relations []*HashicorpCloudPacker20220411BucketAncestry `json:"relations"` + + // The total count of relations. + TotalCount int32 `json:"total_count,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 list bucket ancestry response +func (m *HashicorpCloudPacker20220411ListBucketAncestryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ListBucketAncestryResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ListBucketAncestryResponse) validateRelations(formats strfmt.Registry) error { + + if swag.IsZero(m.Relations) { // not required + return nil + } + + for i := 0; i < len(m.Relations); i++ { + if swag.IsZero(m.Relations[i]) { // not required + continue + } + + if m.Relations[i] != nil { + if err := m.Relations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBucketAncestryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBucketAncestryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ListBucketAncestryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_buckets_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_buckets_response.go new file mode 100644 index 00000000..ac4a82be --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_buckets_response.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411ListBucketsResponse hashicorp cloud packer 20220411 list buckets response +// +// swagger:model hashicorp.cloud.packer_20220411.ListBucketsResponse +type HashicorpCloudPacker20220411ListBucketsResponse struct { + + // List of buckets. + Buckets []*HashicorpCloudPacker20220411Bucket `json:"buckets"` + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 list buckets response +func (m *HashicorpCloudPacker20220411ListBucketsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuckets(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ListBucketsResponse) validateBuckets(formats strfmt.Registry) error { + + if swag.IsZero(m.Buckets) { // not required + return nil + } + + for i := 0; i < len(m.Buckets); i++ { + if swag.IsZero(m.Buckets[i]) { // not required + continue + } + + if m.Buckets[i] != nil { + if err := m.Buckets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("buckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ListBucketsResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBucketsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBucketsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ListBucketsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_builds_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_builds_response.go new file mode 100644 index 00000000..3b11fec6 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_builds_response.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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411ListBuildsResponse hashicorp cloud packer 20220411 list builds response +// +// swagger:model hashicorp.cloud.packer_20220411.ListBuildsResponse +type HashicorpCloudPacker20220411ListBuildsResponse struct { + + // The requested list of builds. + Builds []*HashicorpCloudPacker20220411Build `json:"builds"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 list builds response +func (m *HashicorpCloudPacker20220411ListBuildsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuilds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ListBuildsResponse) validateBuilds(formats strfmt.Registry) error { + + if swag.IsZero(m.Builds) { // not required + return nil + } + + for i := 0; i < len(m.Builds); i++ { + if swag.IsZero(m.Builds[i]) { // not required + continue + } + + if m.Builds[i] != nil { + if err := m.Builds[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("builds" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ListBuildsResponse) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ListBuildsResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBuildsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListBuildsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ListBuildsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_channels_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_channels_response.go new file mode 100644 index 00000000..bdd6915b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_channels_response.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411ListChannelsResponse hashicorp cloud packer 20220411 list channels response +// +// swagger:model hashicorp.cloud.packer_20220411.ListChannelsResponse +type HashicorpCloudPacker20220411ListChannelsResponse struct { + + // channels + Channels []*HashicorpCloudPacker20220411Channel `json:"channels"` +} + +// Validate validates this hashicorp cloud packer 20220411 list channels response +func (m *HashicorpCloudPacker20220411ListChannelsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannels(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ListChannelsResponse) validateChannels(formats strfmt.Registry) error { + + if swag.IsZero(m.Channels) { // not required + return nil + } + + for i := 0; i < len(m.Channels); i++ { + if swag.IsZero(m.Channels[i]) { // not required + continue + } + + if m.Channels[i] != nil { + if err := m.Channels[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channels" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListChannelsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListChannelsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ListChannelsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_iterations_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_iterations_response.go new file mode 100644 index 00000000..be68ceb7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_list_iterations_response.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411ListIterationsResponse hashicorp cloud packer 20220411 list iterations response +// +// swagger:model hashicorp.cloud.packer_20220411.ListIterationsResponse +type HashicorpCloudPacker20220411ListIterationsResponse struct { + + // The requested list of iterations. + Iterations []*HashicorpCloudPacker20220411IterationforList `json:"iterations"` + + // pagination + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 list iterations response +func (m *HashicorpCloudPacker20220411ListIterationsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIterations(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ListIterationsResponse) validateIterations(formats strfmt.Registry) error { + + if swag.IsZero(m.Iterations) { // not required + return nil + } + + for i := 0; i < len(m.Iterations); i++ { + if swag.IsZero(m.Iterations[i]) { // not required + continue + } + + if m.Iterations[i] != nil { + if err := m.Iterations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iterations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudPacker20220411ListIterationsResponse) validatePagination(formats strfmt.Registry) error { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListIterationsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ListIterationsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ListIterationsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status.go new file mode 100644 index 00000000..3902b5fa --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status.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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411ParentBuildStatus The status of a parent image build. +// +// swagger:model hashicorp.cloud.packer_20220411.ParentBuildStatus +type HashicorpCloudPacker20220411ParentBuildStatus struct { + + // The parent bucket slug. + BucketSlug string `json:"bucket_slug,omitempty"` + + // The channel associated with this relationship. + Channel string `json:"channel,omitempty"` + + // The parent ID/URL. + ImageID string `json:"image_id,omitempty"` + + // The parent iteration fingerprint. + IterationFingerprint string `json:"iteration_fingerprint,omitempty"` + + // The parent iteration ULID. + IterationID string `json:"iteration_id,omitempty"` + + // The parent iteration incremental version. + IterationIncrementalVersion int32 `json:"iteration_incremental_version,omitempty"` + + // The parent status. + Status HashicorpCloudPacker20220411ParentBuildStatusStatus `json:"status,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 parent build status +func (m *HashicorpCloudPacker20220411ParentBuildStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411ParentBuildStatus) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ParentBuildStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411ParentBuildStatus) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411ParentBuildStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status_status.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status_status.go new file mode 100644 index 00000000..449ede7e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_parent_build_status_status.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411ParentBuildStatusStatus - UNDETERMINED: Status cannot be determined because either a channel wasn't used when +// building the child build, the configured channel no longer exists +// in the parent bucket, or the parent is not tracked by HCP Packer. +// - UP_TO_DATE: The child build is built from the iteration that is currently +// assigned to the channel that is used in its configuration. +// - OUT_OF_DATE: The child build is built from an iteration that is different from +// the one currently assigned to the channel +// that is used in its configuration. +// +// swagger:model hashicorp.cloud.packer_20220411.ParentBuildStatus.Status +type HashicorpCloudPacker20220411ParentBuildStatusStatus string + +const ( + + // HashicorpCloudPacker20220411ParentBuildStatusStatusUNDETERMINED captures enum value "UNDETERMINED" + HashicorpCloudPacker20220411ParentBuildStatusStatusUNDETERMINED HashicorpCloudPacker20220411ParentBuildStatusStatus = "UNDETERMINED" + + // HashicorpCloudPacker20220411ParentBuildStatusStatusUPTODATE captures enum value "UP_TO_DATE" + HashicorpCloudPacker20220411ParentBuildStatusStatusUPTODATE HashicorpCloudPacker20220411ParentBuildStatusStatus = "UP_TO_DATE" + + // HashicorpCloudPacker20220411ParentBuildStatusStatusOUTOFDATE captures enum value "OUT_OF_DATE" + HashicorpCloudPacker20220411ParentBuildStatusStatusOUTOFDATE HashicorpCloudPacker20220411ParentBuildStatusStatus = "OUT_OF_DATE" +) + +// for schema +var hashicorpCloudPacker20220411ParentBuildStatusStatusEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411ParentBuildStatusStatus + if err := json.Unmarshal([]byte(`["UNDETERMINED","UP_TO_DATE","OUT_OF_DATE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411ParentBuildStatusStatusEnum = append(hashicorpCloudPacker20220411ParentBuildStatusStatusEnum, v) + } +} + +func (m HashicorpCloudPacker20220411ParentBuildStatusStatus) validateHashicorpCloudPacker20220411ParentBuildStatusStatusEnum(path, location string, value HashicorpCloudPacker20220411ParentBuildStatusStatus) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411ParentBuildStatusStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 parent build status status +func (m HashicorpCloudPacker20220411ParentBuildStatusStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411ParentBuildStatusStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_request.go new file mode 100644 index 00000000..cdad4695 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_request.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest hashicorp cloud packer 20220411 regenerate t f c run task hmac key request +// +// swagger:model hashicorp.cloud.packer_20220411.RegenerateTFCRunTaskHmacKeyRequest +type HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest struct { + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 regenerate t f c run task hmac key request +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_response.go new file mode 100644 index 00000000..d9c1a92f --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_regenerate_t_f_c_run_task_hmac_key_response.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse hashicorp cloud packer 20220411 regenerate t f c run task hmac key response +// +// swagger:model hashicorp.cloud.packer_20220411.RegenerateTFCRunTaskHmacKeyResponse +type HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse struct { + + // New HMAC key used by Terraform Cloud to sign the requests to the HCP Packer run task API. + HmacKey string `json:"hmac_key,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 regenerate t f c run task hmac key response +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RegenerateTFCRunTaskHmacKeyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry.go new file mode 100644 index 00000000..ca3d1f14 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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" +) + +// HashicorpCloudPacker20220411Registry hashicorp cloud packer 20220411 registry +// +// swagger:model hashicorp.cloud.packer_20220411.Registry +type HashicorpCloudPacker20220411Registry struct { + + // config + Config *HashicorpCloudPacker20220411RegistryConfig `json:"config,omitempty"` + + // When the registry was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // ULID of the registry. + ID string `json:"id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // When the registry was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 registry +func (m *HashicorpCloudPacker20220411Registry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411Registry) validateConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Registry) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Registry) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411Registry) validateUpdatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Registry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411Registry) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411Registry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision.go new file mode 100644 index 00000000..3bff0488 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411RegistryBillingDeprovision hashicorp cloud packer 20220411 registry billing deprovision +// +// swagger:model hashicorp.cloud.packer_20220411.RegistryBillingDeprovision +type HashicorpCloudPacker20220411RegistryBillingDeprovision struct { + + // The time the registry was deactivated of billing. + // Format: date-time + At strfmt.DateTime `json:"at,omitempty"` + + // Reason of why the registry was deactivated. + Reason HashicorpCloudPacker20220411RegistryBillingDeprovisionReason `json:"reason,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 registry billing deprovision +func (m *HashicorpCloudPacker20220411RegistryBillingDeprovision) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411RegistryBillingDeprovision) validateAt(formats strfmt.Registry) error { + + if swag.IsZero(m.At) { // not required + return nil + } + + if err := validate.FormatOf("at", "body", "date-time", m.At.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411RegistryBillingDeprovision) validateReason(formats strfmt.Registry) error { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryBillingDeprovision) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryBillingDeprovision) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RegistryBillingDeprovision + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision_reason.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision_reason.go new file mode 100644 index 00000000..bf46d29e --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_billing_deprovision_reason.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411RegistryBillingDeprovisionReason hashicorp cloud packer 20220411 registry billing deprovision reason +// +// swagger:model hashicorp.cloud.packer_20220411.RegistryBillingDeprovision.Reason +type HashicorpCloudPacker20220411RegistryBillingDeprovisionReason string + +const ( + + // HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonDELINQUENTBILLINGACCOUNT captures enum value "DELINQUENT_BILLING_ACCOUNT" + HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonDELINQUENTBILLINGACCOUNT HashicorpCloudPacker20220411RegistryBillingDeprovisionReason = "DELINQUENT_BILLING_ACCOUNT" + + // HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonUSERREQUEST captures enum value "USER_REQUEST" + HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonUSERREQUEST HashicorpCloudPacker20220411RegistryBillingDeprovisionReason = "USER_REQUEST" + + // HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonHASHIADMINREQUEST captures enum value "HASHI_ADMIN_REQUEST" + HashicorpCloudPacker20220411RegistryBillingDeprovisionReasonHASHIADMINREQUEST HashicorpCloudPacker20220411RegistryBillingDeprovisionReason = "HASHI_ADMIN_REQUEST" +) + +// for schema +var hashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411RegistryBillingDeprovisionReason + if err := json.Unmarshal([]byte(`["DELINQUENT_BILLING_ACCOUNT","USER_REQUEST","HASHI_ADMIN_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum = append(hashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum, v) + } +} + +func (m HashicorpCloudPacker20220411RegistryBillingDeprovisionReason) validateHashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum(path, location string, value HashicorpCloudPacker20220411RegistryBillingDeprovisionReason) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 registry billing deprovision reason +func (m HashicorpCloudPacker20220411RegistryBillingDeprovisionReason) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411RegistryBillingDeprovisionReasonEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config.go new file mode 100644 index 00000000..2db7e643 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411RegistryConfig The HCP Packer Registry configuration +// +// swagger:model hashicorp.cloud.packer_20220411.RegistryConfig +type HashicorpCloudPacker20220411RegistryConfig struct { + + // A registry is activated when the system correctly starts billing for it. + Activated bool `json:"activated,omitempty"` + + // The information about the billing deactivation. + BillingDeprovision *HashicorpCloudPacker20220411RegistryBillingDeprovision `json:"billing_deprovision,omitempty"` + + // The feature tier for the registry. + FeatureTier HashicorpCloudPacker20220411RegistryConfigTier `json:"feature_tier,omitempty"` + + // Required configuration to run TFC run tasks for validation against this registry. + TfcRunTaskConfig *HashicorpCloudPacker20220411RegistryTFCRunTaskConfig `json:"tfc_run_task_config,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 registry config +func (m *HashicorpCloudPacker20220411RegistryConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBillingDeprovision(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFeatureTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTfcRunTaskConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411RegistryConfig) validateBillingDeprovision(formats strfmt.Registry) error { + + if swag.IsZero(m.BillingDeprovision) { // not required + return nil + } + + if m.BillingDeprovision != nil { + if err := m.BillingDeprovision.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("billing_deprovision") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411RegistryConfig) validateFeatureTier(formats strfmt.Registry) error { + + if swag.IsZero(m.FeatureTier) { // not required + return nil + } + + if err := m.FeatureTier.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature_tier") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411RegistryConfig) validateTfcRunTaskConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.TfcRunTaskConfig) { // not required + return nil + } + + if m.TfcRunTaskConfig != nil { + if err := m.TfcRunTaskConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tfc_run_task_config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RegistryConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config_tier.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config_tier.go new file mode 100644 index 00000000..aeafa7d9 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_config_tier.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudPacker20220411RegistryConfigTier hashicorp cloud packer 20220411 registry config tier +// +// swagger:model hashicorp.cloud.packer_20220411.RegistryConfig.Tier +type HashicorpCloudPacker20220411RegistryConfigTier string + +const ( + + // HashicorpCloudPacker20220411RegistryConfigTierUNSET captures enum value "UNSET" + HashicorpCloudPacker20220411RegistryConfigTierUNSET HashicorpCloudPacker20220411RegistryConfigTier = "UNSET" + + // HashicorpCloudPacker20220411RegistryConfigTierPRIVATEBETA captures enum value "PRIVATE_BETA" + HashicorpCloudPacker20220411RegistryConfigTierPRIVATEBETA HashicorpCloudPacker20220411RegistryConfigTier = "PRIVATE_BETA" + + // HashicorpCloudPacker20220411RegistryConfigTierSTANDARD captures enum value "STANDARD" + HashicorpCloudPacker20220411RegistryConfigTierSTANDARD HashicorpCloudPacker20220411RegistryConfigTier = "STANDARD" + + // HashicorpCloudPacker20220411RegistryConfigTierPLUS captures enum value "PLUS" + HashicorpCloudPacker20220411RegistryConfigTierPLUS HashicorpCloudPacker20220411RegistryConfigTier = "PLUS" +) + +// for schema +var hashicorpCloudPacker20220411RegistryConfigTierEnum []interface{} + +func init() { + var res []HashicorpCloudPacker20220411RegistryConfigTier + if err := json.Unmarshal([]byte(`["UNSET","PRIVATE_BETA","STANDARD","PLUS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudPacker20220411RegistryConfigTierEnum = append(hashicorpCloudPacker20220411RegistryConfigTierEnum, v) + } +} + +func (m HashicorpCloudPacker20220411RegistryConfigTier) validateHashicorpCloudPacker20220411RegistryConfigTierEnum(path, location string, value HashicorpCloudPacker20220411RegistryConfigTier) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudPacker20220411RegistryConfigTierEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud packer 20220411 registry config tier +func (m HashicorpCloudPacker20220411RegistryConfigTier) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudPacker20220411RegistryConfigTierEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_t_f_c_run_task_config.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_t_f_c_run_task_config.go new file mode 100644 index 00000000..2f7daab5 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_registry_t_f_c_run_task_config.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411RegistryTFCRunTaskConfig hashicorp cloud packer 20220411 registry t f c run task config +// +// swagger:model hashicorp.cloud.packer_20220411.RegistryTFCRunTaskConfig +type HashicorpCloudPacker20220411RegistryTFCRunTaskConfig struct { + + // Unique per registry API id for running HCP Packer run tasks. + APIID string `json:"api_id,omitempty"` + + // Encrypted HMAC key used by Terraform Cloud to sign the requests to the HCP Packer run task API. + HmacKey string `json:"hmac_key,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 registry t f c run task config +func (m *HashicorpCloudPacker20220411RegistryTFCRunTaskConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryTFCRunTaskConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RegistryTFCRunTaskConfig) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RegistryTFCRunTaskConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_revoked_ancestor.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_revoked_ancestor.go new file mode 100644 index 00000000..e806913b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_revoked_ancestor.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411RevokedAncestor hashicorp cloud packer 20220411 revoked ancestor +// +// swagger:model hashicorp.cloud.packer_20220411.RevokedAncestor +type HashicorpCloudPacker20220411RevokedAncestor struct { + + // The ancestor bucket slug. + BucketSlug string `json:"bucket_slug,omitempty"` + + // The URL to get the iteration's revoked ancestor. + Href string `json:"href,omitempty"` + + // The ancestor iteration fingerprint. + IterationFingerprint string `json:"iteration_fingerprint,omitempty"` + + // The ancestor iteration ULID. + IterationID string `json:"iteration_id,omitempty"` + + // The ancestor iteration incremental version. + IterationIncrementalVersion int32 `json:"iteration_incremental_version,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 revoked ancestor +func (m *HashicorpCloudPacker20220411RevokedAncestor) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RevokedAncestor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411RevokedAncestor) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411RevokedAncestor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_t_f_c_image_validation_run_task_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_t_f_c_image_validation_run_task_response.go new file mode 100644 index 00000000..76e05409 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_t_f_c_image_validation_run_task_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 + +// HashicorpCloudPacker20220411TFCImageValidationRunTaskResponse hashicorp cloud packer 20220411 t f c image validation run task response +// +// swagger:model hashicorp.cloud.packer_20220411.TFCImageValidationRunTaskResponse +type HashicorpCloudPacker20220411TFCImageValidationRunTaskResponse interface{} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_request.go new file mode 100644 index 00000000..b221c2e7 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateBucketRequest hashicorp cloud packer 20220411 update bucket request +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateBucketRequest +type HashicorpCloudPacker20220411UpdateBucketRequest struct { + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // A short description of what this bucket's images are for. + Description string `json:"description,omitempty"` + + // A key:value map for custom, user-settable metadata about your bucket. + Labels map[string]string `json:"labels,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // A list of the cloud providers or other platforms that are included in the latest complete iteration. e.g aws, gcp, or azure. + Platforms []string `json:"platforms"` +} + +// Validate validates this hashicorp cloud packer 20220411 update bucket request +func (m *HashicorpCloudPacker20220411UpdateBucketRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateBucketRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBucketRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBucketRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateBucketRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_response.go new file mode 100644 index 00000000..e62b0a83 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_bucket_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411UpdateBucketResponse hashicorp cloud packer 20220411 update bucket response +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateBucketResponse +type HashicorpCloudPacker20220411UpdateBucketResponse struct { + + // Information about the bucket that was updated. + Bucket *HashicorpCloudPacker20220411Bucket `json:"bucket,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update bucket response +func (m *HashicorpCloudPacker20220411UpdateBucketResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBucket(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateBucketResponse) validateBucket(formats strfmt.Registry) error { + + if swag.IsZero(m.Bucket) { // not required + return nil + } + + if m.Bucket != nil { + if err := m.Bucket.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bucket") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBucketResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBucketResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateBucketResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_request.go new file mode 100644 index 00000000..92389784 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_request.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateBuildRequest hashicorp cloud packer 20220411 update build request +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateBuildRequest +type HashicorpCloudPacker20220411UpdateBuildRequest struct { + + // ULID of the build that should be updated. + BuildID string `json:"build_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Information about the build you are updating. + Updates *HashicorpCloudPacker20220411BuildUpdates `json:"updates,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update build request +func (m *HashicorpCloudPacker20220411UpdateBuildRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdates(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateBuildRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateBuildRequest) validateUpdates(formats strfmt.Registry) error { + + if swag.IsZero(m.Updates) { // not required + return nil + } + + if m.Updates != nil { + if err := m.Updates.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("updates") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBuildRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBuildRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateBuildRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_response.go new file mode 100644 index 00000000..5326c12b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_build_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411UpdateBuildResponse hashicorp cloud packer 20220411 update build response +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateBuildResponse +type HashicorpCloudPacker20220411UpdateBuildResponse struct { + + // Information about the build you updated. + Build *HashicorpCloudPacker20220411Build `json:"build,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update build response +func (m *HashicorpCloudPacker20220411UpdateBuildResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuild(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateBuildResponse) validateBuild(formats strfmt.Registry) error { + + if swag.IsZero(m.Build) { // not required + return nil + } + + if m.Build != nil { + if err := m.Build.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("build") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBuildResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateBuildResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateBuildResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_request.go new file mode 100644 index 00000000..3c9d73af --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_request.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateChannelRequest hashicorp cloud packer 20220411 update channel request +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateChannelRequest +type HashicorpCloudPacker20220411UpdateChannelRequest struct { + + // Human-readable name for the bucket that the channel is associated with. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Fingerprint of the iteration. The fingerprint is set by Packer when you + // call `packer build`. It will most often correspond to a git commit sha, + // but can be manually overridden by setting the environment variable + // `HCP_PACKER_BUILD_FINGERPRINT`. + Fingerprint string `json:"fingerprint,omitempty"` + + // The human-readable version number assigned to this iteration. + IncrementalVersion int32 `json:"incremental_version,omitempty"` + + // ULID of the iteration. This was created and set by the + // HCP Packer registry when the iteration was created. + IterationID string `json:"iteration_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // Human-readable name for the channel. + Slug string `json:"slug,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update channel request +func (m *HashicorpCloudPacker20220411UpdateChannelRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateChannelRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateChannelRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateChannelRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateChannelRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_response.go new file mode 100644 index 00000000..d5d826e4 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_channel_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudPacker20220411UpdateChannelResponse hashicorp cloud packer 20220411 update channel response +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateChannelResponse +type HashicorpCloudPacker20220411UpdateChannelResponse struct { + + // channel + Channel *HashicorpCloudPacker20220411Channel `json:"channel,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update channel response +func (m *HashicorpCloudPacker20220411UpdateChannelResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateChannelResponse) validateChannel(formats strfmt.Registry) error { + + if swag.IsZero(m.Channel) { // not required + return nil + } + + if m.Channel != nil { + if err := m.Channel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateChannelResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateChannelResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateChannelResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_request.go new file mode 100644 index 00000000..91799d2d --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_request.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateIterationRequest hashicorp cloud packer 20220411 update iteration request +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateIterationRequest +type HashicorpCloudPacker20220411UpdateIterationRequest struct { + + // Human-readable name for the bucket. + BucketSlug string `json:"bucket_slug,omitempty"` + + // Set to "true" when all builds associated with this iteration have + // successfully completed and uploaded metadata to the registry. When + // "complete" is true, this iteration is considered ready to use, and can + // have channels assigned to it. + Complete bool `json:"complete,omitempty"` + + // ULID of the iteration. + IterationID string `json:"iteration_id,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // When set to true, will make a previously revoked iteration valid again. + Restore bool `json:"restore,omitempty"` + + // Optional field to provide the reason for why this iteration is being revoked. + RevocationMessage string `json:"revocation_message,omitempty"` + + // revoke_at accepts strings in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + // format to represent the revocation timestamp. To instantly revoke the iteration, provide the current timestamp. + // The revoke_at timestamp will always be recorded in UTC (Coordinated Universal Time). + // This option is equivalent to the 'revoke_in' option and therefore only one of them should be set when updating + // the iteration. + // Format: date-time + RevokeAt strfmt.DateTime `json:"revoke_at,omitempty"` + + // revoke_in accepts a signed sequence of decimal numbers with a unit suffix to represent the duration + // to the revocation date, such as '30d' or '2h45m'. + // Valid time units are 's', 'm', 'h', and 'd' as for seconds, minutes, hours, and days. + // To instantly revoke the iteration, provide the duration of zero seconds ("0s"). + // The revoke_in duration will be used to calculate the iteration revocation timestamp, + // which will be recorded as UTC (Coordinated Universal Time). + // This option is equivalent to the 'revoke_at' option and therefore only one of them should be set when updating + // the iteration. + RevokeIn string `json:"revoke_in,omitempty"` + + // When set to true, the iteration's descendants won't inherit its revocation status. + SkipDescendantsRevocation bool `json:"skip_descendants_revocation,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update iteration request +func (m *HashicorpCloudPacker20220411UpdateIterationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRevokeAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateIterationRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateIterationRequest) validateRevokeAt(formats strfmt.Registry) error { + + if swag.IsZero(m.RevokeAt) { // not required + return nil + } + + if err := validate.FormatOf("revoke_at", "body", "date-time", m.RevokeAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateIterationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateIterationRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateIterationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_response.go new file mode 100644 index 00000000..7f85101b --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_iteration_response.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateIterationResponse hashicorp cloud packer 20220411 update iteration response +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateIterationResponse +type HashicorpCloudPacker20220411UpdateIterationResponse struct { + + // Information about the updated iteration. + Iteration *HashicorpCloudPacker20220411Iteration `json:"iteration,omitempty"` + + // When revoking, use this operation to follow the asynchronous process of revoking + // all the iteration's descendants. + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update iteration response +func (m *HashicorpCloudPacker20220411UpdateIterationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIteration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateIterationResponse) validateIteration(formats strfmt.Registry) error { + + if swag.IsZero(m.Iteration) { // not required + return nil + } + + if m.Iteration != nil { + if err := m.Iteration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iteration") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateIterationResponse) validateOperation(formats strfmt.Registry) error { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateIterationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateIterationResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateIterationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_request.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_request.go new file mode 100644 index 00000000..a40c4410 --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_request.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateRegistryRequest hashicorp cloud packer 20220411 update registry request +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateRegistryRequest +type HashicorpCloudPacker20220411UpdateRegistryRequest struct { + + // Activates a deactivated registry. A registry can only be activated + // if the organization billing account is valid (e.g. valid credits or payment method). + Activate bool `json:"activate,omitempty"` + + // Feature tier of the Registry. + FeatureTier HashicorpCloudPacker20220411RegistryConfigTier `json:"feature_tier,omitempty"` + + // location + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update registry request +func (m *HashicorpCloudPacker20220411UpdateRegistryRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFeatureTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateRegistryRequest) validateFeatureTier(formats strfmt.Registry) error { + + if swag.IsZero(m.FeatureTier) { // not required + return nil + } + + if err := m.FeatureTier.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature_tier") + } + return err + } + + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateRegistryRequest) validateLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateRegistryRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_response.go b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_response.go new file mode 100644 index 00000000..588d8d7f --- /dev/null +++ b/clients/cloud-packer-service/preview/2022-04-11/models/hashicorp_cloud_packer20220411_update_registry_response.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudPacker20220411UpdateRegistryResponse hashicorp cloud packer 20220411 update registry response +// +// swagger:model hashicorp.cloud.packer_20220411.UpdateRegistryResponse +type HashicorpCloudPacker20220411UpdateRegistryResponse struct { + + // operation + Operation *cloud.HashicorpCloudOperationOperation `json:"operation,omitempty"` + + // registry + Registry *HashicorpCloudPacker20220411Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud packer 20220411 update registry response +func (m *HashicorpCloudPacker20220411UpdateRegistryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateRegistryResponse) validateOperation(formats strfmt.Registry) error { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudPacker20220411UpdateRegistryResponse) validateRegistry(formats strfmt.Registry) error { + + if swag.IsZero(m.Registry) { // not required + return nil + } + + if m.Registry != nil { + if err := m.Registry.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registry") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudPacker20220411UpdateRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudPacker20220411UpdateRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}