diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/box_service_client.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/box_service_client.go new file mode 100644 index 00000000..ad0db4d7 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/box_service_client.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new box service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for box service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + CreateBox(params *CreateBoxParams, authInfo runtime.ClientAuthInfoWriter) (*CreateBoxOK, error) + + DeleteBox(params *DeleteBoxParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBoxOK, error) + + ListBoxes(params *ListBoxesParams, authInfo runtime.ClientAuthInfoWriter) (*ListBoxesOK, error) + + ReadBox(params *ReadBoxParams, authInfo runtime.ClientAuthInfoWriter) (*ReadBoxOK, error) + + UpdateBox(params *UpdateBoxParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateBoxOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateBox creates box creates a new vagrant box +*/ +func (a *Client) CreateBox(params *CreateBoxParams, authInfo runtime.ClientAuthInfoWriter) (*CreateBoxOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateBoxParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateBox", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateBoxReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateBoxOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CreateBox: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteBox deletes box deletes a vagrant box + + Deleting a Box removes all its Versions and Providers as +well. This operation cannot be undone. +*/ +func (a *Client) DeleteBox(params *DeleteBoxParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBoxOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteBoxParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteBox", + Method: "DELETE", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteBoxReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteBoxOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteBox: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListBoxes lists boxes lists all of the boxes within a particular registry +*/ +func (a *Client) ListBoxes(params *ListBoxesParams, authInfo runtime.ClientAuthInfoWriter) (*ListBoxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListBoxesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListBoxes", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListBoxesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListBoxesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListBoxes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReadBox reads box reads a vagrant box +*/ +func (a *Client) ReadBox(params *ReadBoxParams, authInfo runtime.ClientAuthInfoWriter) (*ReadBoxOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadBoxParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ReadBox", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ReadBoxReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReadBoxOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadBox: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateBox updates box updates the details of a vagrant box + + Note that this only updates details about the Box itself. To +work with a Box's Versions or Providers, use those respective +services. +*/ +func (a *Client) UpdateBox(params *UpdateBoxParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateBoxOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateBoxParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateBox", + Method: "PATCH", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateBoxReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateBoxOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UpdateBox: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_parameters.go new file mode 100644 index 00000000..40a11b25 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewCreateBoxParams creates a new CreateBoxParams object +// with the default values initialized. +func NewCreateBoxParams() *CreateBoxParams { + var () + return &CreateBoxParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateBoxParamsWithTimeout creates a new CreateBoxParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateBoxParamsWithTimeout(timeout time.Duration) *CreateBoxParams { + var () + return &CreateBoxParams{ + + timeout: timeout, + } +} + +// NewCreateBoxParamsWithContext creates a new CreateBoxParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateBoxParamsWithContext(ctx context.Context) *CreateBoxParams { + var () + return &CreateBoxParams{ + + Context: ctx, + } +} + +// NewCreateBoxParamsWithHTTPClient creates a new CreateBoxParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateBoxParamsWithHTTPClient(client *http.Client) *CreateBoxParams { + var () + return &CreateBoxParams{ + HTTPClient: client, + } +} + +/*CreateBoxParams contains all the parameters to send to the API endpoint +for the create box operation typically these are written to a http.Request +*/ +type CreateBoxParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930CreateBoxRequest + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create box params +func (o *CreateBoxParams) WithTimeout(timeout time.Duration) *CreateBoxParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create box params +func (o *CreateBoxParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create box params +func (o *CreateBoxParams) WithContext(ctx context.Context) *CreateBoxParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create box params +func (o *CreateBoxParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create box params +func (o *CreateBoxParams) WithHTTPClient(client *http.Client) *CreateBoxParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create box params +func (o *CreateBoxParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create box params +func (o *CreateBoxParams) WithBody(body *models.HashicorpCloudVagrant20220930CreateBoxRequest) *CreateBoxParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create box params +func (o *CreateBoxParams) SetBody(body *models.HashicorpCloudVagrant20220930CreateBoxRequest) { + o.Body = body +} + +// WithRegistry adds the registry to the create box params +func (o *CreateBoxParams) WithRegistry(registry string) *CreateBoxParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the create box params +func (o *CreateBoxParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateBoxParams) 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 registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_responses.go new file mode 100644 index 00000000..a498923f --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/create_box_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// CreateBoxReader is a Reader for the CreateBox structure. +type CreateBoxReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateBoxReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateBoxOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateBoxOK creates a CreateBoxOK with default headers values +func NewCreateBoxOK() *CreateBoxOK { + return &CreateBoxOK{} +} + +/*CreateBoxOK handles this case with default header values. + +A successful response. +*/ +type CreateBoxOK struct { + Payload *models.HashicorpCloudVagrant20220930CreateBoxResponse +} + +func (o *CreateBoxOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes][%d] createBoxOK %+v", 200, o.Payload) +} + +func (o *CreateBoxOK) GetPayload() *models.HashicorpCloudVagrant20220930CreateBoxResponse { + return o.Payload +} + +func (o *CreateBoxOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930CreateBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_parameters.go new file mode 100644 index 00000000..4b676f1b --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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" +) + +// NewDeleteBoxParams creates a new DeleteBoxParams object +// with the default values initialized. +func NewDeleteBoxParams() *DeleteBoxParams { + var () + return &DeleteBoxParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteBoxParamsWithTimeout creates a new DeleteBoxParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteBoxParamsWithTimeout(timeout time.Duration) *DeleteBoxParams { + var () + return &DeleteBoxParams{ + + timeout: timeout, + } +} + +// NewDeleteBoxParamsWithContext creates a new DeleteBoxParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteBoxParamsWithContext(ctx context.Context) *DeleteBoxParams { + var () + return &DeleteBoxParams{ + + Context: ctx, + } +} + +// NewDeleteBoxParamsWithHTTPClient creates a new DeleteBoxParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteBoxParamsWithHTTPClient(client *http.Client) *DeleteBoxParams { + var () + return &DeleteBoxParams{ + HTTPClient: client, + } +} + +/*DeleteBoxParams contains all the parameters to send to the API endpoint +for the delete box operation typically these are written to a http.Request +*/ +type DeleteBoxParams struct { + + /*Box + The name segment of the Box to delete. As an example, this field would + represent the "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete box params +func (o *DeleteBoxParams) WithTimeout(timeout time.Duration) *DeleteBoxParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete box params +func (o *DeleteBoxParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete box params +func (o *DeleteBoxParams) WithContext(ctx context.Context) *DeleteBoxParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete box params +func (o *DeleteBoxParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete box params +func (o *DeleteBoxParams) WithHTTPClient(client *http.Client) *DeleteBoxParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete box params +func (o *DeleteBoxParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the delete box params +func (o *DeleteBoxParams) WithBox(box string) *DeleteBoxParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the delete box params +func (o *DeleteBoxParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the delete box params +func (o *DeleteBoxParams) WithRegistry(registry string) *DeleteBoxParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the delete box params +func (o *DeleteBoxParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteBoxParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_responses.go new file mode 100644 index 00000000..17917baa --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/delete_box_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DeleteBoxReader is a Reader for the DeleteBox structure. +type DeleteBoxReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteBoxReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteBoxOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteBoxOK creates a DeleteBoxOK with default headers values +func NewDeleteBoxOK() *DeleteBoxOK { + return &DeleteBoxOK{} +} + +/*DeleteBoxOK handles this case with default header values. + +A successful response. +*/ +type DeleteBoxOK struct { + Payload models.HashicorpCloudVagrant20220930DeleteBoxResponse +} + +func (o *DeleteBoxOK) Error() string { + return fmt.Sprintf("[DELETE /vagrant/2022-09-30/registry/{registry}/boxes/{box}][%d] deleteBoxOK %+v", 200, o.Payload) +} + +func (o *DeleteBoxOK) GetPayload() models.HashicorpCloudVagrant20220930DeleteBoxResponse { + return o.Payload +} + +func (o *DeleteBoxOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_parameters.go new file mode 100644 index 00000000..909620e5 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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" +) + +// NewListBoxesParams creates a new ListBoxesParams object +// with the default values initialized. +func NewListBoxesParams() *ListBoxesParams { + var () + return &ListBoxesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListBoxesParamsWithTimeout creates a new ListBoxesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListBoxesParamsWithTimeout(timeout time.Duration) *ListBoxesParams { + var () + return &ListBoxesParams{ + + timeout: timeout, + } +} + +// NewListBoxesParamsWithContext creates a new ListBoxesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListBoxesParamsWithContext(ctx context.Context) *ListBoxesParams { + var () + return &ListBoxesParams{ + + Context: ctx, + } +} + +// NewListBoxesParamsWithHTTPClient creates a new ListBoxesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListBoxesParamsWithHTTPClient(client *http.Client) *ListBoxesParams { + var () + return &ListBoxesParams{ + HTTPClient: client, + } +} + +/*ListBoxesParams contains all the parameters to send to the API endpoint +for the list boxes operation typically these are written to a http.Request +*/ +type ListBoxesParams struct { + + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + /*Registry + The name of the Registry to list boxes in. + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list boxes params +func (o *ListBoxesParams) WithTimeout(timeout time.Duration) *ListBoxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list boxes params +func (o *ListBoxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list boxes params +func (o *ListBoxesParams) WithContext(ctx context.Context) *ListBoxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list boxes params +func (o *ListBoxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list boxes params +func (o *ListBoxesParams) WithHTTPClient(client *http.Client) *ListBoxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list boxes params +func (o *ListBoxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list boxes params +func (o *ListBoxesParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListBoxesParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list boxes params +func (o *ListBoxesParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list boxes params +func (o *ListBoxesParams) WithPaginationPageSize(paginationPageSize *int64) *ListBoxesParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list boxes params +func (o *ListBoxesParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list boxes params +func (o *ListBoxesParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListBoxesParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list boxes params +func (o *ListBoxesParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithRegistry adds the registry to the list boxes params +func (o *ListBoxesParams) WithRegistry(registry string) *ListBoxesParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the list boxes params +func (o *ListBoxesParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *ListBoxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_responses.go new file mode 100644 index 00000000..9e752e6e --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/list_boxes_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ListBoxesReader is a Reader for the ListBoxes structure. +type ListBoxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListBoxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListBoxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListBoxesOK creates a ListBoxesOK with default headers values +func NewListBoxesOK() *ListBoxesOK { + return &ListBoxesOK{} +} + +/*ListBoxesOK handles this case with default header values. + +A successful response. +*/ +type ListBoxesOK struct { + Payload *models.HashicorpCloudVagrant20220930ListBoxesResponse +} + +func (o *ListBoxesOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes][%d] listBoxesOK %+v", 200, o.Payload) +} + +func (o *ListBoxesOK) GetPayload() *models.HashicorpCloudVagrant20220930ListBoxesResponse { + return o.Payload +} + +func (o *ListBoxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ListBoxesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_parameters.go new file mode 100644 index 00000000..20c8f4eb --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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" +) + +// NewReadBoxParams creates a new ReadBoxParams object +// with the default values initialized. +func NewReadBoxParams() *ReadBoxParams { + var () + return &ReadBoxParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReadBoxParamsWithTimeout creates a new ReadBoxParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReadBoxParamsWithTimeout(timeout time.Duration) *ReadBoxParams { + var () + return &ReadBoxParams{ + + timeout: timeout, + } +} + +// NewReadBoxParamsWithContext creates a new ReadBoxParams object +// with the default values initialized, and the ability to set a context for a request +func NewReadBoxParamsWithContext(ctx context.Context) *ReadBoxParams { + var () + return &ReadBoxParams{ + + Context: ctx, + } +} + +// NewReadBoxParamsWithHTTPClient creates a new ReadBoxParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReadBoxParamsWithHTTPClient(client *http.Client) *ReadBoxParams { + var () + return &ReadBoxParams{ + HTTPClient: client, + } +} + +/*ReadBoxParams contains all the parameters to send to the API endpoint +for the read box operation typically these are written to a http.Request +*/ +type ReadBoxParams struct { + + /*Box + The name segment of the Box to look up. As an example, this field would + represent the "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the read box params +func (o *ReadBoxParams) WithTimeout(timeout time.Duration) *ReadBoxParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read box params +func (o *ReadBoxParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read box params +func (o *ReadBoxParams) WithContext(ctx context.Context) *ReadBoxParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read box params +func (o *ReadBoxParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read box params +func (o *ReadBoxParams) WithHTTPClient(client *http.Client) *ReadBoxParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read box params +func (o *ReadBoxParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the read box params +func (o *ReadBoxParams) WithBox(box string) *ReadBoxParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the read box params +func (o *ReadBoxParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the read box params +func (o *ReadBoxParams) WithRegistry(registry string) *ReadBoxParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the read box params +func (o *ReadBoxParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadBoxParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_responses.go new file mode 100644 index 00000000..e7ccf5f7 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/read_box_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ReadBoxReader is a Reader for the ReadBox structure. +type ReadBoxReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadBoxReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadBoxOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReadBoxOK creates a ReadBoxOK with default headers values +func NewReadBoxOK() *ReadBoxOK { + return &ReadBoxOK{} +} + +/*ReadBoxOK handles this case with default header values. + +A successful response. +*/ +type ReadBoxOK struct { + Payload *models.HashicorpCloudVagrant20220930ReadBoxResponse +} + +func (o *ReadBoxOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}][%d] readBoxOK %+v", 200, o.Payload) +} + +func (o *ReadBoxOK) GetPayload() *models.HashicorpCloudVagrant20220930ReadBoxResponse { + return o.Payload +} + +func (o *ReadBoxOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ReadBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_parameters.go new file mode 100644 index 00000000..1e16fbc5 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewUpdateBoxParams creates a new UpdateBoxParams object +// with the default values initialized. +func NewUpdateBoxParams() *UpdateBoxParams { + var () + return &UpdateBoxParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateBoxParamsWithTimeout creates a new UpdateBoxParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateBoxParamsWithTimeout(timeout time.Duration) *UpdateBoxParams { + var () + return &UpdateBoxParams{ + + timeout: timeout, + } +} + +// NewUpdateBoxParamsWithContext creates a new UpdateBoxParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateBoxParamsWithContext(ctx context.Context) *UpdateBoxParams { + var () + return &UpdateBoxParams{ + + Context: ctx, + } +} + +// NewUpdateBoxParamsWithHTTPClient creates a new UpdateBoxParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateBoxParamsWithHTTPClient(client *http.Client) *UpdateBoxParams { + var () + return &UpdateBoxParams{ + HTTPClient: client, + } +} + +/*UpdateBoxParams contains all the parameters to send to the API endpoint +for the update box operation typically these are written to a http.Request +*/ +type UpdateBoxParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930UpdateBoxRequest + /*Box + The name segment of the Box to update. As an example, this field would + represent the "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update box params +func (o *UpdateBoxParams) WithTimeout(timeout time.Duration) *UpdateBoxParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update box params +func (o *UpdateBoxParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update box params +func (o *UpdateBoxParams) WithContext(ctx context.Context) *UpdateBoxParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update box params +func (o *UpdateBoxParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update box params +func (o *UpdateBoxParams) WithHTTPClient(client *http.Client) *UpdateBoxParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update box params +func (o *UpdateBoxParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update box params +func (o *UpdateBoxParams) WithBody(body *models.HashicorpCloudVagrant20220930UpdateBoxRequest) *UpdateBoxParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update box params +func (o *UpdateBoxParams) SetBody(body *models.HashicorpCloudVagrant20220930UpdateBoxRequest) { + o.Body = body +} + +// WithBox adds the box to the update box params +func (o *UpdateBoxParams) WithBox(box string) *UpdateBoxParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the update box params +func (o *UpdateBoxParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the update box params +func (o *UpdateBoxParams) WithRegistry(registry string) *UpdateBoxParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the update box params +func (o *UpdateBoxParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateBoxParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_responses.go new file mode 100644 index 00000000..6eca9572 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/box_service/update_box_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package box_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// UpdateBoxReader is a Reader for the UpdateBox structure. +type UpdateBoxReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateBoxReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateBoxOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateBoxOK creates a UpdateBoxOK with default headers values +func NewUpdateBoxOK() *UpdateBoxOK { + return &UpdateBoxOK{} +} + +/*UpdateBoxOK handles this case with default header values. + +A successful response. +*/ +type UpdateBoxOK struct { + Payload *models.HashicorpCloudVagrant20220930UpdateBoxResponse +} + +func (o *UpdateBoxOK) Error() string { + return fmt.Sprintf("[PATCH /vagrant/2022-09-30/registry/{registry}/boxes/{box}][%d] updateBoxOK %+v", 200, o.Payload) +} + +func (o *UpdateBoxOK) GetPayload() *models.HashicorpCloudVagrant20220930UpdateBoxResponse { + return o.Payload +} + +func (o *UpdateBoxOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930UpdateBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/cloud_vagrant_box_registry_client.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/cloud_vagrant_box_registry_client.go new file mode 100644 index 00000000..acd6fb12 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/cloud_vagrant_box_registry_client.go @@ -0,0 +1,127 @@ +// 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-vagrant-box-registry/preview/2022-09-30/client/box_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service" +) + +// Default cloud vagrant box registry 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", "https"} + +// NewHTTPClient creates a new cloud vagrant box registry HTTP client. +func NewHTTPClient(formats strfmt.Registry) *CloudVagrantBoxRegistry { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud vagrant box registry HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *CloudVagrantBoxRegistry { + // 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 vagrant box registry client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *CloudVagrantBoxRegistry { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(CloudVagrantBoxRegistry) + cli.Transport = transport + cli.BoxService = box_service.New(transport, formats) + cli.ProviderService = provider_service.New(transport, formats) + cli.RegistryService = registry_service.New(transport, formats) + cli.VersionService = version_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 +} + +// CloudVagrantBoxRegistry is a client for cloud vagrant box registry +type CloudVagrantBoxRegistry struct { + BoxService box_service.ClientService + + ProviderService provider_service.ClientService + + RegistryService registry_service.ClientService + + VersionService version_service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *CloudVagrantBoxRegistry) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.BoxService.SetTransport(transport) + c.ProviderService.SetTransport(transport) + c.RegistryService.SetTransport(transport) + c.VersionService.SetTransport(transport) +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_parameters.go new file mode 100644 index 00000000..2c0de544 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewCompleteUploadParams creates a new CompleteUploadParams object +// with the default values initialized. +func NewCompleteUploadParams() *CompleteUploadParams { + var () + return &CompleteUploadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompleteUploadParamsWithTimeout creates a new CompleteUploadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompleteUploadParamsWithTimeout(timeout time.Duration) *CompleteUploadParams { + var () + return &CompleteUploadParams{ + + timeout: timeout, + } +} + +// NewCompleteUploadParamsWithContext creates a new CompleteUploadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompleteUploadParamsWithContext(ctx context.Context) *CompleteUploadParams { + var () + return &CompleteUploadParams{ + + Context: ctx, + } +} + +// NewCompleteUploadParamsWithHTTPClient creates a new CompleteUploadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompleteUploadParamsWithHTTPClient(client *http.Client) *CompleteUploadParams { + var () + return &CompleteUploadParams{ + HTTPClient: client, + } +} + +/*CompleteUploadParams contains all the parameters to send to the API endpoint +for the complete upload operation typically these are written to a http.Request +*/ +type CompleteUploadParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930CompleteUploadRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the complete upload params +func (o *CompleteUploadParams) WithTimeout(timeout time.Duration) *CompleteUploadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the complete upload params +func (o *CompleteUploadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the complete upload params +func (o *CompleteUploadParams) WithContext(ctx context.Context) *CompleteUploadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the complete upload params +func (o *CompleteUploadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the complete upload params +func (o *CompleteUploadParams) WithHTTPClient(client *http.Client) *CompleteUploadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the complete upload params +func (o *CompleteUploadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the complete upload params +func (o *CompleteUploadParams) WithBody(body *models.HashicorpCloudVagrant20220930CompleteUploadRequest) *CompleteUploadParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the complete upload params +func (o *CompleteUploadParams) SetBody(body *models.HashicorpCloudVagrant20220930CompleteUploadRequest) { + o.Body = body +} + +// WithBox adds the box to the complete upload params +func (o *CompleteUploadParams) WithBox(box string) *CompleteUploadParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the complete upload params +func (o *CompleteUploadParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the complete upload params +func (o *CompleteUploadParams) WithProvider(provider string) *CompleteUploadParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the complete upload params +func (o *CompleteUploadParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the complete upload params +func (o *CompleteUploadParams) WithRegistry(registry string) *CompleteUploadParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the complete upload params +func (o *CompleteUploadParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the complete upload params +func (o *CompleteUploadParams) WithVersion(version string) *CompleteUploadParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the complete upload params +func (o *CompleteUploadParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *CompleteUploadParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_responses.go new file mode 100644 index 00000000..24ef6982 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/complete_upload_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// CompleteUploadReader is a Reader for the CompleteUpload structure. +type CompleteUploadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompleteUploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompleteUploadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCompleteUploadOK creates a CompleteUploadOK with default headers values +func NewCompleteUploadOK() *CompleteUploadOK { + return &CompleteUploadOK{} +} + +/*CompleteUploadOK handles this case with default header values. + +A successful response. +*/ +type CompleteUploadOK struct { + Payload models.HashicorpCloudVagrant20220930CompleteUploadResponse +} + +func (o *CompleteUploadOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/complete][%d] completeUploadOK %+v", 200, o.Payload) +} + +func (o *CompleteUploadOK) GetPayload() models.HashicorpCloudVagrant20220930CompleteUploadResponse { + return o.Payload +} + +func (o *CompleteUploadOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_parameters.go new file mode 100644 index 00000000..e53c9c41 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewCreateProviderParams creates a new CreateProviderParams object +// with the default values initialized. +func NewCreateProviderParams() *CreateProviderParams { + var () + return &CreateProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateProviderParamsWithTimeout creates a new CreateProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateProviderParamsWithTimeout(timeout time.Duration) *CreateProviderParams { + var () + return &CreateProviderParams{ + + timeout: timeout, + } +} + +// NewCreateProviderParamsWithContext creates a new CreateProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateProviderParamsWithContext(ctx context.Context) *CreateProviderParams { + var () + return &CreateProviderParams{ + + Context: ctx, + } +} + +// NewCreateProviderParamsWithHTTPClient creates a new CreateProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateProviderParamsWithHTTPClient(client *http.Client) *CreateProviderParams { + var () + return &CreateProviderParams{ + HTTPClient: client, + } +} + +/*CreateProviderParams contains all the parameters to send to the API endpoint +for the create provider operation typically these are written to a http.Request +*/ +type CreateProviderParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930CreateProviderRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version to create the Provider in. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create provider params +func (o *CreateProviderParams) WithTimeout(timeout time.Duration) *CreateProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create provider params +func (o *CreateProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create provider params +func (o *CreateProviderParams) WithContext(ctx context.Context) *CreateProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create provider params +func (o *CreateProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create provider params +func (o *CreateProviderParams) WithHTTPClient(client *http.Client) *CreateProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create provider params +func (o *CreateProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create provider params +func (o *CreateProviderParams) WithBody(body *models.HashicorpCloudVagrant20220930CreateProviderRequest) *CreateProviderParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create provider params +func (o *CreateProviderParams) SetBody(body *models.HashicorpCloudVagrant20220930CreateProviderRequest) { + o.Body = body +} + +// WithBox adds the box to the create provider params +func (o *CreateProviderParams) WithBox(box string) *CreateProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the create provider params +func (o *CreateProviderParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the create provider params +func (o *CreateProviderParams) WithRegistry(registry string) *CreateProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the create provider params +func (o *CreateProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the create provider params +func (o *CreateProviderParams) WithVersion(version string) *CreateProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the create provider params +func (o *CreateProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateProviderParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_responses.go new file mode 100644 index 00000000..43d51aaa --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/create_provider_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// CreateProviderReader is a Reader for the CreateProvider structure. +type CreateProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateProviderOK creates a CreateProviderOK with default headers values +func NewCreateProviderOK() *CreateProviderOK { + return &CreateProviderOK{} +} + +/*CreateProviderOK handles this case with default header values. + +A successful response. +*/ +type CreateProviderOK struct { + Payload *models.HashicorpCloudVagrant20220930CreateProviderResponse +} + +func (o *CreateProviderOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers][%d] createProviderOK %+v", 200, o.Payload) +} + +func (o *CreateProviderOK) GetPayload() *models.HashicorpCloudVagrant20220930CreateProviderResponse { + return o.Payload +} + +func (o *CreateProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930CreateProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_parameters.go new file mode 100644 index 00000000..1d34e7da --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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" +) + +// NewDeleteProviderParams creates a new DeleteProviderParams object +// with the default values initialized. +func NewDeleteProviderParams() *DeleteProviderParams { + var () + return &DeleteProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteProviderParamsWithTimeout creates a new DeleteProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteProviderParamsWithTimeout(timeout time.Duration) *DeleteProviderParams { + var () + return &DeleteProviderParams{ + + timeout: timeout, + } +} + +// NewDeleteProviderParamsWithContext creates a new DeleteProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteProviderParamsWithContext(ctx context.Context) *DeleteProviderParams { + var () + return &DeleteProviderParams{ + + Context: ctx, + } +} + +// NewDeleteProviderParamsWithHTTPClient creates a new DeleteProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteProviderParamsWithHTTPClient(client *http.Client) *DeleteProviderParams { + var () + return &DeleteProviderParams{ + HTTPClient: client, + } +} + +/*DeleteProviderParams contains all the parameters to send to the API endpoint +for the delete provider operation typically these are written to a http.Request +*/ +type DeleteProviderParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete provider params +func (o *DeleteProviderParams) WithTimeout(timeout time.Duration) *DeleteProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete provider params +func (o *DeleteProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete provider params +func (o *DeleteProviderParams) WithContext(ctx context.Context) *DeleteProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete provider params +func (o *DeleteProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete provider params +func (o *DeleteProviderParams) WithHTTPClient(client *http.Client) *DeleteProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete provider params +func (o *DeleteProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the delete provider params +func (o *DeleteProviderParams) WithBox(box string) *DeleteProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the delete provider params +func (o *DeleteProviderParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the delete provider params +func (o *DeleteProviderParams) WithProvider(provider string) *DeleteProviderParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the delete provider params +func (o *DeleteProviderParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the delete provider params +func (o *DeleteProviderParams) WithRegistry(registry string) *DeleteProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the delete provider params +func (o *DeleteProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the delete provider params +func (o *DeleteProviderParams) WithVersion(version string) *DeleteProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the delete provider params +func (o *DeleteProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_responses.go new file mode 100644 index 00000000..e47fb514 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/delete_provider_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DeleteProviderReader is a Reader for the DeleteProvider structure. +type DeleteProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteProviderOK creates a DeleteProviderOK with default headers values +func NewDeleteProviderOK() *DeleteProviderOK { + return &DeleteProviderOK{} +} + +/*DeleteProviderOK handles this case with default header values. + +A successful response. +*/ +type DeleteProviderOK struct { + Payload models.HashicorpCloudVagrant20220930DeleteProviderResponse +} + +func (o *DeleteProviderOK) Error() string { + return fmt.Sprintf("[DELETE /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}][%d] deleteProviderOK %+v", 200, o.Payload) +} + +func (o *DeleteProviderOK) GetPayload() models.HashicorpCloudVagrant20220930DeleteProviderResponse { + return o.Payload +} + +func (o *DeleteProviderOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_parameters.go new file mode 100644 index 00000000..630b649b --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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" +) + +// NewDownloadProviderParams creates a new DownloadProviderParams object +// with the default values initialized. +func NewDownloadProviderParams() *DownloadProviderParams { + var () + return &DownloadProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadProviderParamsWithTimeout creates a new DownloadProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDownloadProviderParamsWithTimeout(timeout time.Duration) *DownloadProviderParams { + var () + return &DownloadProviderParams{ + + timeout: timeout, + } +} + +// NewDownloadProviderParamsWithContext creates a new DownloadProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewDownloadProviderParamsWithContext(ctx context.Context) *DownloadProviderParams { + var () + return &DownloadProviderParams{ + + Context: ctx, + } +} + +// NewDownloadProviderParamsWithHTTPClient creates a new DownloadProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDownloadProviderParamsWithHTTPClient(client *http.Client) *DownloadProviderParams { + var () + return &DownloadProviderParams{ + HTTPClient: client, + } +} + +/*DownloadProviderParams contains all the parameters to send to the API endpoint +for the download provider operation typically these are written to a http.Request +*/ +type DownloadProviderParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the download provider params +func (o *DownloadProviderParams) WithTimeout(timeout time.Duration) *DownloadProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download provider params +func (o *DownloadProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download provider params +func (o *DownloadProviderParams) WithContext(ctx context.Context) *DownloadProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download provider params +func (o *DownloadProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download provider params +func (o *DownloadProviderParams) WithHTTPClient(client *http.Client) *DownloadProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download provider params +func (o *DownloadProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the download provider params +func (o *DownloadProviderParams) WithBox(box string) *DownloadProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the download provider params +func (o *DownloadProviderParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the download provider params +func (o *DownloadProviderParams) WithProvider(provider string) *DownloadProviderParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the download provider params +func (o *DownloadProviderParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the download provider params +func (o *DownloadProviderParams) WithRegistry(registry string) *DownloadProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the download provider params +func (o *DownloadProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the download provider params +func (o *DownloadProviderParams) WithVersion(version string) *DownloadProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the download provider params +func (o *DownloadProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_responses.go new file mode 100644 index 00000000..571433d6 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/download_provider_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DownloadProviderReader is a Reader for the DownloadProvider structure. +type DownloadProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDownloadProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDownloadProviderOK creates a DownloadProviderOK with default headers values +func NewDownloadProviderOK() *DownloadProviderOK { + return &DownloadProviderOK{} +} + +/*DownloadProviderOK handles this case with default header values. + +A successful response. +*/ +type DownloadProviderOK struct { + Payload *models.HashicorpCloudVagrant20220930DownloadProviderResponse +} + +func (o *DownloadProviderOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/download][%d] downloadProviderOK %+v", 200, o.Payload) +} + +func (o *DownloadProviderOK) GetPayload() *models.HashicorpCloudVagrant20220930DownloadProviderResponse { + return o.Payload +} + +func (o *DownloadProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930DownloadProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_parameters.go new file mode 100644 index 00000000..86e8cf23 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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" +) + +// NewGetProviderParams creates a new GetProviderParams object +// with the default values initialized. +func NewGetProviderParams() *GetProviderParams { + var () + return &GetProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProviderParamsWithTimeout creates a new GetProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProviderParamsWithTimeout(timeout time.Duration) *GetProviderParams { + var () + return &GetProviderParams{ + + timeout: timeout, + } +} + +// NewGetProviderParamsWithContext creates a new GetProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProviderParamsWithContext(ctx context.Context) *GetProviderParams { + var () + return &GetProviderParams{ + + Context: ctx, + } +} + +// NewGetProviderParamsWithHTTPClient creates a new GetProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProviderParamsWithHTTPClient(client *http.Client) *GetProviderParams { + var () + return &GetProviderParams{ + HTTPClient: client, + } +} + +/*GetProviderParams contains all the parameters to send to the API endpoint +for the get provider operation typically these are written to a http.Request +*/ +type GetProviderParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get provider params +func (o *GetProviderParams) WithTimeout(timeout time.Duration) *GetProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get provider params +func (o *GetProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get provider params +func (o *GetProviderParams) WithContext(ctx context.Context) *GetProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get provider params +func (o *GetProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get provider params +func (o *GetProviderParams) WithHTTPClient(client *http.Client) *GetProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get provider params +func (o *GetProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the get provider params +func (o *GetProviderParams) WithBox(box string) *GetProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the get provider params +func (o *GetProviderParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the get provider params +func (o *GetProviderParams) WithProvider(provider string) *GetProviderParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the get provider params +func (o *GetProviderParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the get provider params +func (o *GetProviderParams) WithRegistry(registry string) *GetProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the get provider params +func (o *GetProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the get provider params +func (o *GetProviderParams) WithVersion(version string) *GetProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the get provider params +func (o *GetProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_responses.go new file mode 100644 index 00000000..a50b9dae --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/get_provider_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// GetProviderReader is a Reader for the GetProvider structure. +type GetProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetProviderOK creates a GetProviderOK with default headers values +func NewGetProviderOK() *GetProviderOK { + return &GetProviderOK{} +} + +/*GetProviderOK handles this case with default header values. + +A successful response. +*/ +type GetProviderOK struct { + Payload *models.HashicorpCloudVagrant20220930GetProviderResponse +} + +func (o *GetProviderOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}][%d] getProviderOK %+v", 200, o.Payload) +} + +func (o *GetProviderOK) GetPayload() *models.HashicorpCloudVagrant20220930GetProviderResponse { + return o.Payload +} + +func (o *GetProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930GetProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_parameters.go new file mode 100644 index 00000000..05165933 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_parameters.go @@ -0,0 +1,283 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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" +) + +// NewListProvidersParams creates a new ListProvidersParams object +// with the default values initialized. +func NewListProvidersParams() *ListProvidersParams { + var () + return &ListProvidersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListProvidersParamsWithTimeout creates a new ListProvidersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListProvidersParamsWithTimeout(timeout time.Duration) *ListProvidersParams { + var () + return &ListProvidersParams{ + + timeout: timeout, + } +} + +// NewListProvidersParamsWithContext creates a new ListProvidersParams object +// with the default values initialized, and the ability to set a context for a request +func NewListProvidersParamsWithContext(ctx context.Context) *ListProvidersParams { + var () + return &ListProvidersParams{ + + Context: ctx, + } +} + +// NewListProvidersParamsWithHTTPClient creates a new ListProvidersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListProvidersParamsWithHTTPClient(client *http.Client) *ListProvidersParams { + var () + return &ListProvidersParams{ + HTTPClient: client, + } +} + +/*ListProvidersParams contains all the parameters to send to the API endpoint +for the list providers operation typically these are written to a http.Request +*/ +type ListProvidersParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box 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 + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version to look up Providers in. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list providers params +func (o *ListProvidersParams) WithTimeout(timeout time.Duration) *ListProvidersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list providers params +func (o *ListProvidersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list providers params +func (o *ListProvidersParams) WithContext(ctx context.Context) *ListProvidersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list providers params +func (o *ListProvidersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list providers params +func (o *ListProvidersParams) WithHTTPClient(client *http.Client) *ListProvidersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list providers params +func (o *ListProvidersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the list providers params +func (o *ListProvidersParams) WithBox(box string) *ListProvidersParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the list providers params +func (o *ListProvidersParams) SetBox(box string) { + o.Box = box +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list providers params +func (o *ListProvidersParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListProvidersParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list providers params +func (o *ListProvidersParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list providers params +func (o *ListProvidersParams) WithPaginationPageSize(paginationPageSize *int64) *ListProvidersParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list providers params +func (o *ListProvidersParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list providers params +func (o *ListProvidersParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListProvidersParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list providers params +func (o *ListProvidersParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithRegistry adds the registry to the list providers params +func (o *ListProvidersParams) WithRegistry(registry string) *ListProvidersParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the list providers params +func (o *ListProvidersParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the list providers params +func (o *ListProvidersParams) WithVersion(version string) *ListProvidersParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the list providers params +func (o *ListProvidersParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProvidersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); 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 + } + } + + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_responses.go new file mode 100644 index 00000000..42117b71 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/list_providers_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ListProvidersReader is a Reader for the ListProviders structure. +type ListProvidersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProvidersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProvidersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListProvidersOK creates a ListProvidersOK with default headers values +func NewListProvidersOK() *ListProvidersOK { + return &ListProvidersOK{} +} + +/*ListProvidersOK handles this case with default header values. + +A successful response. +*/ +type ListProvidersOK struct { + Payload *models.HashicorpCloudVagrant20220930ListProvidersResponse +} + +func (o *ListProvidersOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers][%d] listProvidersOK %+v", 200, o.Payload) +} + +func (o *ListProvidersOK) GetPayload() *models.HashicorpCloudVagrant20220930ListProvidersResponse { + return o.Payload +} + +func (o *ListProvidersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ListProvidersResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/provider_service_client.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/provider_service_client.go new file mode 100644 index 00000000..8062b080 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/provider_service_client.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new provider service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for provider service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + CompleteUpload(params *CompleteUploadParams, authInfo runtime.ClientAuthInfoWriter) (*CompleteUploadOK, error) + + CreateProvider(params *CreateProviderParams, authInfo runtime.ClientAuthInfoWriter) (*CreateProviderOK, error) + + DeleteProvider(params *DeleteProviderParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProviderOK, error) + + DownloadProvider(params *DownloadProviderParams, authInfo runtime.ClientAuthInfoWriter) (*DownloadProviderOK, error) + + GetProvider(params *GetProviderParams, authInfo runtime.ClientAuthInfoWriter) (*GetProviderOK, error) + + ListProviders(params *ListProvidersParams, authInfo runtime.ClientAuthInfoWriter) (*ListProvidersOK, error) + + UpdateProvider(params *UpdateProviderParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateProviderOK, error) + + UploadProvider(params *UploadProviderParams, authInfo runtime.ClientAuthInfoWriter) (*UploadProviderOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CompleteUpload completes upload signals that the upload for a provider is complete +*/ +func (a *Client) CompleteUpload(params *CompleteUploadParams, authInfo runtime.ClientAuthInfoWriter) (*CompleteUploadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompleteUploadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompleteUpload", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/complete", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CompleteUploadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompleteUploadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CompleteUpload: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CreateProvider creates provider creates a provider in the specified version +*/ +func (a *Client) CreateProvider(params *CreateProviderParams, authInfo runtime.ClientAuthInfoWriter) (*CreateProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateProvider", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CreateProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteProvider deletes provider deletes a provider note that this deletes any data associated with a hosted provider so use with care +*/ +func (a *Client) DeleteProvider(params *DeleteProviderParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteProvider", + Method: "DELETE", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DownloadProvider downloads provider initiates a provider download + + For Hosted Providers, this is an atomic call that prepares the Provider +for download from the object storage. For External Providers, this is +simply a pass-through to the external download data supplied in the +External Provider record. +*/ +func (a *Client) DownloadProvider(params *DownloadProviderParams, authInfo runtime.ClientAuthInfoWriter) (*DownloadProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DownloadProvider", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/download", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DownloadProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DownloadProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DownloadProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetProvider gets provider fetches a provider for the specified version +*/ +func (a *Client) GetProvider(params *GetProviderParams, authInfo runtime.ClientAuthInfoWriter) (*GetProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetProvider", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListProviders lists providers lists all providers within a version +*/ +func (a *Client) ListProviders(params *ListProvidersParams, authInfo runtime.ClientAuthInfoWriter) (*ListProvidersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProvidersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListProviders", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListProvidersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListProvidersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListProviders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateProvider updates provider updates details about a specified provider + + Note that you don't use this to upload data to Hosted Providers, to do +that, use the Upload method. +*/ +func (a *Client) UpdateProvider(params *UpdateProviderParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UpdateProvider", + Method: "PATCH", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UpdateProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UploadProvider uploads provider initiates the upload of a hosted provider the service will return details that can be used to upload the data over HTTP after complete the caller should call complete upload + + Note that a Version needs to be unreleased in order to upload Providers to +it. + +Overwrite is permitted; old/existing data for a particular Provider will +be replaced with data from a new successful upload for that same +Provider. +*/ +func (a *Client) UploadProvider(params *UploadProviderParams, authInfo runtime.ClientAuthInfoWriter) (*UploadProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUploadProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "UploadProvider", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/upload", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UploadProviderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UploadProviderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UploadProvider: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_parameters.go new file mode 100644 index 00000000..ff4b27e4 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewUpdateProviderParams creates a new UpdateProviderParams object +// with the default values initialized. +func NewUpdateProviderParams() *UpdateProviderParams { + var () + return &UpdateProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateProviderParamsWithTimeout creates a new UpdateProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateProviderParamsWithTimeout(timeout time.Duration) *UpdateProviderParams { + var () + return &UpdateProviderParams{ + + timeout: timeout, + } +} + +// NewUpdateProviderParamsWithContext creates a new UpdateProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateProviderParamsWithContext(ctx context.Context) *UpdateProviderParams { + var () + return &UpdateProviderParams{ + + Context: ctx, + } +} + +// NewUpdateProviderParamsWithHTTPClient creates a new UpdateProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateProviderParamsWithHTTPClient(client *http.Client) *UpdateProviderParams { + var () + return &UpdateProviderParams{ + HTTPClient: client, + } +} + +/*UpdateProviderParams contains all the parameters to send to the API endpoint +for the update provider operation typically these are written to a http.Request +*/ +type UpdateProviderParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930UpdateProviderRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update provider params +func (o *UpdateProviderParams) WithTimeout(timeout time.Duration) *UpdateProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update provider params +func (o *UpdateProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update provider params +func (o *UpdateProviderParams) WithContext(ctx context.Context) *UpdateProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update provider params +func (o *UpdateProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update provider params +func (o *UpdateProviderParams) WithHTTPClient(client *http.Client) *UpdateProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update provider params +func (o *UpdateProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update provider params +func (o *UpdateProviderParams) WithBody(body *models.HashicorpCloudVagrant20220930UpdateProviderRequest) *UpdateProviderParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update provider params +func (o *UpdateProviderParams) SetBody(body *models.HashicorpCloudVagrant20220930UpdateProviderRequest) { + o.Body = body +} + +// WithBox adds the box to the update provider params +func (o *UpdateProviderParams) WithBox(box string) *UpdateProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the update provider params +func (o *UpdateProviderParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the update provider params +func (o *UpdateProviderParams) WithProvider(provider string) *UpdateProviderParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the update provider params +func (o *UpdateProviderParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the update provider params +func (o *UpdateProviderParams) WithRegistry(registry string) *UpdateProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the update provider params +func (o *UpdateProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the update provider params +func (o *UpdateProviderParams) WithVersion(version string) *UpdateProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the update provider params +func (o *UpdateProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateProviderParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_responses.go new file mode 100644 index 00000000..057f21b9 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/update_provider_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// UpdateProviderReader is a Reader for the UpdateProvider structure. +type UpdateProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateProviderOK creates a UpdateProviderOK with default headers values +func NewUpdateProviderOK() *UpdateProviderOK { + return &UpdateProviderOK{} +} + +/*UpdateProviderOK handles this case with default header values. + +A successful response. +*/ +type UpdateProviderOK struct { + Payload *models.HashicorpCloudVagrant20220930UpdateProviderResponse +} + +func (o *UpdateProviderOK) Error() string { + return fmt.Sprintf("[PATCH /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}][%d] updateProviderOK %+v", 200, o.Payload) +} + +func (o *UpdateProviderOK) GetPayload() *models.HashicorpCloudVagrant20220930UpdateProviderResponse { + return o.Payload +} + +func (o *UpdateProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930UpdateProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_parameters.go new file mode 100644 index 00000000..2f0a5be6 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewUploadProviderParams creates a new UploadProviderParams object +// with the default values initialized. +func NewUploadProviderParams() *UploadProviderParams { + var () + return &UploadProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUploadProviderParamsWithTimeout creates a new UploadProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUploadProviderParamsWithTimeout(timeout time.Duration) *UploadProviderParams { + var () + return &UploadProviderParams{ + + timeout: timeout, + } +} + +// NewUploadProviderParamsWithContext creates a new UploadProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewUploadProviderParamsWithContext(ctx context.Context) *UploadProviderParams { + var () + return &UploadProviderParams{ + + Context: ctx, + } +} + +// NewUploadProviderParamsWithHTTPClient creates a new UploadProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUploadProviderParamsWithHTTPClient(client *http.Client) *UploadProviderParams { + var () + return &UploadProviderParams{ + HTTPClient: client, + } +} + +/*UploadProviderParams contains all the parameters to send to the API endpoint +for the upload provider operation typically these are written to a http.Request +*/ +type UploadProviderParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930UploadProviderRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Provider + The name of the Provider. + + */ + Provider string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version for the Provider. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the upload provider params +func (o *UploadProviderParams) WithTimeout(timeout time.Duration) *UploadProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the upload provider params +func (o *UploadProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the upload provider params +func (o *UploadProviderParams) WithContext(ctx context.Context) *UploadProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the upload provider params +func (o *UploadProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the upload provider params +func (o *UploadProviderParams) WithHTTPClient(client *http.Client) *UploadProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the upload provider params +func (o *UploadProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the upload provider params +func (o *UploadProviderParams) WithBody(body *models.HashicorpCloudVagrant20220930UploadProviderRequest) *UploadProviderParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the upload provider params +func (o *UploadProviderParams) SetBody(body *models.HashicorpCloudVagrant20220930UploadProviderRequest) { + o.Body = body +} + +// WithBox adds the box to the upload provider params +func (o *UploadProviderParams) WithBox(box string) *UploadProviderParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the upload provider params +func (o *UploadProviderParams) SetBox(box string) { + o.Box = box +} + +// WithProvider adds the provider to the upload provider params +func (o *UploadProviderParams) WithProvider(provider string) *UploadProviderParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the upload provider params +func (o *UploadProviderParams) SetProvider(provider string) { + o.Provider = provider +} + +// WithRegistry adds the registry to the upload provider params +func (o *UploadProviderParams) WithRegistry(registry string) *UploadProviderParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the upload provider params +func (o *UploadProviderParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the upload provider params +func (o *UploadProviderParams) WithVersion(version string) *UploadProviderParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the upload provider params +func (o *UploadProviderParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *UploadProviderParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param provider + if err := r.SetPathParam("provider", o.Provider); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_responses.go new file mode 100644 index 00000000..9d4c2e98 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/provider_service/upload_provider_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package provider_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// UploadProviderReader is a Reader for the UploadProvider structure. +type UploadProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UploadProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUploadProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUploadProviderOK creates a UploadProviderOK with default headers values +func NewUploadProviderOK() *UploadProviderOK { + return &UploadProviderOK{} +} + +/*UploadProviderOK handles this case with default header values. + +A successful response. +*/ +type UploadProviderOK struct { + Payload *models.HashicorpCloudVagrant20220930UploadProviderResponse +} + +func (o *UploadProviderOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/providers/{provider}/upload][%d] uploadProviderOK %+v", 200, o.Payload) +} + +func (o *UploadProviderOK) GetPayload() *models.HashicorpCloudVagrant20220930UploadProviderResponse { + return o.Payload +} + +func (o *UploadProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930UploadProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_parameters.go new file mode 100644 index 00000000..890fefd2 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewActivateRegistryParams creates a new ActivateRegistryParams object +// with the default values initialized. +func NewActivateRegistryParams() *ActivateRegistryParams { + var () + return &ActivateRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewActivateRegistryParamsWithTimeout creates a new ActivateRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewActivateRegistryParamsWithTimeout(timeout time.Duration) *ActivateRegistryParams { + var () + return &ActivateRegistryParams{ + + timeout: timeout, + } +} + +// NewActivateRegistryParamsWithContext creates a new ActivateRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewActivateRegistryParamsWithContext(ctx context.Context) *ActivateRegistryParams { + var () + return &ActivateRegistryParams{ + + Context: ctx, + } +} + +// NewActivateRegistryParamsWithHTTPClient creates a new ActivateRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewActivateRegistryParamsWithHTTPClient(client *http.Client) *ActivateRegistryParams { + var () + return &ActivateRegistryParams{ + HTTPClient: client, + } +} + +/*ActivateRegistryParams contains all the parameters to send to the API endpoint +for the activate registry operation typically these are written to a http.Request +*/ +type ActivateRegistryParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930ActivateRegistryRequest + /*Registry + The name of the Registry to activate. + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the activate registry params +func (o *ActivateRegistryParams) WithTimeout(timeout time.Duration) *ActivateRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the activate registry params +func (o *ActivateRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the activate registry params +func (o *ActivateRegistryParams) WithContext(ctx context.Context) *ActivateRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the activate registry params +func (o *ActivateRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the activate registry params +func (o *ActivateRegistryParams) WithHTTPClient(client *http.Client) *ActivateRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the activate registry params +func (o *ActivateRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the activate registry params +func (o *ActivateRegistryParams) WithBody(body *models.HashicorpCloudVagrant20220930ActivateRegistryRequest) *ActivateRegistryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the activate registry params +func (o *ActivateRegistryParams) SetBody(body *models.HashicorpCloudVagrant20220930ActivateRegistryRequest) { + o.Body = body +} + +// WithRegistry adds the registry to the activate registry params +func (o *ActivateRegistryParams) WithRegistry(registry string) *ActivateRegistryParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the activate registry params +func (o *ActivateRegistryParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *ActivateRegistryParams) 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 registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_responses.go new file mode 100644 index 00000000..f9d83f6a --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/activate_registry_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ActivateRegistryReader is a Reader for the ActivateRegistry structure. +type ActivateRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ActivateRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewActivateRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewActivateRegistryOK creates a ActivateRegistryOK with default headers values +func NewActivateRegistryOK() *ActivateRegistryOK { + return &ActivateRegistryOK{} +} + +/*ActivateRegistryOK handles this case with default header values. + +A successful response. +*/ +type ActivateRegistryOK struct { + Payload models.HashicorpCloudVagrant20220930ActivateRegistryResponse +} + +func (o *ActivateRegistryOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/activate][%d] activateRegistryOK %+v", 200, o.Payload) +} + +func (o *ActivateRegistryOK) GetPayload() models.HashicorpCloudVagrant20220930ActivateRegistryResponse { + return o.Payload +} + +func (o *ActivateRegistryOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_parameters.go new file mode 100644 index 00000000..5fbde4e4 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewCreateRegistryParams creates a new CreateRegistryParams object +// with the default values initialized. +func NewCreateRegistryParams() *CreateRegistryParams { + var () + return &CreateRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateRegistryParamsWithTimeout creates a new CreateRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateRegistryParamsWithTimeout(timeout time.Duration) *CreateRegistryParams { + var () + return &CreateRegistryParams{ + + timeout: timeout, + } +} + +// NewCreateRegistryParamsWithContext creates a new CreateRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateRegistryParamsWithContext(ctx context.Context) *CreateRegistryParams { + var () + return &CreateRegistryParams{ + + Context: ctx, + } +} + +// NewCreateRegistryParamsWithHTTPClient creates a new CreateRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateRegistryParamsWithHTTPClient(client *http.Client) *CreateRegistryParams { + var () + return &CreateRegistryParams{ + HTTPClient: client, + } +} + +/*CreateRegistryParams contains all the parameters to send to the API endpoint +for the create registry operation typically these are written to a http.Request +*/ +type CreateRegistryParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930CreateRegistryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create registry params +func (o *CreateRegistryParams) WithTimeout(timeout time.Duration) *CreateRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create registry params +func (o *CreateRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create registry params +func (o *CreateRegistryParams) WithContext(ctx context.Context) *CreateRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create registry params +func (o *CreateRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create registry params +func (o *CreateRegistryParams) WithHTTPClient(client *http.Client) *CreateRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create registry params +func (o *CreateRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create registry params +func (o *CreateRegistryParams) WithBody(body *models.HashicorpCloudVagrant20220930CreateRegistryRequest) *CreateRegistryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create registry params +func (o *CreateRegistryParams) SetBody(body *models.HashicorpCloudVagrant20220930CreateRegistryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateRegistryParams) 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 + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_responses.go new file mode 100644 index 00000000..ce5d12cb --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/create_registry_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// CreateRegistryReader is a Reader for the CreateRegistry structure. +type CreateRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateRegistryOK creates a CreateRegistryOK with default headers values +func NewCreateRegistryOK() *CreateRegistryOK { + return &CreateRegistryOK{} +} + +/*CreateRegistryOK handles this case with default header values. + +A successful response. +*/ +type CreateRegistryOK struct { + Payload *models.HashicorpCloudVagrant20220930CreateRegistryResponse +} + +func (o *CreateRegistryOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry][%d] createRegistryOK %+v", 200, o.Payload) +} + +func (o *CreateRegistryOK) GetPayload() *models.HashicorpCloudVagrant20220930CreateRegistryResponse { + return o.Payload +} + +func (o *CreateRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930CreateRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_parameters.go new file mode 100644 index 00000000..a13d3ba8 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewDeactivateRegistryParams creates a new DeactivateRegistryParams object +// with the default values initialized. +func NewDeactivateRegistryParams() *DeactivateRegistryParams { + var () + return &DeactivateRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeactivateRegistryParamsWithTimeout creates a new DeactivateRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeactivateRegistryParamsWithTimeout(timeout time.Duration) *DeactivateRegistryParams { + var () + return &DeactivateRegistryParams{ + + timeout: timeout, + } +} + +// NewDeactivateRegistryParamsWithContext creates a new DeactivateRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeactivateRegistryParamsWithContext(ctx context.Context) *DeactivateRegistryParams { + var () + return &DeactivateRegistryParams{ + + Context: ctx, + } +} + +// NewDeactivateRegistryParamsWithHTTPClient creates a new DeactivateRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeactivateRegistryParamsWithHTTPClient(client *http.Client) *DeactivateRegistryParams { + var () + return &DeactivateRegistryParams{ + HTTPClient: client, + } +} + +/*DeactivateRegistryParams contains all the parameters to send to the API endpoint +for the deactivate registry operation typically these are written to a http.Request +*/ +type DeactivateRegistryParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930DeactivateRegistryRequest + /*Registry + The name of the Registry to deactivate. + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the deactivate registry params +func (o *DeactivateRegistryParams) WithTimeout(timeout time.Duration) *DeactivateRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the deactivate registry params +func (o *DeactivateRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the deactivate registry params +func (o *DeactivateRegistryParams) WithContext(ctx context.Context) *DeactivateRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the deactivate registry params +func (o *DeactivateRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the deactivate registry params +func (o *DeactivateRegistryParams) WithHTTPClient(client *http.Client) *DeactivateRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the deactivate registry params +func (o *DeactivateRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the deactivate registry params +func (o *DeactivateRegistryParams) WithBody(body *models.HashicorpCloudVagrant20220930DeactivateRegistryRequest) *DeactivateRegistryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the deactivate registry params +func (o *DeactivateRegistryParams) SetBody(body *models.HashicorpCloudVagrant20220930DeactivateRegistryRequest) { + o.Body = body +} + +// WithRegistry adds the registry to the deactivate registry params +func (o *DeactivateRegistryParams) WithRegistry(registry string) *DeactivateRegistryParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the deactivate registry params +func (o *DeactivateRegistryParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *DeactivateRegistryParams) 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 registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_responses.go new file mode 100644 index 00000000..c01977c0 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/deactivate_registry_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DeactivateRegistryReader is a Reader for the DeactivateRegistry structure. +type DeactivateRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeactivateRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeactivateRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeactivateRegistryOK creates a DeactivateRegistryOK with default headers values +func NewDeactivateRegistryOK() *DeactivateRegistryOK { + return &DeactivateRegistryOK{} +} + +/*DeactivateRegistryOK handles this case with default header values. + +A successful response. +*/ +type DeactivateRegistryOK struct { + Payload models.HashicorpCloudVagrant20220930DeactivateRegistryResponse +} + +func (o *DeactivateRegistryOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/deactivate][%d] deactivateRegistryOK %+v", 200, o.Payload) +} + +func (o *DeactivateRegistryOK) GetPayload() models.HashicorpCloudVagrant20220930DeactivateRegistryResponse { + return o.Payload +} + +func (o *DeactivateRegistryOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_parameters.go new file mode 100644 index 00000000..516a4b94 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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" +) + +// NewDeleteRegistryParams creates a new DeleteRegistryParams object +// with the default values initialized. +func NewDeleteRegistryParams() *DeleteRegistryParams { + var () + return &DeleteRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRegistryParamsWithTimeout creates a new DeleteRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteRegistryParamsWithTimeout(timeout time.Duration) *DeleteRegistryParams { + var () + return &DeleteRegistryParams{ + + timeout: timeout, + } +} + +// NewDeleteRegistryParamsWithContext creates a new DeleteRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteRegistryParamsWithContext(ctx context.Context) *DeleteRegistryParams { + var () + return &DeleteRegistryParams{ + + Context: ctx, + } +} + +// NewDeleteRegistryParamsWithHTTPClient creates a new DeleteRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteRegistryParamsWithHTTPClient(client *http.Client) *DeleteRegistryParams { + var () + return &DeleteRegistryParams{ + HTTPClient: client, + } +} + +/*DeleteRegistryParams contains all the parameters to send to the API endpoint +for the delete registry operation typically these are written to a http.Request +*/ +type DeleteRegistryParams struct { + + /*Registry + The name of the Registry to delete. + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete registry params +func (o *DeleteRegistryParams) WithTimeout(timeout time.Duration) *DeleteRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete registry params +func (o *DeleteRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete registry params +func (o *DeleteRegistryParams) WithContext(ctx context.Context) *DeleteRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete registry params +func (o *DeleteRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete registry params +func (o *DeleteRegistryParams) WithHTTPClient(client *http.Client) *DeleteRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete registry params +func (o *DeleteRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRegistry adds the registry to the delete registry params +func (o *DeleteRegistryParams) WithRegistry(registry string) *DeleteRegistryParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the delete registry params +func (o *DeleteRegistryParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_responses.go new file mode 100644 index 00000000..965262c4 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/delete_registry_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DeleteRegistryReader is a Reader for the DeleteRegistry structure. +type DeleteRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteRegistryOK creates a DeleteRegistryOK with default headers values +func NewDeleteRegistryOK() *DeleteRegistryOK { + return &DeleteRegistryOK{} +} + +/*DeleteRegistryOK handles this case with default header values. + +A successful response. +*/ +type DeleteRegistryOK struct { + Payload models.HashicorpCloudVagrant20220930DeleteRegistryResponse +} + +func (o *DeleteRegistryOK) Error() string { + return fmt.Sprintf("[DELETE /vagrant/2022-09-30/registry/{registry}][%d] deleteRegistryOK %+v", 200, o.Payload) +} + +func (o *DeleteRegistryOK) GetPayload() models.HashicorpCloudVagrant20220930DeleteRegistryResponse { + return o.Payload +} + +func (o *DeleteRegistryOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_parameters.go new file mode 100644 index 00000000..75b01e86 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_parameters.go @@ -0,0 +1,346 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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" +) + +// NewListRegistriesParams creates a new ListRegistriesParams object +// with the default values initialized. +func NewListRegistriesParams() *ListRegistriesParams { + var () + return &ListRegistriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListRegistriesParamsWithTimeout creates a new ListRegistriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListRegistriesParamsWithTimeout(timeout time.Duration) *ListRegistriesParams { + var () + return &ListRegistriesParams{ + + timeout: timeout, + } +} + +// NewListRegistriesParamsWithContext creates a new ListRegistriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListRegistriesParamsWithContext(ctx context.Context) *ListRegistriesParams { + var () + return &ListRegistriesParams{ + + Context: ctx, + } +} + +// NewListRegistriesParamsWithHTTPClient creates a new ListRegistriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListRegistriesParamsWithHTTPClient(client *http.Client) *ListRegistriesParams { + var () + return &ListRegistriesParams{ + HTTPClient: client, + } +} + +/*ListRegistriesParams contains all the parameters to send to the API endpoint +for the list registries operation typically these are written to a http.Request +*/ +type ListRegistriesParams struct { + + /*LocationOrganizationID + organization_id is the id of the organization. + + */ + LocationOrganizationID *string + /*LocationProjectID + project_id is the projects id. + + */ + LocationProjectID *string + /*LocationRegionProvider + provider is the named cloud provider ("aws", "gcp", "azure"). + + */ + LocationRegionProvider *string + /*LocationRegionRegion + region is the cloud region ("us-west1", "us-east1"). + + */ + LocationRegionRegion *string + /*PaginationNextPageToken + Specifies a page token to use to retrieve the next page. Set this to the + `next_page_token` returned by previous list requests to get the next page of + results. If set, `previous_page_token` must not be set. + + */ + PaginationNextPageToken *string + /*PaginationPageSize + The max number of results per page that should be returned. If the number + of available results is larger than `page_size`, a `next_page_token` is + returned which can be used to get the next page of results in subsequent + requests. A value of zero will cause `page_size` to be defaulted. + + */ + PaginationPageSize *int64 + /*PaginationPreviousPageToken + Specifies a page token to use to retrieve the previous page. Set this to + the `previous_page_token` returned by previous list requests to get the + previous page of results. If set, `next_page_token` must not be set. + + */ + PaginationPreviousPageToken *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list registries params +func (o *ListRegistriesParams) WithTimeout(timeout time.Duration) *ListRegistriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list registries params +func (o *ListRegistriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list registries params +func (o *ListRegistriesParams) WithContext(ctx context.Context) *ListRegistriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list registries params +func (o *ListRegistriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list registries params +func (o *ListRegistriesParams) WithHTTPClient(client *http.Client) *ListRegistriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list registries params +func (o *ListRegistriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocationOrganizationID adds the locationOrganizationID to the list registries params +func (o *ListRegistriesParams) WithLocationOrganizationID(locationOrganizationID *string) *ListRegistriesParams { + o.SetLocationOrganizationID(locationOrganizationID) + return o +} + +// SetLocationOrganizationID adds the locationOrganizationId to the list registries params +func (o *ListRegistriesParams) SetLocationOrganizationID(locationOrganizationID *string) { + o.LocationOrganizationID = locationOrganizationID +} + +// WithLocationProjectID adds the locationProjectID to the list registries params +func (o *ListRegistriesParams) WithLocationProjectID(locationProjectID *string) *ListRegistriesParams { + o.SetLocationProjectID(locationProjectID) + return o +} + +// SetLocationProjectID adds the locationProjectId to the list registries params +func (o *ListRegistriesParams) SetLocationProjectID(locationProjectID *string) { + o.LocationProjectID = locationProjectID +} + +// WithLocationRegionProvider adds the locationRegionProvider to the list registries params +func (o *ListRegistriesParams) WithLocationRegionProvider(locationRegionProvider *string) *ListRegistriesParams { + o.SetLocationRegionProvider(locationRegionProvider) + return o +} + +// SetLocationRegionProvider adds the locationRegionProvider to the list registries params +func (o *ListRegistriesParams) SetLocationRegionProvider(locationRegionProvider *string) { + o.LocationRegionProvider = locationRegionProvider +} + +// WithLocationRegionRegion adds the locationRegionRegion to the list registries params +func (o *ListRegistriesParams) WithLocationRegionRegion(locationRegionRegion *string) *ListRegistriesParams { + o.SetLocationRegionRegion(locationRegionRegion) + return o +} + +// SetLocationRegionRegion adds the locationRegionRegion to the list registries params +func (o *ListRegistriesParams) SetLocationRegionRegion(locationRegionRegion *string) { + o.LocationRegionRegion = locationRegionRegion +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list registries params +func (o *ListRegistriesParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListRegistriesParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list registries params +func (o *ListRegistriesParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list registries params +func (o *ListRegistriesParams) WithPaginationPageSize(paginationPageSize *int64) *ListRegistriesParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list registries params +func (o *ListRegistriesParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list registries params +func (o *ListRegistriesParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListRegistriesParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list registries params +func (o *ListRegistriesParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRegistriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LocationOrganizationID != nil { + + // query param location.organization_id + var qrLocationOrganizationID string + if o.LocationOrganizationID != nil { + qrLocationOrganizationID = *o.LocationOrganizationID + } + qLocationOrganizationID := qrLocationOrganizationID + if qLocationOrganizationID != "" { + if err := r.SetQueryParam("location.organization_id", qLocationOrganizationID); err != nil { + return err + } + } + + } + + if o.LocationProjectID != nil { + + // query param location.project_id + var qrLocationProjectID string + if o.LocationProjectID != nil { + qrLocationProjectID = *o.LocationProjectID + } + qLocationProjectID := qrLocationProjectID + if qLocationProjectID != "" { + if err := r.SetQueryParam("location.project_id", qLocationProjectID); err != nil { + return err + } + } + + } + + if o.LocationRegionProvider != nil { + + // query param location.region.provider + var qrLocationRegionProvider string + if o.LocationRegionProvider != nil { + qrLocationRegionProvider = *o.LocationRegionProvider + } + qLocationRegionProvider := qrLocationRegionProvider + if qLocationRegionProvider != "" { + if err := r.SetQueryParam("location.region.provider", qLocationRegionProvider); err != nil { + return err + } + } + + } + + if o.LocationRegionRegion != nil { + + // query param location.region.region + var qrLocationRegionRegion string + if o.LocationRegionRegion != nil { + qrLocationRegionRegion = *o.LocationRegionRegion + } + qLocationRegionRegion := qrLocationRegionRegion + if qLocationRegionRegion != "" { + if err := r.SetQueryParam("location.region.region", qLocationRegionRegion); err != nil { + return err + } + } + + } + + if o.PaginationNextPageToken != nil { + + // query param pagination.next_page_token + var qrPaginationNextPageToken string + if o.PaginationNextPageToken != nil { + qrPaginationNextPageToken = *o.PaginationNextPageToken + } + qPaginationNextPageToken := qrPaginationNextPageToken + if qPaginationNextPageToken != "" { + if err := r.SetQueryParam("pagination.next_page_token", qPaginationNextPageToken); err != nil { + return err + } + } + + } + + if o.PaginationPageSize != nil { + + // query param pagination.page_size + var qrPaginationPageSize int64 + if o.PaginationPageSize != nil { + qrPaginationPageSize = *o.PaginationPageSize + } + qPaginationPageSize := swag.FormatInt64(qrPaginationPageSize) + if qPaginationPageSize != "" { + if err := r.SetQueryParam("pagination.page_size", qPaginationPageSize); err != nil { + return err + } + } + + } + + if o.PaginationPreviousPageToken != nil { + + // query param pagination.previous_page_token + var qrPaginationPreviousPageToken string + if o.PaginationPreviousPageToken != nil { + qrPaginationPreviousPageToken = *o.PaginationPreviousPageToken + } + qPaginationPreviousPageToken := qrPaginationPreviousPageToken + if qPaginationPreviousPageToken != "" { + if err := r.SetQueryParam("pagination.previous_page_token", qPaginationPreviousPageToken); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_responses.go new file mode 100644 index 00000000..3997c529 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/list_registries_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ListRegistriesReader is a Reader for the ListRegistries structure. +type ListRegistriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRegistriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRegistriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRegistriesOK creates a ListRegistriesOK with default headers values +func NewListRegistriesOK() *ListRegistriesOK { + return &ListRegistriesOK{} +} + +/*ListRegistriesOK handles this case with default header values. + +A successful response. +*/ +type ListRegistriesOK struct { + Payload *models.HashicorpCloudVagrant20220930ListRegistriesResponse +} + +func (o *ListRegistriesOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry][%d] listRegistriesOK %+v", 200, o.Payload) +} + +func (o *ListRegistriesOK) GetPayload() *models.HashicorpCloudVagrant20220930ListRegistriesResponse { + return o.Payload +} + +func (o *ListRegistriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ListRegistriesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_parameters.go new file mode 100644 index 00000000..141f1841 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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" +) + +// NewReadRegistryParams creates a new ReadRegistryParams object +// with the default values initialized. +func NewReadRegistryParams() *ReadRegistryParams { + var () + return &ReadRegistryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReadRegistryParamsWithTimeout creates a new ReadRegistryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReadRegistryParamsWithTimeout(timeout time.Duration) *ReadRegistryParams { + var () + return &ReadRegistryParams{ + + timeout: timeout, + } +} + +// NewReadRegistryParamsWithContext creates a new ReadRegistryParams object +// with the default values initialized, and the ability to set a context for a request +func NewReadRegistryParamsWithContext(ctx context.Context) *ReadRegistryParams { + var () + return &ReadRegistryParams{ + + Context: ctx, + } +} + +// NewReadRegistryParamsWithHTTPClient creates a new ReadRegistryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReadRegistryParamsWithHTTPClient(client *http.Client) *ReadRegistryParams { + var () + return &ReadRegistryParams{ + HTTPClient: client, + } +} + +/*ReadRegistryParams contains all the parameters to send to the API endpoint +for the read registry operation typically these are written to a http.Request +*/ +type ReadRegistryParams struct { + + /*Registry + The name of the Registry to look up. + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the read registry params +func (o *ReadRegistryParams) WithTimeout(timeout time.Duration) *ReadRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read registry params +func (o *ReadRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read registry params +func (o *ReadRegistryParams) WithContext(ctx context.Context) *ReadRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read registry params +func (o *ReadRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read registry params +func (o *ReadRegistryParams) WithHTTPClient(client *http.Client) *ReadRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read registry params +func (o *ReadRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRegistry adds the registry to the read registry params +func (o *ReadRegistryParams) WithRegistry(registry string) *ReadRegistryParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the read registry params +func (o *ReadRegistryParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_responses.go new file mode 100644 index 00000000..7601bb36 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/read_registry_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ReadRegistryReader is a Reader for the ReadRegistry structure. +type ReadRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReadRegistryOK creates a ReadRegistryOK with default headers values +func NewReadRegistryOK() *ReadRegistryOK { + return &ReadRegistryOK{} +} + +/*ReadRegistryOK handles this case with default header values. + +A successful response. +*/ +type ReadRegistryOK struct { + Payload *models.HashicorpCloudVagrant20220930ReadRegistryResponse +} + +func (o *ReadRegistryOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}][%d] readRegistryOK %+v", 200, o.Payload) +} + +func (o *ReadRegistryOK) GetPayload() *models.HashicorpCloudVagrant20220930ReadRegistryResponse { + return o.Payload +} + +func (o *ReadRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ReadRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/registry_service_client.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/registry_service_client.go new file mode 100644 index 00000000..0a5d85e6 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/registry_service/registry_service_client.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package registry_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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new registry service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for registry service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + ActivateRegistry(params *ActivateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*ActivateRegistryOK, error) + + CreateRegistry(params *CreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*CreateRegistryOK, error) + + DeactivateRegistry(params *DeactivateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeactivateRegistryOK, error) + + DeleteRegistry(params *DeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRegistryOK, error) + + ListRegistries(params *ListRegistriesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistriesOK, error) + + ReadRegistry(params *ReadRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*ReadRegistryOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + ActivateRegistry activates registry activates a vagrant box registry at the location specified the registry must already exist and must be currently disabled + + Activation will re-enable a Registry, allowing requests and +accruing charges as normal. +*/ +func (a *Client) ActivateRegistry(params *ActivateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*ActivateRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewActivateRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ActivateRegistry", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/activate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ActivateRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ActivateRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ActivateRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CreateRegistry creates registry creates a vagrant box registry at the location specified +*/ +func (a *Client) CreateRegistry(params *CreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*CreateRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateRegistry", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CreateRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeactivateRegistry deactivates registry deactivates a vagrant box registry at the location specified the registry must already exist and must be currently enabled + + Deactivation will disable a Registry but not delete its data. +All requests to the Registry will return not-found errors. This +can be used to temporarily block access to a Registry to prevent +access-related charges to the Registry. +*/ +func (a *Client) DeactivateRegistry(params *DeactivateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeactivateRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeactivateRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeactivateRegistry", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/deactivate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeactivateRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeactivateRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeactivateRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteRegistry deletes registry deletes a vagrant box registry at the location specified + + Deletion removes the Registry and all of its Box, Version, and +Provider data, including any Hosted Providers and their +respective data. This operation is permanent and cannot be +undone. +*/ +func (a *Client) DeleteRegistry(params *DeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteRegistry", + Method: "DELETE", + PathPattern: "/vagrant/2022-09-30/registry/{registry}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListRegistries lists registries lists available vagrant box registries in a particular project +*/ +func (a *Client) ListRegistries(params *ListRegistriesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListRegistriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListRegistries", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListRegistriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListRegistriesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListRegistries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReadRegistry reads registry reads a vagrant box registry by its name +*/ +func (a *Client) ReadRegistry(params *ReadRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*ReadRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadRegistryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ReadRegistry", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ReadRegistryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReadRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_parameters.go new file mode 100644 index 00000000..4eaa7670 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewCreateVersionParams creates a new CreateVersionParams object +// with the default values initialized. +func NewCreateVersionParams() *CreateVersionParams { + var () + return &CreateVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateVersionParamsWithTimeout creates a new CreateVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateVersionParamsWithTimeout(timeout time.Duration) *CreateVersionParams { + var () + return &CreateVersionParams{ + + timeout: timeout, + } +} + +// NewCreateVersionParamsWithContext creates a new CreateVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateVersionParamsWithContext(ctx context.Context) *CreateVersionParams { + var () + return &CreateVersionParams{ + + Context: ctx, + } +} + +// NewCreateVersionParamsWithHTTPClient creates a new CreateVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateVersionParamsWithHTTPClient(client *http.Client) *CreateVersionParams { + var () + return &CreateVersionParams{ + HTTPClient: client, + } +} + +/*CreateVersionParams contains all the parameters to send to the API endpoint +for the create version operation typically these are written to a http.Request +*/ +type CreateVersionParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930CreateVersionRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create version params +func (o *CreateVersionParams) WithTimeout(timeout time.Duration) *CreateVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create version params +func (o *CreateVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create version params +func (o *CreateVersionParams) WithContext(ctx context.Context) *CreateVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create version params +func (o *CreateVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create version params +func (o *CreateVersionParams) WithHTTPClient(client *http.Client) *CreateVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create version params +func (o *CreateVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create version params +func (o *CreateVersionParams) WithBody(body *models.HashicorpCloudVagrant20220930CreateVersionRequest) *CreateVersionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create version params +func (o *CreateVersionParams) SetBody(body *models.HashicorpCloudVagrant20220930CreateVersionRequest) { + o.Body = body +} + +// WithBox adds the box to the create version params +func (o *CreateVersionParams) WithBox(box string) *CreateVersionParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the create version params +func (o *CreateVersionParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the create version params +func (o *CreateVersionParams) WithRegistry(registry string) *CreateVersionParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the create version params +func (o *CreateVersionParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateVersionParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_responses.go new file mode 100644 index 00000000..13e484ae --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/create_version_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// CreateVersionReader is a Reader for the CreateVersion structure. +type CreateVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateVersionOK creates a CreateVersionOK with default headers values +func NewCreateVersionOK() *CreateVersionOK { + return &CreateVersionOK{} +} + +/*CreateVersionOK handles this case with default header values. + +A successful response. +*/ +type CreateVersionOK struct { + Payload *models.HashicorpCloudVagrant20220930CreateVersionResponse +} + +func (o *CreateVersionOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions][%d] createVersionOK %+v", 200, o.Payload) +} + +func (o *CreateVersionOK) GetPayload() *models.HashicorpCloudVagrant20220930CreateVersionResponse { + return o.Payload +} + +func (o *CreateVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930CreateVersionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_parameters.go new file mode 100644 index 00000000..5eddf663 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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" +) + +// NewDeleteVersionParams creates a new DeleteVersionParams object +// with the default values initialized. +func NewDeleteVersionParams() *DeleteVersionParams { + var () + return &DeleteVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteVersionParamsWithTimeout creates a new DeleteVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteVersionParamsWithTimeout(timeout time.Duration) *DeleteVersionParams { + var () + return &DeleteVersionParams{ + + timeout: timeout, + } +} + +// NewDeleteVersionParamsWithContext creates a new DeleteVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteVersionParamsWithContext(ctx context.Context) *DeleteVersionParams { + var () + return &DeleteVersionParams{ + + Context: ctx, + } +} + +// NewDeleteVersionParamsWithHTTPClient creates a new DeleteVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteVersionParamsWithHTTPClient(client *http.Client) *DeleteVersionParams { + var () + return &DeleteVersionParams{ + HTTPClient: client, + } +} + +/*DeleteVersionParams contains all the parameters to send to the API endpoint +for the delete version operation typically these are written to a http.Request +*/ +type DeleteVersionParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version to delete. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete version params +func (o *DeleteVersionParams) WithTimeout(timeout time.Duration) *DeleteVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete version params +func (o *DeleteVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete version params +func (o *DeleteVersionParams) WithContext(ctx context.Context) *DeleteVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete version params +func (o *DeleteVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete version params +func (o *DeleteVersionParams) WithHTTPClient(client *http.Client) *DeleteVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete version params +func (o *DeleteVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the delete version params +func (o *DeleteVersionParams) WithBox(box string) *DeleteVersionParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the delete version params +func (o *DeleteVersionParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the delete version params +func (o *DeleteVersionParams) WithRegistry(registry string) *DeleteVersionParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the delete version params +func (o *DeleteVersionParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the delete version params +func (o *DeleteVersionParams) WithVersion(version string) *DeleteVersionParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the delete version params +func (o *DeleteVersionParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_responses.go new file mode 100644 index 00000000..2a68bff2 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/delete_version_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// DeleteVersionReader is a Reader for the DeleteVersion structure. +type DeleteVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteVersionOK creates a DeleteVersionOK with default headers values +func NewDeleteVersionOK() *DeleteVersionOK { + return &DeleteVersionOK{} +} + +/*DeleteVersionOK handles this case with default header values. + +A successful response. +*/ +type DeleteVersionOK struct { + Payload models.HashicorpCloudVagrant20220930DeleteVersionResponse +} + +func (o *DeleteVersionOK) Error() string { + return fmt.Sprintf("[DELETE /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}][%d] deleteVersionOK %+v", 200, o.Payload) +} + +func (o *DeleteVersionOK) GetPayload() models.HashicorpCloudVagrant20220930DeleteVersionResponse { + return o.Payload +} + +func (o *DeleteVersionOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_parameters.go new file mode 100644 index 00000000..82486bc1 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_parameters.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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" +) + +// NewListVersionsParams creates a new ListVersionsParams object +// with the default values initialized. +func NewListVersionsParams() *ListVersionsParams { + var () + return &ListVersionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListVersionsParamsWithTimeout creates a new ListVersionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListVersionsParamsWithTimeout(timeout time.Duration) *ListVersionsParams { + var () + return &ListVersionsParams{ + + timeout: timeout, + } +} + +// NewListVersionsParamsWithContext creates a new ListVersionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListVersionsParamsWithContext(ctx context.Context) *ListVersionsParams { + var () + return &ListVersionsParams{ + + Context: ctx, + } +} + +// NewListVersionsParamsWithHTTPClient creates a new ListVersionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListVersionsParamsWithHTTPClient(client *http.Client) *ListVersionsParams { + var () + return &ListVersionsParams{ + HTTPClient: client, + } +} + +/*ListVersionsParams contains all the parameters to send to the API endpoint +for the list versions operation typically these are written to a http.Request +*/ +type ListVersionsParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box 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 + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list versions params +func (o *ListVersionsParams) WithTimeout(timeout time.Duration) *ListVersionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list versions params +func (o *ListVersionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list versions params +func (o *ListVersionsParams) WithContext(ctx context.Context) *ListVersionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list versions params +func (o *ListVersionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list versions params +func (o *ListVersionsParams) WithHTTPClient(client *http.Client) *ListVersionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list versions params +func (o *ListVersionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the list versions params +func (o *ListVersionsParams) WithBox(box string) *ListVersionsParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the list versions params +func (o *ListVersionsParams) SetBox(box string) { + o.Box = box +} + +// WithPaginationNextPageToken adds the paginationNextPageToken to the list versions params +func (o *ListVersionsParams) WithPaginationNextPageToken(paginationNextPageToken *string) *ListVersionsParams { + o.SetPaginationNextPageToken(paginationNextPageToken) + return o +} + +// SetPaginationNextPageToken adds the paginationNextPageToken to the list versions params +func (o *ListVersionsParams) SetPaginationNextPageToken(paginationNextPageToken *string) { + o.PaginationNextPageToken = paginationNextPageToken +} + +// WithPaginationPageSize adds the paginationPageSize to the list versions params +func (o *ListVersionsParams) WithPaginationPageSize(paginationPageSize *int64) *ListVersionsParams { + o.SetPaginationPageSize(paginationPageSize) + return o +} + +// SetPaginationPageSize adds the paginationPageSize to the list versions params +func (o *ListVersionsParams) SetPaginationPageSize(paginationPageSize *int64) { + o.PaginationPageSize = paginationPageSize +} + +// WithPaginationPreviousPageToken adds the paginationPreviousPageToken to the list versions params +func (o *ListVersionsParams) WithPaginationPreviousPageToken(paginationPreviousPageToken *string) *ListVersionsParams { + o.SetPaginationPreviousPageToken(paginationPreviousPageToken) + return o +} + +// SetPaginationPreviousPageToken adds the paginationPreviousPageToken to the list versions params +func (o *ListVersionsParams) SetPaginationPreviousPageToken(paginationPreviousPageToken *string) { + o.PaginationPreviousPageToken = paginationPreviousPageToken +} + +// WithRegistry adds the registry to the list versions params +func (o *ListVersionsParams) WithRegistry(registry string) *ListVersionsParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the list versions params +func (o *ListVersionsParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WriteToRequest writes these params to a swagger request +func (o *ListVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); 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 + } + } + + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_responses.go new file mode 100644 index 00000000..140df6ef --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/list_versions_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ListVersionsReader is a Reader for the ListVersions structure. +type ListVersionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListVersionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListVersionsOK creates a ListVersionsOK with default headers values +func NewListVersionsOK() *ListVersionsOK { + return &ListVersionsOK{} +} + +/*ListVersionsOK handles this case with default header values. + +A successful response. +*/ +type ListVersionsOK struct { + Payload *models.HashicorpCloudVagrant20220930ListVersionsResponse +} + +func (o *ListVersionsOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions][%d] listVersionsOK %+v", 200, o.Payload) +} + +func (o *ListVersionsOK) GetPayload() *models.HashicorpCloudVagrant20220930ListVersionsResponse { + return o.Payload +} + +func (o *ListVersionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ListVersionsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_parameters.go new file mode 100644 index 00000000..8ccf2bf8 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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" +) + +// NewReadVersionParams creates a new ReadVersionParams object +// with the default values initialized. +func NewReadVersionParams() *ReadVersionParams { + var () + return &ReadVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReadVersionParamsWithTimeout creates a new ReadVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReadVersionParamsWithTimeout(timeout time.Duration) *ReadVersionParams { + var () + return &ReadVersionParams{ + + timeout: timeout, + } +} + +// NewReadVersionParamsWithContext creates a new ReadVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewReadVersionParamsWithContext(ctx context.Context) *ReadVersionParams { + var () + return &ReadVersionParams{ + + Context: ctx, + } +} + +// NewReadVersionParamsWithHTTPClient creates a new ReadVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReadVersionParamsWithHTTPClient(client *http.Client) *ReadVersionParams { + var () + return &ReadVersionParams{ + HTTPClient: client, + } +} + +/*ReadVersionParams contains all the parameters to send to the API endpoint +for the read version operation typically these are written to a http.Request +*/ +type ReadVersionParams struct { + + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the version to look up. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the read version params +func (o *ReadVersionParams) WithTimeout(timeout time.Duration) *ReadVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read version params +func (o *ReadVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read version params +func (o *ReadVersionParams) WithContext(ctx context.Context) *ReadVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read version params +func (o *ReadVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read version params +func (o *ReadVersionParams) WithHTTPClient(client *http.Client) *ReadVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read version params +func (o *ReadVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBox adds the box to the read version params +func (o *ReadVersionParams) WithBox(box string) *ReadVersionParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the read version params +func (o *ReadVersionParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the read version params +func (o *ReadVersionParams) WithRegistry(registry string) *ReadVersionParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the read version params +func (o *ReadVersionParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the read version params +func (o *ReadVersionParams) WithVersion(version string) *ReadVersionParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the read version params +func (o *ReadVersionParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_responses.go new file mode 100644 index 00000000..92fad7f2 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/read_version_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ReadVersionReader is a Reader for the ReadVersion structure. +type ReadVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReadVersionOK creates a ReadVersionOK with default headers values +func NewReadVersionOK() *ReadVersionOK { + return &ReadVersionOK{} +} + +/*ReadVersionOK handles this case with default header values. + +A successful response. +*/ +type ReadVersionOK struct { + Payload *models.HashicorpCloudVagrant20220930ReadVersionResponse +} + +func (o *ReadVersionOK) Error() string { + return fmt.Sprintf("[GET /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}][%d] readVersionOK %+v", 200, o.Payload) +} + +func (o *ReadVersionOK) GetPayload() *models.HashicorpCloudVagrant20220930ReadVersionResponse { + return o.Payload +} + +func (o *ReadVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HashicorpCloudVagrant20220930ReadVersionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_parameters.go new file mode 100644 index 00000000..cc9c56b1 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewReleaseVersionParams creates a new ReleaseVersionParams object +// with the default values initialized. +func NewReleaseVersionParams() *ReleaseVersionParams { + var () + return &ReleaseVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReleaseVersionParamsWithTimeout creates a new ReleaseVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReleaseVersionParamsWithTimeout(timeout time.Duration) *ReleaseVersionParams { + var () + return &ReleaseVersionParams{ + + timeout: timeout, + } +} + +// NewReleaseVersionParamsWithContext creates a new ReleaseVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewReleaseVersionParamsWithContext(ctx context.Context) *ReleaseVersionParams { + var () + return &ReleaseVersionParams{ + + Context: ctx, + } +} + +// NewReleaseVersionParamsWithHTTPClient creates a new ReleaseVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReleaseVersionParamsWithHTTPClient(client *http.Client) *ReleaseVersionParams { + var () + return &ReleaseVersionParams{ + HTTPClient: client, + } +} + +/*ReleaseVersionParams contains all the parameters to send to the API endpoint +for the release version operation typically these are written to a http.Request +*/ +type ReleaseVersionParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930ReleaseVersionRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version to release. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the release version params +func (o *ReleaseVersionParams) WithTimeout(timeout time.Duration) *ReleaseVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the release version params +func (o *ReleaseVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the release version params +func (o *ReleaseVersionParams) WithContext(ctx context.Context) *ReleaseVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the release version params +func (o *ReleaseVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the release version params +func (o *ReleaseVersionParams) WithHTTPClient(client *http.Client) *ReleaseVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the release version params +func (o *ReleaseVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the release version params +func (o *ReleaseVersionParams) WithBody(body *models.HashicorpCloudVagrant20220930ReleaseVersionRequest) *ReleaseVersionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the release version params +func (o *ReleaseVersionParams) SetBody(body *models.HashicorpCloudVagrant20220930ReleaseVersionRequest) { + o.Body = body +} + +// WithBox adds the box to the release version params +func (o *ReleaseVersionParams) WithBox(box string) *ReleaseVersionParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the release version params +func (o *ReleaseVersionParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the release version params +func (o *ReleaseVersionParams) WithRegistry(registry string) *ReleaseVersionParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the release version params +func (o *ReleaseVersionParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the release version params +func (o *ReleaseVersionParams) WithVersion(version string) *ReleaseVersionParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the release version params +func (o *ReleaseVersionParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *ReleaseVersionParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_responses.go new file mode 100644 index 00000000..62505641 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/release_version_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// ReleaseVersionReader is a Reader for the ReleaseVersion structure. +type ReleaseVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReleaseVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReleaseVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReleaseVersionOK creates a ReleaseVersionOK with default headers values +func NewReleaseVersionOK() *ReleaseVersionOK { + return &ReleaseVersionOK{} +} + +/*ReleaseVersionOK handles this case with default header values. + +A successful response. +*/ +type ReleaseVersionOK struct { + Payload models.HashicorpCloudVagrant20220930ReleaseVersionResponse +} + +func (o *ReleaseVersionOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/release][%d] releaseVersionOK %+v", 200, o.Payload) +} + +func (o *ReleaseVersionOK) GetPayload() models.HashicorpCloudVagrant20220930ReleaseVersionResponse { + return o.Payload +} + +func (o *ReleaseVersionOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_parameters.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_parameters.go new file mode 100644 index 00000000..c11cf312 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// NewRevokeVersionParams creates a new RevokeVersionParams object +// with the default values initialized. +func NewRevokeVersionParams() *RevokeVersionParams { + var () + return &RevokeVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRevokeVersionParamsWithTimeout creates a new RevokeVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRevokeVersionParamsWithTimeout(timeout time.Duration) *RevokeVersionParams { + var () + return &RevokeVersionParams{ + + timeout: timeout, + } +} + +// NewRevokeVersionParamsWithContext creates a new RevokeVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewRevokeVersionParamsWithContext(ctx context.Context) *RevokeVersionParams { + var () + return &RevokeVersionParams{ + + Context: ctx, + } +} + +// NewRevokeVersionParamsWithHTTPClient creates a new RevokeVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRevokeVersionParamsWithHTTPClient(client *http.Client) *RevokeVersionParams { + var () + return &RevokeVersionParams{ + HTTPClient: client, + } +} + +/*RevokeVersionParams contains all the parameters to send to the API endpoint +for the revoke version operation typically these are written to a http.Request +*/ +type RevokeVersionParams struct { + + /*Body*/ + Body *models.HashicorpCloudVagrant20220930RevokeVersionRequest + /*Box + The name segment of the Box. As an example, this field would represent the + "vagrant" in "hashicorp/vagrant". + + */ + Box string + /*Registry + The Registry segment of the Box. As an example, this field would represent + the "hashicorp" in "hashicorp/vagrant". + + */ + Registry string + /*Version + The name of the Version to revoke. + + */ + Version string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the revoke version params +func (o *RevokeVersionParams) WithTimeout(timeout time.Duration) *RevokeVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the revoke version params +func (o *RevokeVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the revoke version params +func (o *RevokeVersionParams) WithContext(ctx context.Context) *RevokeVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the revoke version params +func (o *RevokeVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the revoke version params +func (o *RevokeVersionParams) WithHTTPClient(client *http.Client) *RevokeVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the revoke version params +func (o *RevokeVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the revoke version params +func (o *RevokeVersionParams) WithBody(body *models.HashicorpCloudVagrant20220930RevokeVersionRequest) *RevokeVersionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the revoke version params +func (o *RevokeVersionParams) SetBody(body *models.HashicorpCloudVagrant20220930RevokeVersionRequest) { + o.Body = body +} + +// WithBox adds the box to the revoke version params +func (o *RevokeVersionParams) WithBox(box string) *RevokeVersionParams { + o.SetBox(box) + return o +} + +// SetBox adds the box to the revoke version params +func (o *RevokeVersionParams) SetBox(box string) { + o.Box = box +} + +// WithRegistry adds the registry to the revoke version params +func (o *RevokeVersionParams) WithRegistry(registry string) *RevokeVersionParams { + o.SetRegistry(registry) + return o +} + +// SetRegistry adds the registry to the revoke version params +func (o *RevokeVersionParams) SetRegistry(registry string) { + o.Registry = registry +} + +// WithVersion adds the version to the revoke version params +func (o *RevokeVersionParams) WithVersion(version string) *RevokeVersionParams { + o.SetVersion(version) + return o +} + +// SetVersion adds the version to the revoke version params +func (o *RevokeVersionParams) SetVersion(version string) { + o.Version = version +} + +// WriteToRequest writes these params to a swagger request +func (o *RevokeVersionParams) 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 box + if err := r.SetPathParam("box", o.Box); err != nil { + return err + } + + // path param registry + if err := r.SetPathParam("registry", o.Registry); err != nil { + return err + } + + // path param version + if err := r.SetPathParam("version", o.Version); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_responses.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_responses.go new file mode 100644 index 00000000..1e9f6981 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/revoke_version_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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-vagrant-box-registry/preview/2022-09-30/models" +) + +// RevokeVersionReader is a Reader for the RevokeVersion structure. +type RevokeVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RevokeVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRevokeVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRevokeVersionOK creates a RevokeVersionOK with default headers values +func NewRevokeVersionOK() *RevokeVersionOK { + return &RevokeVersionOK{} +} + +/*RevokeVersionOK handles this case with default header values. + +A successful response. +*/ +type RevokeVersionOK struct { + Payload models.HashicorpCloudVagrant20220930RevokeVersionResponse +} + +func (o *RevokeVersionOK) Error() string { + return fmt.Sprintf("[PUT /vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/revoke][%d] revokeVersionOK %+v", 200, o.Payload) +} + +func (o *RevokeVersionOK) GetPayload() models.HashicorpCloudVagrant20220930RevokeVersionResponse { + return o.Payload +} + +func (o *RevokeVersionOK) 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 +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/version_service_client.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/version_service_client.go new file mode 100644 index 00000000..a59a127f --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/client/version_service/version_service_client.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package version_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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new version service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for version service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + CreateVersion(params *CreateVersionParams, authInfo runtime.ClientAuthInfoWriter) (*CreateVersionOK, error) + + DeleteVersion(params *DeleteVersionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteVersionOK, error) + + ListVersions(params *ListVersionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListVersionsOK, error) + + ReadVersion(params *ReadVersionParams, authInfo runtime.ClientAuthInfoWriter) (*ReadVersionOK, error) + + ReleaseVersion(params *ReleaseVersionParams, authInfo runtime.ClientAuthInfoWriter) (*ReleaseVersionOK, error) + + RevokeVersion(params *RevokeVersionParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeVersionOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateVersion creates version creates a new box version +*/ +func (a *Client) CreateVersion(params *CreateVersionParams, authInfo runtime.ClientAuthInfoWriter) (*CreateVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CreateVersion", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CreateVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteVersion deletes version deletes a box version + + Deleting a Box Version removes all its Providers as well. This +operation cannot be undone. +*/ +func (a *Client) DeleteVersion(params *DeleteVersionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteVersion", + Method: "DELETE", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListVersions lists version lists all of the versions within a particular box +*/ +func (a *Client) ListVersions(params *ListVersionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListVersionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListVersionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListVersions", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListVersionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListVersionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListVersions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReadVersion reads version reads a box version +*/ +func (a *Client) ReadVersion(params *ReadVersionParams, authInfo runtime.ClientAuthInfoWriter) (*ReadVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ReadVersion", + Method: "GET", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ReadVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReadVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReleaseVersion releases releases the specified version the version must not already be released +*/ +func (a *Client) ReleaseVersion(params *ReleaseVersionParams, authInfo runtime.ClientAuthInfoWriter) (*ReleaseVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReleaseVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ReleaseVersion", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/release", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ReleaseVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReleaseVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReleaseVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + RevokeVersion revokes revokes the specified version the version must be actively released +*/ +func (a *Client) RevokeVersion(params *RevokeVersionParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRevokeVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RevokeVersion", + Method: "PUT", + PathPattern: "/vagrant/2022-09-30/registry/{registry}/boxes/{box}/versions/{version}/revoke", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RevokeVersionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RevokeVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for RevokeVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_request.go new file mode 100644 index 00000000..fbc7ea68 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_request.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" +) + +// HashicorpCloudVagrant20220930ActivateRegistryRequest hashicorp cloud vagrant 20220930 activate registry request +// +// swagger:model hashicorp.cloud.vagrant_20220930.ActivateRegistryRequest +type HashicorpCloudVagrant20220930ActivateRegistryRequest struct { + + // The name of the Registry to activate. + Registry string `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 activate registry request +func (m *HashicorpCloudVagrant20220930ActivateRegistryRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ActivateRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ActivateRegistryRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ActivateRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_response.go new file mode 100644 index 00000000..1178d93c --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_activate_registry_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 + +// HashicorpCloudVagrant20220930ActivateRegistryResponse hashicorp cloud vagrant 20220930 activate registry response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ActivateRegistryResponse +type HashicorpCloudVagrant20220930ActivateRegistryResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_box.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_box.go new file mode 100644 index 00000000..d92cbae1 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_box.go @@ -0,0 +1,103 @@ +// 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" +) + +// HashicorpCloudVagrant20220930Box hashicorp cloud vagrant 20220930 box +// +// swagger:model hashicorp.cloud.vagrant_20220930.Box +type HashicorpCloudVagrant20220930Box struct { + + // The date the record was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // A long-form description of the box. + Description string `json:"description,omitempty"` + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". Should be unique within the Registry. + // This field should only be set when creating the box. + ID string `json:"id,omitempty"` + + // Whether or not the Box is private. + IsPrivate bool `json:"is_private,omitempty"` + + // A short-form description of the box. Limited to 100 characters. + ShortDescription string `json:"short_description,omitempty"` + + // The date that the record was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 box +func (m *HashicorpCloudVagrant20220930Box) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(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 *HashicorpCloudVagrant20220930Box) 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 *HashicorpCloudVagrant20220930Box) 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 *HashicorpCloudVagrant20220930Box) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930Box) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930Box + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_request.go new file mode 100644 index 00000000..8c8e3119 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_request.go @@ -0,0 +1,58 @@ +// 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" +) + +// HashicorpCloudVagrant20220930CompleteUploadRequest hashicorp cloud vagrant 20220930 complete upload request +// +// swagger:model hashicorp.cloud.vagrant_20220930.CompleteUploadRequest +type HashicorpCloudVagrant20220930CompleteUploadRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // The HMAC for the upload supplied in the output of the corresponding + // UploadProvider call. + Hmac string `json:"hmac,omitempty"` + + // The name of the Provider. + Provider string `json:"provider,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version for the Provider. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 complete upload request +func (m *HashicorpCloudVagrant20220930CompleteUploadRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CompleteUploadRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CompleteUploadRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CompleteUploadRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_response.go new file mode 100644 index 00000000..62da1620 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_complete_upload_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 + +// HashicorpCloudVagrant20220930CompleteUploadResponse hashicorp cloud vagrant 20220930 complete upload response +// +// swagger:model hashicorp.cloud.vagrant_20220930.CompleteUploadResponse +type HashicorpCloudVagrant20220930CompleteUploadResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_request.go new file mode 100644 index 00000000..ef0fa6ca --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_request.go @@ -0,0 +1,76 @@ +// 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" +) + +// HashicorpCloudVagrant20220930CreateBoxRequest hashicorp cloud vagrant 20220930 create box request +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateBoxRequest +type HashicorpCloudVagrant20220930CreateBoxRequest struct { + + // Details of the Box to create. Note that some fields are ignored + // on input and should not be set. + Data *HashicorpCloudVagrant20220930Box `json:"data,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create box request +func (m *HashicorpCloudVagrant20220930CreateBoxRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateBoxRequest) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateBoxRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateBoxRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateBoxRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_response.go new file mode 100644 index 00000000..1d153775 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_box_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" +) + +// HashicorpCloudVagrant20220930CreateBoxResponse hashicorp cloud vagrant 20220930 create box response +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateBoxResponse +type HashicorpCloudVagrant20220930CreateBoxResponse struct { + + // The created Box. + Box *HashicorpCloudVagrant20220930Box `json:"box,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create box response +func (m *HashicorpCloudVagrant20220930CreateBoxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBox(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateBoxResponse) validateBox(formats strfmt.Registry) error { + + if swag.IsZero(m.Box) { // not required + return nil + } + + if m.Box != nil { + if err := m.Box.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("box") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateBoxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateBoxResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateBoxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_request.go new file mode 100644 index 00000000..ddc00ee3 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_request.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVagrant20220930CreateProviderRequest hashicorp cloud vagrant 20220930 create provider request +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateProviderRequest +type HashicorpCloudVagrant20220930CreateProviderRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // external + External *HashicorpCloudVagrant20220930ExternalProvider `json:"external,omitempty"` + + // hosted + Hosted *HashicorpCloudVagrant20220930HostedProvider `json:"hosted,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version to create the Provider in. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create provider request +func (m *HashicorpCloudVagrant20220930CreateProviderRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateProviderRequest) validateExternal(formats strfmt.Registry) error { + + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateProviderRequest) validateHosted(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosted) { // not required + return nil + } + + if m.Hosted != nil { + if err := m.Hosted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosted") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateProviderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateProviderRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateProviderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_response.go new file mode 100644 index 00000000..f90c6d81 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_provider_response.go @@ -0,0 +1,96 @@ +// 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" +) + +// HashicorpCloudVagrant20220930CreateProviderResponse hashicorp cloud vagrant 20220930 create provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateProviderResponse +type HashicorpCloudVagrant20220930CreateProviderResponse struct { + + // external + External *HashicorpCloudVagrant20220930ExternalProvider `json:"external,omitempty"` + + // hosted + Hosted *HashicorpCloudVagrant20220930HostedProvider `json:"hosted,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create provider response +func (m *HashicorpCloudVagrant20220930CreateProviderResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateProviderResponse) validateExternal(formats strfmt.Registry) error { + + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateProviderResponse) validateHosted(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosted) { // not required + return nil + } + + if m.Hosted != nil { + if err := m.Hosted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosted") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateProviderResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_registry_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_registry_request.go new file mode 100644 index 00000000..d0e2cfe0 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_registry_request.go @@ -0,0 +1,79 @@ +// 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" +) + +// HashicorpCloudVagrant20220930CreateRegistryRequest hashicorp cloud vagrant 20220930 create registry request +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateRegistryRequest +type HashicorpCloudVagrant20220930CreateRegistryRequest struct { + + // The name of the Registry. This is a user-settable, globally-unique name, + // and forms the first segment of a Box, ie: the "hashicorp" in + // "hashicorp/vagrant". No two registries can have the same name, regardless + // of the Organization they are in, or specific Project within that + // Organization. + ID string `json:"id,omitempty"` + + // The Location to create the Registry in. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create registry request +func (m *HashicorpCloudVagrant20220930CreateRegistryRequest) 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 *HashicorpCloudVagrant20220930CreateRegistryRequest) 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 *HashicorpCloudVagrant20220930CreateRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateRegistryRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_registry_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_registry_response.go new file mode 100644 index 00000000..c6164434 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_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" +) + +// HashicorpCloudVagrant20220930CreateRegistryResponse hashicorp cloud vagrant 20220930 create registry response +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateRegistryResponse +type HashicorpCloudVagrant20220930CreateRegistryResponse struct { + + // The created Registry. + Registry *HashicorpCloudVagrant20220930Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create registry response +func (m *HashicorpCloudVagrant20220930CreateRegistryResponse) 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 *HashicorpCloudVagrant20220930CreateRegistryResponse) 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 *HashicorpCloudVagrant20220930CreateRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_request.go new file mode 100644 index 00000000..9cfb7a0b --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_request.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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVagrant20220930CreateVersionRequest hashicorp cloud vagrant 20220930 create version request +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateVersionRequest +type HashicorpCloudVagrant20220930CreateVersionRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // Details of the Version to create. Note that some fields are ignored + // on input and should not be set. + Data *HashicorpCloudVagrant20220930Version `json:"data,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create version request +func (m *HashicorpCloudVagrant20220930CreateVersionRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateVersionRequest) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateVersionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateVersionRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateVersionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_response.go new file mode 100644 index 00000000..d43e58af --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_create_version_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" +) + +// HashicorpCloudVagrant20220930CreateVersionResponse hashicorp cloud vagrant 20220930 create version response +// +// swagger:model hashicorp.cloud.vagrant_20220930.CreateVersionResponse +type HashicorpCloudVagrant20220930CreateVersionResponse struct { + + // The created Version. + Version *HashicorpCloudVagrant20220930Version `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 create version response +func (m *HashicorpCloudVagrant20220930CreateVersionResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930CreateVersionResponse) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if m.Version != nil { + if err := m.Version.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("version") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateVersionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930CreateVersionResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930CreateVersionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_request.go new file mode 100644 index 00000000..d261e4d8 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_request.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" +) + +// HashicorpCloudVagrant20220930DeactivateRegistryRequest hashicorp cloud vagrant 20220930 deactivate registry request +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeactivateRegistryRequest +type HashicorpCloudVagrant20220930DeactivateRegistryRequest struct { + + // The name of the Registry to deactivate. + Registry string `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 deactivate registry request +func (m *HashicorpCloudVagrant20220930DeactivateRegistryRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930DeactivateRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930DeactivateRegistryRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930DeactivateRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_response.go new file mode 100644 index 00000000..f6458bca --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_deactivate_registry_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 + +// HashicorpCloudVagrant20220930DeactivateRegistryResponse hashicorp cloud vagrant 20220930 deactivate registry response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeactivateRegistryResponse +type HashicorpCloudVagrant20220930DeactivateRegistryResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_box_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_box_response.go new file mode 100644 index 00000000..730188b4 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_box_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 + +// HashicorpCloudVagrant20220930DeleteBoxResponse hashicorp cloud vagrant 20220930 delete box response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeleteBoxResponse +type HashicorpCloudVagrant20220930DeleteBoxResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_provider_response.go new file mode 100644 index 00000000..88a5c285 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_provider_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 + +// HashicorpCloudVagrant20220930DeleteProviderResponse hashicorp cloud vagrant 20220930 delete provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeleteProviderResponse +type HashicorpCloudVagrant20220930DeleteProviderResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_registry_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_registry_response.go new file mode 100644 index 00000000..8eddfecc --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_registry_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 + +// HashicorpCloudVagrant20220930DeleteRegistryResponse hashicorp cloud vagrant 20220930 delete registry response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeleteRegistryResponse +type HashicorpCloudVagrant20220930DeleteRegistryResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_version_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_version_response.go new file mode 100644 index 00000000..be7218f0 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_delete_version_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 + +// HashicorpCloudVagrant20220930DeleteVersionResponse hashicorp cloud vagrant 20220930 delete version response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DeleteVersionResponse +type HashicorpCloudVagrant20220930DeleteVersionResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response.go new file mode 100644 index 00000000..f57f443e --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response.go @@ -0,0 +1,76 @@ +// 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" +) + +// HashicorpCloudVagrant20220930DownloadProviderResponse hashicorp cloud vagrant 20220930 download provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.DownloadProviderResponse +type HashicorpCloudVagrant20220930DownloadProviderResponse struct { + + // (Optional) checksum data to validate the download with. This field may + // not be populated for Hosted Provider downloads. + Checksum string `json:"checksum,omitempty"` + + // The algorithm type for the provided checksum. + ChecksumType HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType `json:"checksum_type,omitempty"` + + // The URL to download the Provider data from. + URL string `json:"url,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 download provider response +func (m *HashicorpCloudVagrant20220930DownloadProviderResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecksumType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930DownloadProviderResponse) validateChecksumType(formats strfmt.Registry) error { + + if swag.IsZero(m.ChecksumType) { // not required + return nil + } + + if err := m.ChecksumType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checksum_type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930DownloadProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930DownloadProviderResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930DownloadProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response_checksum_type.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response_checksum_type.go new file mode 100644 index 00000000..fce20655 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_download_provider_response_checksum_type.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType ChecksumTypes describe supported checksum types. +// +// swagger:model hashicorp.cloud.vagrant_20220930.DownloadProviderResponse.ChecksumType +type HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType string + +const ( + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeNONE captures enum value "NONE" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeNONE HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "NONE" + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeMD5 captures enum value "MD5" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeMD5 HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "MD5" + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA1 captures enum value "SHA1" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA1 HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "SHA1" + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA256 captures enum value "SHA256" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA256 HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "SHA256" + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA384 captures enum value "SHA384" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA384 HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "SHA384" + + // HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA512 captures enum value "SHA512" + HashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeSHA512 HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType = "SHA512" +) + +// for schema +var hashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType + if err := json.Unmarshal([]byte(`["NONE","MD5","SHA1","SHA256","SHA384","SHA512"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum = append(hashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum, v) + } +} + +func (m HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType) validateHashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum(path, location string, value HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vagrant 20220930 download provider response checksum type +func (m HashicorpCloudVagrant20220930DownloadProviderResponseChecksumType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVagrant20220930DownloadProviderResponseChecksumTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider.go new file mode 100644 index 00000000..d5a4c296 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVagrant20220930ExternalProvider ExternalProvider describes an External Provider. This kind of Provider is +// simply a stub to a Provider located outside of the HCP Vagrant Registry's own +// object storage. +// +// swagger:model hashicorp.cloud.vagrant_20220930.ExternalProvider +type HashicorpCloudVagrant20220930ExternalProvider struct { + + // The checksum for the Provider at the external URL. + Checksum string `json:"checksum,omitempty"` + + // The algorithm type for the provided checksum. + ChecksumType HashicorpCloudVagrant20220930ExternalProviderChecksumType `json:"checksum_type,omitempty"` + + // The date the record was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // The external URL for this Provider. + ExternalURL string `json:"external_url,omitempty"` + + // The name of the Provider, should be unique within the version. + ID string `json:"id,omitempty"` + + // The date that the record was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 external provider +func (m *HashicorpCloudVagrant20220930ExternalProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecksumType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(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 *HashicorpCloudVagrant20220930ExternalProvider) validateChecksumType(formats strfmt.Registry) error { + + if swag.IsZero(m.ChecksumType) { // not required + return nil + } + + if err := m.ChecksumType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checksum_type") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930ExternalProvider) 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 *HashicorpCloudVagrant20220930ExternalProvider) 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 *HashicorpCloudVagrant20220930ExternalProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ExternalProvider) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ExternalProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider_checksum_type.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider_checksum_type.go new file mode 100644 index 00000000..ad481148 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_external_provider_checksum_type.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVagrant20220930ExternalProviderChecksumType ChecksumTypes describe supported checksum types. +// +// swagger:model hashicorp.cloud.vagrant_20220930.ExternalProvider.ChecksumType +type HashicorpCloudVagrant20220930ExternalProviderChecksumType string + +const ( + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeNONE captures enum value "NONE" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeNONE HashicorpCloudVagrant20220930ExternalProviderChecksumType = "NONE" + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeMD5 captures enum value "MD5" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeMD5 HashicorpCloudVagrant20220930ExternalProviderChecksumType = "MD5" + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA1 captures enum value "SHA1" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA1 HashicorpCloudVagrant20220930ExternalProviderChecksumType = "SHA1" + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA256 captures enum value "SHA256" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA256 HashicorpCloudVagrant20220930ExternalProviderChecksumType = "SHA256" + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA384 captures enum value "SHA384" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA384 HashicorpCloudVagrant20220930ExternalProviderChecksumType = "SHA384" + + // HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA512 captures enum value "SHA512" + HashicorpCloudVagrant20220930ExternalProviderChecksumTypeSHA512 HashicorpCloudVagrant20220930ExternalProviderChecksumType = "SHA512" +) + +// for schema +var hashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVagrant20220930ExternalProviderChecksumType + if err := json.Unmarshal([]byte(`["NONE","MD5","SHA1","SHA256","SHA384","SHA512"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum = append(hashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum, v) + } +} + +func (m HashicorpCloudVagrant20220930ExternalProviderChecksumType) validateHashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum(path, location string, value HashicorpCloudVagrant20220930ExternalProviderChecksumType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vagrant 20220930 external provider checksum type +func (m HashicorpCloudVagrant20220930ExternalProviderChecksumType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVagrant20220930ExternalProviderChecksumTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_get_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_get_provider_response.go new file mode 100644 index 00000000..0ecbe505 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_get_provider_response.go @@ -0,0 +1,96 @@ +// 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" +) + +// HashicorpCloudVagrant20220930GetProviderResponse hashicorp cloud vagrant 20220930 get provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.GetProviderResponse +type HashicorpCloudVagrant20220930GetProviderResponse struct { + + // external + External *HashicorpCloudVagrant20220930ExternalProvider `json:"external,omitempty"` + + // hosted + Hosted *HashicorpCloudVagrant20220930HostedProvider `json:"hosted,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 get provider response +func (m *HashicorpCloudVagrant20220930GetProviderResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930GetProviderResponse) validateExternal(formats strfmt.Registry) error { + + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930GetProviderResponse) validateHosted(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosted) { // not required + return nil + } + + if m.Hosted != nil { + if err := m.Hosted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosted") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930GetProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930GetProviderResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930GetProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider.go new file mode 100644 index 00000000..bd760865 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider.go @@ -0,0 +1,141 @@ +// 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" +) + +// HashicorpCloudVagrant20220930HostedProvider hashicorp cloud vagrant 20220930 hosted provider +// +// swagger:model hashicorp.cloud.vagrant_20220930.HostedProvider +type HashicorpCloudVagrant20220930HostedProvider struct { + + // The checksum for the Provider at the external URL. + Checksum string `json:"checksum,omitempty"` + + // The algorithm type for the provided checksum. + ChecksumType HashicorpCloudVagrant20220930HostedProviderChecksumType `json:"checksum_type,omitempty"` + + // The date the record was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // The name of the Provider, should be unique within the version. + ID string `json:"id,omitempty"` + + // The upload state of the Provider. + State HashicorpCloudVagrant20220930HostedProviderState `json:"state,omitempty"` + + // The date that the record was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 hosted provider +func (m *HashicorpCloudVagrant20220930HostedProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecksumType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(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 *HashicorpCloudVagrant20220930HostedProvider) validateChecksumType(formats strfmt.Registry) error { + + if swag.IsZero(m.ChecksumType) { // not required + return nil + } + + if err := m.ChecksumType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checksum_type") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930HostedProvider) 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 *HashicorpCloudVagrant20220930HostedProvider) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930HostedProvider) 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 *HashicorpCloudVagrant20220930HostedProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930HostedProvider) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930HostedProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_checksum_type.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_checksum_type.go new file mode 100644 index 00000000..09ee9b31 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_checksum_type.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// HashicorpCloudVagrant20220930HostedProviderChecksumType ChecksumTypes describe supported checksum types. +// +// swagger:model hashicorp.cloud.vagrant_20220930.HostedProvider.ChecksumType +type HashicorpCloudVagrant20220930HostedProviderChecksumType string + +const ( + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeNONE captures enum value "NONE" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeNONE HashicorpCloudVagrant20220930HostedProviderChecksumType = "NONE" + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeMD5 captures enum value "MD5" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeMD5 HashicorpCloudVagrant20220930HostedProviderChecksumType = "MD5" + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA1 captures enum value "SHA1" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA1 HashicorpCloudVagrant20220930HostedProviderChecksumType = "SHA1" + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA256 captures enum value "SHA256" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA256 HashicorpCloudVagrant20220930HostedProviderChecksumType = "SHA256" + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA384 captures enum value "SHA384" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA384 HashicorpCloudVagrant20220930HostedProviderChecksumType = "SHA384" + + // HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA512 captures enum value "SHA512" + HashicorpCloudVagrant20220930HostedProviderChecksumTypeSHA512 HashicorpCloudVagrant20220930HostedProviderChecksumType = "SHA512" +) + +// for schema +var hashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum []interface{} + +func init() { + var res []HashicorpCloudVagrant20220930HostedProviderChecksumType + if err := json.Unmarshal([]byte(`["NONE","MD5","SHA1","SHA256","SHA384","SHA512"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum = append(hashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum, v) + } +} + +func (m HashicorpCloudVagrant20220930HostedProviderChecksumType) validateHashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum(path, location string, value HashicorpCloudVagrant20220930HostedProviderChecksumType) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vagrant 20220930 hosted provider checksum type +func (m HashicorpCloudVagrant20220930HostedProviderChecksumType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVagrant20220930HostedProviderChecksumTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_state.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_state.go new file mode 100644 index 00000000..8b8be095 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_hosted_provider_state.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" +) + +// HashicorpCloudVagrant20220930HostedProviderState State is an enumeration of possible HostedProvider states. +// +// swagger:model hashicorp.cloud.vagrant_20220930.HostedProvider.State +type HashicorpCloudVagrant20220930HostedProviderState string + +const ( + + // HashicorpCloudVagrant20220930HostedProviderStatePENDING captures enum value "PENDING" + HashicorpCloudVagrant20220930HostedProviderStatePENDING HashicorpCloudVagrant20220930HostedProviderState = "PENDING" + + // HashicorpCloudVagrant20220930HostedProviderStateUPLOADING captures enum value "UPLOADING" + HashicorpCloudVagrant20220930HostedProviderStateUPLOADING HashicorpCloudVagrant20220930HostedProviderState = "UPLOADING" + + // HashicorpCloudVagrant20220930HostedProviderStateCOMPLETE captures enum value "COMPLETE" + HashicorpCloudVagrant20220930HostedProviderStateCOMPLETE HashicorpCloudVagrant20220930HostedProviderState = "COMPLETE" + + // HashicorpCloudVagrant20220930HostedProviderStateFAILED captures enum value "FAILED" + HashicorpCloudVagrant20220930HostedProviderStateFAILED HashicorpCloudVagrant20220930HostedProviderState = "FAILED" +) + +// for schema +var hashicorpCloudVagrant20220930HostedProviderStateEnum []interface{} + +func init() { + var res []HashicorpCloudVagrant20220930HostedProviderState + if err := json.Unmarshal([]byte(`["PENDING","UPLOADING","COMPLETE","FAILED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVagrant20220930HostedProviderStateEnum = append(hashicorpCloudVagrant20220930HostedProviderStateEnum, v) + } +} + +func (m HashicorpCloudVagrant20220930HostedProviderState) validateHashicorpCloudVagrant20220930HostedProviderStateEnum(path, location string, value HashicorpCloudVagrant20220930HostedProviderState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVagrant20220930HostedProviderStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vagrant 20220930 hosted provider state +func (m HashicorpCloudVagrant20220930HostedProviderState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVagrant20220930HostedProviderStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_boxes_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_boxes_response.go new file mode 100644 index 00000000..431054cc --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_boxes_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" +) + +// HashicorpCloudVagrant20220930ListBoxesResponse hashicorp cloud vagrant 20220930 list boxes response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ListBoxesResponse +type HashicorpCloudVagrant20220930ListBoxesResponse struct { + + // The returned Box records for this page. + Boxes []*HashicorpCloudVagrant20220930Box `json:"boxes"` + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 list boxes response +func (m *HashicorpCloudVagrant20220930ListBoxesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBoxes(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 *HashicorpCloudVagrant20220930ListBoxesResponse) validateBoxes(formats strfmt.Registry) error { + + if swag.IsZero(m.Boxes) { // not required + return nil + } + + for i := 0; i < len(m.Boxes); i++ { + if swag.IsZero(m.Boxes[i]) { // not required + continue + } + + if m.Boxes[i] != nil { + if err := m.Boxes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boxes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930ListBoxesResponse) 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 *HashicorpCloudVagrant20220930ListBoxesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListBoxesResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ListBoxesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_providers_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_providers_response.go new file mode 100644 index 00000000..daadc845 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_providers_response.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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" +) + +// HashicorpCloudVagrant20220930ListProvidersResponse hashicorp cloud vagrant 20220930 list providers response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ListProvidersResponse +type HashicorpCloudVagrant20220930ListProvidersResponse struct { + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // The returned Providers. Note that the message here will be either one of + // HostedProvider or ExternalProvider. + Providers []*cloud.GoogleProtobufAny `json:"providers"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 list providers response +func (m *HashicorpCloudVagrant20220930ListProvidersResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProviders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930ListProvidersResponse) 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 *HashicorpCloudVagrant20220930ListProvidersResponse) validateProviders(formats strfmt.Registry) error { + + if swag.IsZero(m.Providers) { // not required + return nil + } + + for i := 0; i < len(m.Providers); i++ { + if swag.IsZero(m.Providers[i]) { // not required + continue + } + + if m.Providers[i] != nil { + if err := m.Providers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("providers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListProvidersResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListProvidersResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ListProvidersResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_registries_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_registries_response.go new file mode 100644 index 00000000..212736f8 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_registries_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" +) + +// HashicorpCloudVagrant20220930ListRegistriesResponse hashicorp cloud vagrant 20220930 list registries response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ListRegistriesResponse +type HashicorpCloudVagrant20220930ListRegistriesResponse struct { + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // The returned Registry records for this page. + Registries []*HashicorpCloudVagrant20220930Registry `json:"registries"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 list registries response +func (m *HashicorpCloudVagrant20220930ListRegistriesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistries(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930ListRegistriesResponse) 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 *HashicorpCloudVagrant20220930ListRegistriesResponse) validateRegistries(formats strfmt.Registry) error { + + if swag.IsZero(m.Registries) { // not required + return nil + } + + for i := 0; i < len(m.Registries); i++ { + if swag.IsZero(m.Registries[i]) { // not required + continue + } + + if m.Registries[i] != nil { + if err := m.Registries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListRegistriesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListRegistriesResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ListRegistriesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_versions_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_versions_response.go new file mode 100644 index 00000000..3928738a --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_list_versions_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" +) + +// HashicorpCloudVagrant20220930ListVersionsResponse hashicorp cloud vagrant 20220930 list versions response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ListVersionsResponse +type HashicorpCloudVagrant20220930ListVersionsResponse struct { + + // Pagination tokens for a subsequent request. + Pagination *cloud.HashicorpCloudCommonPaginationResponse `json:"pagination,omitempty"` + + // The returned Box records for this page. + Versions []*HashicorpCloudVagrant20220930Version `json:"versions"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 list versions response +func (m *HashicorpCloudVagrant20220930ListVersionsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930ListVersionsResponse) 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 *HashicorpCloudVagrant20220930ListVersionsResponse) validateVersions(formats strfmt.Registry) error { + + if swag.IsZero(m.Versions) { // not required + return nil + } + + for i := 0; i < len(m.Versions); i++ { + if swag.IsZero(m.Versions[i]) { // not required + continue + } + + if m.Versions[i] != nil { + if err := m.Versions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListVersionsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ListVersionsResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ListVersionsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_box_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_box_response.go new file mode 100644 index 00000000..b05b7d5f --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_box_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" +) + +// HashicorpCloudVagrant20220930ReadBoxResponse hashicorp cloud vagrant 20220930 read box response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ReadBoxResponse +type HashicorpCloudVagrant20220930ReadBoxResponse struct { + + // The requested Box. + Box *HashicorpCloudVagrant20220930Box `json:"box,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 read box response +func (m *HashicorpCloudVagrant20220930ReadBoxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBox(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930ReadBoxResponse) validateBox(formats strfmt.Registry) error { + + if swag.IsZero(m.Box) { // not required + return nil + } + + if m.Box != nil { + if err := m.Box.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("box") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReadBoxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReadBoxResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ReadBoxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_registry_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_registry_response.go new file mode 100644 index 00000000..9176fa99 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_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" +) + +// HashicorpCloudVagrant20220930ReadRegistryResponse hashicorp cloud vagrant 20220930 read registry response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ReadRegistryResponse +type HashicorpCloudVagrant20220930ReadRegistryResponse struct { + + // The returned Registry. + Registry *HashicorpCloudVagrant20220930Registry `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 read registry response +func (m *HashicorpCloudVagrant20220930ReadRegistryResponse) 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 *HashicorpCloudVagrant20220930ReadRegistryResponse) 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 *HashicorpCloudVagrant20220930ReadRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReadRegistryResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ReadRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_version_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_version_response.go new file mode 100644 index 00000000..2bb1bc3e --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_read_version_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" +) + +// HashicorpCloudVagrant20220930ReadVersionResponse hashicorp cloud vagrant 20220930 read version response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ReadVersionResponse +type HashicorpCloudVagrant20220930ReadVersionResponse struct { + + // The returned Version. + Version *HashicorpCloudVagrant20220930Version `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 read version response +func (m *HashicorpCloudVagrant20220930ReadVersionResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930ReadVersionResponse) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if m.Version != nil { + if err := m.Version.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("version") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReadVersionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReadVersionResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ReadVersionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_registry.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_registry.go new file mode 100644 index 00000000..4b0278db --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_registry.go @@ -0,0 +1,124 @@ +// 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" +) + +// HashicorpCloudVagrant20220930Registry hashicorp cloud vagrant 20220930 registry +// +// swagger:model hashicorp.cloud.vagrant_20220930.Registry +type HashicorpCloudVagrant20220930Registry struct { + + // Whether or not the Registry is currently activated. + Activated bool `json:"activated,omitempty"` + + // The date the record was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // The name of the Registry. This is a user-settable, globally-unique name, + // and forms the first segment of a box, ie: the "hashicorp" in + // "hashicorp/vagrant". No two registries can have the same name, regardless + // of the location (org/project) they are in. + ID string `json:"id,omitempty"` + + // The Location that the Registry resides in. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` + + // The date that the record was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 registry +func (m *HashicorpCloudVagrant20220930Registry) Validate(formats strfmt.Registry) error { + var res []error + + 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 *HashicorpCloudVagrant20220930Registry) 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 *HashicorpCloudVagrant20220930Registry) 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 *HashicorpCloudVagrant20220930Registry) 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 *HashicorpCloudVagrant20220930Registry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930Registry) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930Registry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_request.go new file mode 100644 index 00000000..db17103c --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_request.go @@ -0,0 +1,51 @@ +// 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" +) + +// HashicorpCloudVagrant20220930ReleaseVersionRequest hashicorp cloud vagrant 20220930 release version request +// +// swagger:model hashicorp.cloud.vagrant_20220930.ReleaseVersionRequest +type HashicorpCloudVagrant20220930ReleaseVersionRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version to release. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 release version request +func (m *HashicorpCloudVagrant20220930ReleaseVersionRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReleaseVersionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930ReleaseVersionRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930ReleaseVersionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_response.go new file mode 100644 index 00000000..95171d8d --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_release_version_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 + +// HashicorpCloudVagrant20220930ReleaseVersionResponse hashicorp cloud vagrant 20220930 release version response +// +// swagger:model hashicorp.cloud.vagrant_20220930.ReleaseVersionResponse +type HashicorpCloudVagrant20220930ReleaseVersionResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_request.go new file mode 100644 index 00000000..5c4e7204 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_request.go @@ -0,0 +1,51 @@ +// 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" +) + +// HashicorpCloudVagrant20220930RevokeVersionRequest hashicorp cloud vagrant 20220930 revoke version request +// +// swagger:model hashicorp.cloud.vagrant_20220930.RevokeVersionRequest +type HashicorpCloudVagrant20220930RevokeVersionRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version to revoke. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 revoke version request +func (m *HashicorpCloudVagrant20220930RevokeVersionRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930RevokeVersionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930RevokeVersionRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930RevokeVersionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_response.go new file mode 100644 index 00000000..a9d58f01 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_revoke_version_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 + +// HashicorpCloudVagrant20220930RevokeVersionResponse hashicorp cloud vagrant 20220930 revoke version response +// +// swagger:model hashicorp.cloud.vagrant_20220930.RevokeVersionResponse +type HashicorpCloudVagrant20220930RevokeVersionResponse interface{} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_request.go new file mode 100644 index 00000000..baba96e5 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_request.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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HashicorpCloudVagrant20220930UpdateBoxRequest hashicorp cloud vagrant 20220930 update box request +// +// swagger:model hashicorp.cloud.vagrant_20220930.UpdateBoxRequest +type HashicorpCloudVagrant20220930UpdateBoxRequest struct { + + // The name segment of the Box to update. As an example, this field would + // represent the "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // Details of the Box to update. Note that some fields are ignored + // on input and should not be set. + Data *HashicorpCloudVagrant20220930Box `json:"data,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 update box request +func (m *HashicorpCloudVagrant20220930UpdateBoxRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateBoxRequest) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateBoxRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateBoxRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UpdateBoxRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_response.go new file mode 100644 index 00000000..bdba1093 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_box_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" +) + +// HashicorpCloudVagrant20220930UpdateBoxResponse hashicorp cloud vagrant 20220930 update box response +// +// swagger:model hashicorp.cloud.vagrant_20220930.UpdateBoxResponse +type HashicorpCloudVagrant20220930UpdateBoxResponse struct { + + // The updated Box. + Box *HashicorpCloudVagrant20220930Box `json:"box,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 update box response +func (m *HashicorpCloudVagrant20220930UpdateBoxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBox(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateBoxResponse) validateBox(formats strfmt.Registry) error { + + if swag.IsZero(m.Box) { // not required + return nil + } + + if m.Box != nil { + if err := m.Box.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("box") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateBoxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateBoxResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UpdateBoxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_request.go new file mode 100644 index 00000000..f375058b --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_request.go @@ -0,0 +1,110 @@ +// 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" +) + +// HashicorpCloudVagrant20220930UpdateProviderRequest hashicorp cloud vagrant 20220930 update provider request +// +// swagger:model hashicorp.cloud.vagrant_20220930.UpdateProviderRequest +type HashicorpCloudVagrant20220930UpdateProviderRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // external + External *HashicorpCloudVagrant20220930ExternalProvider `json:"external,omitempty"` + + // hosted + Hosted *HashicorpCloudVagrant20220930HostedProvider `json:"hosted,omitempty"` + + // The name of the Provider. + Provider string `json:"provider,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version for the Provider. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 update provider request +func (m *HashicorpCloudVagrant20220930UpdateProviderRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateProviderRequest) validateExternal(formats strfmt.Registry) error { + + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateProviderRequest) validateHosted(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosted) { // not required + return nil + } + + if m.Hosted != nil { + if err := m.Hosted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosted") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateProviderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateProviderRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UpdateProviderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_response.go new file mode 100644 index 00000000..b6df8b8b --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_update_provider_response.go @@ -0,0 +1,96 @@ +// 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" +) + +// HashicorpCloudVagrant20220930UpdateProviderResponse hashicorp cloud vagrant 20220930 update provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.UpdateProviderResponse +type HashicorpCloudVagrant20220930UpdateProviderResponse struct { + + // external + External *HashicorpCloudVagrant20220930ExternalProvider `json:"external,omitempty"` + + // hosted + Hosted *HashicorpCloudVagrant20220930HostedProvider `json:"hosted,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 update provider response +func (m *HashicorpCloudVagrant20220930UpdateProviderResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateProviderResponse) validateExternal(formats strfmt.Registry) error { + + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930UpdateProviderResponse) validateHosted(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosted) { // not required + return nil + } + + if m.Hosted != nil { + if err := m.Hosted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosted") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UpdateProviderResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UpdateProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_request.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_request.go new file mode 100644 index 00000000..c8057712 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_request.go @@ -0,0 +1,54 @@ +// 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" +) + +// HashicorpCloudVagrant20220930UploadProviderRequest hashicorp cloud vagrant 20220930 upload provider request +// +// swagger:model hashicorp.cloud.vagrant_20220930.UploadProviderRequest +type HashicorpCloudVagrant20220930UploadProviderRequest struct { + + // The name segment of the Box. As an example, this field would represent the + // "vagrant" in "hashicorp/vagrant". + Box string `json:"box,omitempty"` + + // The name of the Provider. + Provider string `json:"provider,omitempty"` + + // The Registry segment of the Box. As an example, this field would represent + // the "hashicorp" in "hashicorp/vagrant". + Registry string `json:"registry,omitempty"` + + // The name of the Version for the Provider. + Version string `json:"version,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 upload provider request +func (m *HashicorpCloudVagrant20220930UploadProviderRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UploadProviderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UploadProviderRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UploadProviderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_response.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_response.go new file mode 100644 index 00000000..88382d8d --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_upload_provider_response.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" +) + +// HashicorpCloudVagrant20220930UploadProviderResponse hashicorp cloud vagrant 20220930 upload provider response +// +// swagger:model hashicorp.cloud.vagrant_20220930.UploadProviderResponse +type HashicorpCloudVagrant20220930UploadProviderResponse struct { + + // An HMAC used to validate completion requests for this upload. This should + // be sent to CompleteUpload when this request is finished. + Hmac string `json:"hmac,omitempty"` + + // A pre-signed URL to upload the Provider to. + URL string `json:"url,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 upload provider response +func (m *HashicorpCloudVagrant20220930UploadProviderResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UploadProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930UploadProviderResponse) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930UploadProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version.go new file mode 100644 index 00000000..94fa60a3 --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version.go @@ -0,0 +1,116 @@ +// 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" +) + +// HashicorpCloudVagrant20220930Version hashicorp cloud vagrant 20220930 version +// +// swagger:model hashicorp.cloud.vagrant_20220930.Version +type HashicorpCloudVagrant20220930Version struct { + + // The date the record was created. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // The version string, ie: v0.0.1 or v2006010201, etc. Must be unique within + // the Box. + ID string `json:"id,omitempty"` + + // The release status of the Version. + State HashicorpCloudVagrant20220930VersionState `json:"state,omitempty"` + + // The date that the record was last updated. + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Validate validates this hashicorp cloud vagrant 20220930 version +func (m *HashicorpCloudVagrant20220930Version) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(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 *HashicorpCloudVagrant20220930Version) 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 *HashicorpCloudVagrant20220930Version) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +func (m *HashicorpCloudVagrant20220930Version) 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 *HashicorpCloudVagrant20220930Version) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudVagrant20220930Version) UnmarshalBinary(b []byte) error { + var res HashicorpCloudVagrant20220930Version + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version_state.go b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version_state.go new file mode 100644 index 00000000..eb77c44a --- /dev/null +++ b/clients/cloud-vagrant-box-registry/preview/2022-09-30/models/hashicorp_cloud_vagrant20220930_version_state.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" +) + +// HashicorpCloudVagrant20220930VersionState State is an enumeration of possible Version states. +// +// swagger:model hashicorp.cloud.vagrant_20220930.Version.State +type HashicorpCloudVagrant20220930VersionState string + +const ( + + // HashicorpCloudVagrant20220930VersionStateUNRELEASED captures enum value "UNRELEASED" + HashicorpCloudVagrant20220930VersionStateUNRELEASED HashicorpCloudVagrant20220930VersionState = "UNRELEASED" + + // HashicorpCloudVagrant20220930VersionStateACTIVE captures enum value "ACTIVE" + HashicorpCloudVagrant20220930VersionStateACTIVE HashicorpCloudVagrant20220930VersionState = "ACTIVE" + + // HashicorpCloudVagrant20220930VersionStateREVOKED captures enum value "REVOKED" + HashicorpCloudVagrant20220930VersionStateREVOKED HashicorpCloudVagrant20220930VersionState = "REVOKED" +) + +// for schema +var hashicorpCloudVagrant20220930VersionStateEnum []interface{} + +func init() { + var res []HashicorpCloudVagrant20220930VersionState + if err := json.Unmarshal([]byte(`["UNRELEASED","ACTIVE","REVOKED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + hashicorpCloudVagrant20220930VersionStateEnum = append(hashicorpCloudVagrant20220930VersionStateEnum, v) + } +} + +func (m HashicorpCloudVagrant20220930VersionState) validateHashicorpCloudVagrant20220930VersionStateEnum(path, location string, value HashicorpCloudVagrant20220930VersionState) error { + if err := validate.EnumCase(path, location, value, hashicorpCloudVagrant20220930VersionStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this hashicorp cloud vagrant 20220930 version state +func (m HashicorpCloudVagrant20220930VersionState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateHashicorpCloudVagrant20220930VersionStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +}