From 8ce72b85be3031705017909ff68f14a1dcc103a5 Mon Sep 17 00:00:00 2001 From: broadbot Date: Fri, 3 Nov 2023 15:40:21 +0000 Subject: [PATCH] [sherlock-build] generated from 3767478967e7abe59f13f4d9efc6596d38e401ec --- .../deploy_hooks/deploy_hooks_client.go | 84 +++++ ..._procedures_v3_test_selector_parameters.go | 173 ++++++++++ ...s_procedures_v3_test_selector_responses.go | 295 ++++++++++++++++++ ..._procedures_v3_test_selector_parameters.go | 173 ++++++++++ ...k_procedures_v3_test_selector_responses.go | 295 ++++++++++++++++++ ...ub_actions_deploy_hook_test_run_request.go | 50 +++ ...b_actions_deploy_hook_test_run_response.go | 53 ++++ ...lock_slack_deploy_hook_test_run_request.go | 50 +++ ...ock_slack_deploy_hook_test_run_response.go | 50 +++ .../.openapi-generator/FILES | 4 + sherlock-typescript-client/README.md | 4 +- sherlock-typescript-client/package-lock.json | 4 +- sherlock-typescript-client/package.json | 2 +- .../src/apis/DeployHooksApi.ts | 100 ++++++ ...ckGithubActionsDeployHookTestRunRequest.ts | 65 ++++ ...kGithubActionsDeployHookTestRunResponse.ts | 73 +++++ .../SherlockSlackDeployHookTestRunRequest.ts | 65 ++++ .../SherlockSlackDeployHookTestRunResponse.ts | 65 ++++ .../src/models/index.ts | 4 + sherlock/docs/docs.go | 185 +++++++++++ sherlock/docs/swagger.json | 185 +++++++++++ sherlock/docs/swagger.yaml | 124 ++++++++ 22 files changed, 2098 insertions(+), 5 deletions(-) create mode 100644 sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_parameters.go create mode 100644 sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_responses.go create mode 100644 sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_parameters.go create mode 100644 sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_responses.go create mode 100644 sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_request.go create mode 100644 sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_response.go create mode 100644 sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_request.go create mode 100644 sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_response.go create mode 100644 sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunRequest.ts create mode 100644 sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunResponse.ts create mode 100644 sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunRequest.ts create mode 100644 sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunResponse.ts diff --git a/sherlock-go-client/client/deploy_hooks/deploy_hooks_client.go b/sherlock-go-client/client/deploy_hooks/deploy_hooks_client.go index 5886dd510..101d5bc87 100644 --- a/sherlock-go-client/client/deploy_hooks/deploy_hooks_client.go +++ b/sherlock-go-client/client/deploy_hooks/deploy_hooks_client.go @@ -46,8 +46,12 @@ type ClientService interface { PatchAPIDeployHooksSlackV3Selector(params *PatchAPIDeployHooksSlackV3SelectorParams, opts ...ClientOption) (*PatchAPIDeployHooksSlackV3SelectorOK, error) + PostAPIDeployHooksGithubActionsProceduresV3TestSelector(params *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams, opts ...ClientOption) (*PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK, error) + PostAPIDeployHooksGithubActionsV3(params *PostAPIDeployHooksGithubActionsV3Params, opts ...ClientOption) (*PostAPIDeployHooksGithubActionsV3Created, error) + PostAPIDeployHooksSlackProceduresV3TestSelector(params *PostAPIDeployHooksSlackProceduresV3TestSelectorParams, opts ...ClientOption) (*PostAPIDeployHooksSlackProceduresV3TestSelectorOK, error) + PostAPIDeployHooksSlackV3(params *PostAPIDeployHooksSlackV3Params, opts ...ClientOption) (*PostAPIDeployHooksSlackV3Created, error) SetTransport(transport runtime.ClientTransport) @@ -373,6 +377,46 @@ func (a *Client) PatchAPIDeployHooksSlackV3Selector(params *PatchAPIDeployHooksS panic(msg) } +/* + PostAPIDeployHooksGithubActionsProceduresV3TestSelector tests a github actions deploy hook + + Run a GitHub Action to simulate a GithubActionsDeployHook +*/ +func (a *Client) PostAPIDeployHooksGithubActionsProceduresV3TestSelector(params *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams, opts ...ClientOption) (*PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams() + } + op := &runtime.ClientOperation{ + ID: "PostAPIDeployHooksGithubActionsProceduresV3TestSelector", + Method: "POST", + PathPattern: "/api/deploy-hooks/github-actions/procedures/v3/test/{selector}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK) + 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 PostAPIDeployHooksGithubActionsProceduresV3TestSelector: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PostAPIDeployHooksGithubActionsV3 creates a github actions deploy hook @@ -413,6 +457,46 @@ func (a *Client) PostAPIDeployHooksGithubActionsV3(params *PostAPIDeployHooksGit panic(msg) } +/* + PostAPIDeployHooksSlackProceduresV3TestSelector tests a slack deploy hook + + Send a Slack message to simulate a SlackDeployHook +*/ +func (a *Client) PostAPIDeployHooksSlackProceduresV3TestSelector(params *PostAPIDeployHooksSlackProceduresV3TestSelectorParams, opts ...ClientOption) (*PostAPIDeployHooksSlackProceduresV3TestSelectorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAPIDeployHooksSlackProceduresV3TestSelectorParams() + } + op := &runtime.ClientOperation{ + ID: "PostAPIDeployHooksSlackProceduresV3TestSelector", + Method: "POST", + PathPattern: "/api/deploy-hooks/slack/procedures/v3/test/{selector}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostAPIDeployHooksSlackProceduresV3TestSelectorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostAPIDeployHooksSlackProceduresV3TestSelectorOK) + 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 PostAPIDeployHooksSlackProceduresV3TestSelector: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PostAPIDeployHooksSlackV3 creates a slack deploy hook diff --git a/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_parameters.go b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_parameters.go new file mode 100644 index 000000000..edaed5d0c --- /dev/null +++ b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deploy_hooks + +// 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/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams creates a new PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithTimeout creates a new PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams object +// with the ability to set a timeout on a request. +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithTimeout(timeout time.Duration) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams{ + timeout: timeout, + } +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithContext creates a new PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams object +// with the ability to set a context for a request. +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithContext(ctx context.Context) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams{ + Context: ctx, + } +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithHTTPClient creates a new PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorParamsWithHTTPClient(client *http.Client) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams{ + HTTPClient: client, + } +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams contains all the parameters to send to the API endpoint + for the post API deploy hooks github actions procedures v3 test selector operation. + + Typically these are written to a http.Request. +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams struct { + + /* Request. + + Whether to fully execute the hook (JSON body helps with CSRF protection) + */ + Request *models.SherlockGithubActionsDeployHookTestRunRequest + + /* Selector. + + The ID of the GithubActionsDeployHook + */ + Selector string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post API deploy hooks github actions procedures v3 test selector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithDefaults() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post API deploy hooks github actions procedures v3 test selector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithTimeout(timeout time.Duration) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithContext(ctx context.Context) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithHTTPClient(client *http.Client) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRequest adds the request to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithRequest(request *models.SherlockGithubActionsDeployHookTestRunRequest) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetRequest(request) + return o +} + +// SetRequest adds the request to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetRequest(request *models.SherlockGithubActionsDeployHookTestRunRequest) { + o.Request = request +} + +// WithSelector adds the selector to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WithSelector(selector string) *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams { + o.SetSelector(selector) + return o +} + +// SetSelector adds the selector to the post API deploy hooks github actions procedures v3 test selector params +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) SetSelector(selector string) { + o.Selector = selector +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Request != nil { + if err := r.SetBodyParam(o.Request); err != nil { + return err + } + } + + // path param selector + if err := r.SetPathParam("selector", o.Selector); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_responses.go b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_responses.go new file mode 100644 index 000000000..59b82085b --- /dev/null +++ b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_github_actions_procedures_v3_test_selector_responses.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deploy_hooks + +// 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/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// PostAPIDeployHooksGithubActionsProceduresV3TestSelectorReader is a Reader for the PostAPIDeployHooksGithubActionsProceduresV3TestSelector structure. +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 407: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + 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()) + } +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK describes a response with status code 200, with default header values. + +OK +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK struct { + Payload *models.SherlockGithubActionsDeployHookTestRunResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorOK %+v", 200, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK) GetPayload() *models.SherlockGithubActionsDeployHookTestRunResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SherlockGithubActionsDeployHookTestRunResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorBadRequest %+v", 400, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorForbidden %+v", 403, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorNotFound %+v", 404, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired describes a response with status code 407, with default header values. + +Proxy Authentication Required +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired %+v", 407, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorProxyAuthenticationRequired) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorConflict %+v", 409, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError creates a PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError with default headers values +func NewPostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError() *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError { + return &PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError{} +} + +/* PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}][%d] postApiDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError %+v", 500, o.Payload) +} +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksGithubActionsProceduresV3TestSelectorInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_parameters.go b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_parameters.go new file mode 100644 index 000000000..f09dfda3f --- /dev/null +++ b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deploy_hooks + +// 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/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorParams creates a new PostAPIDeployHooksSlackProceduresV3TestSelectorParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorParams() *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithTimeout creates a new PostAPIDeployHooksSlackProceduresV3TestSelectorParams object +// with the ability to set a timeout on a request. +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithTimeout(timeout time.Duration) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorParams{ + timeout: timeout, + } +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithContext creates a new PostAPIDeployHooksSlackProceduresV3TestSelectorParams object +// with the ability to set a context for a request. +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithContext(ctx context.Context) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorParams{ + Context: ctx, + } +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithHTTPClient creates a new PostAPIDeployHooksSlackProceduresV3TestSelectorParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorParamsWithHTTPClient(client *http.Client) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorParams{ + HTTPClient: client, + } +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorParams contains all the parameters to send to the API endpoint + for the post API deploy hooks slack procedures v3 test selector operation. + + Typically these are written to a http.Request. +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorParams struct { + + /* Request. + + Whether to fully execute the hook (JSON body helps with CSRF protection) + */ + Request *models.SherlockSlackDeployHookTestRunRequest + + /* Selector. + + The ID of the SlackDeployHook to test + */ + Selector string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post API deploy hooks slack procedures v3 test selector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithDefaults() *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post API deploy hooks slack procedures v3 test selector params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithTimeout(timeout time.Duration) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithContext(ctx context.Context) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithHTTPClient(client *http.Client) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRequest adds the request to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithRequest(request *models.SherlockSlackDeployHookTestRunRequest) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetRequest(request) + return o +} + +// SetRequest adds the request to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetRequest(request *models.SherlockSlackDeployHookTestRunRequest) { + o.Request = request +} + +// WithSelector adds the selector to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WithSelector(selector string) *PostAPIDeployHooksSlackProceduresV3TestSelectorParams { + o.SetSelector(selector) + return o +} + +// SetSelector adds the selector to the post API deploy hooks slack procedures v3 test selector params +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) SetSelector(selector string) { + o.Selector = selector +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Request != nil { + if err := r.SetBodyParam(o.Request); err != nil { + return err + } + } + + // path param selector + if err := r.SetPathParam("selector", o.Selector); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_responses.go b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_responses.go new file mode 100644 index 000000000..ef6742c5d --- /dev/null +++ b/sherlock-go-client/client/deploy_hooks/post_api_deploy_hooks_slack_procedures_v3_test_selector_responses.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package deploy_hooks + +// 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/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// PostAPIDeployHooksSlackProceduresV3TestSelectorReader is a Reader for the PostAPIDeployHooksSlackProceduresV3TestSelector structure. +type PostAPIDeployHooksSlackProceduresV3TestSelectorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 407: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + 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()) + } +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorOK creates a PostAPIDeployHooksSlackProceduresV3TestSelectorOK with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorOK() *PostAPIDeployHooksSlackProceduresV3TestSelectorOK { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorOK{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorOK describes a response with status code 200, with default header values. + +OK +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorOK struct { + Payload *models.SherlockSlackDeployHookTestRunResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorOK) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorOK %+v", 200, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorOK) GetPayload() *models.SherlockSlackDeployHookTestRunResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SherlockSlackDeployHookTestRunResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest creates a PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest() *PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorBadRequest %+v", 400, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorForbidden creates a PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorForbidden() *PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorForbidden %+v", 403, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorNotFound creates a PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorNotFound() *PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorNotFound %+v", 404, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired creates a PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired() *PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired describes a response with status code 407, with default header values. + +Proxy Authentication Required +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired %+v", 407, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorProxyAuthenticationRequired) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorConflict creates a PostAPIDeployHooksSlackProceduresV3TestSelectorConflict with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorConflict() *PostAPIDeployHooksSlackProceduresV3TestSelectorConflict { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorConflict{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorConflict struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorConflict) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorConflict %+v", 409, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorConflict) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError creates a PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError with default headers values +func NewPostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError() *PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError { + return &PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError{} +} + +/* PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError) Error() string { + return fmt.Sprintf("[POST /api/deploy-hooks/slack/procedures/v3/test/{selector}][%d] postApiDeployHooksSlackProceduresV3TestSelectorInternalServerError %+v", 500, o.Payload) +} +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PostAPIDeployHooksSlackProceduresV3TestSelectorInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_request.go b/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_request.go new file mode 100644 index 000000000..d01999e06 --- /dev/null +++ b/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SherlockGithubActionsDeployHookTestRunRequest sherlock github actions deploy hook test run request +// +// swagger:model sherlock.GithubActionsDeployHookTestRunRequest +type SherlockGithubActionsDeployHookTestRunRequest struct { + + // Required, whether to fully run the GHA + Execute bool `json:"execute,omitempty"` +} + +// Validate validates this sherlock github actions deploy hook test run request +func (m *SherlockGithubActionsDeployHookTestRunRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this sherlock github actions deploy hook test run request based on context it is used +func (m *SherlockGithubActionsDeployHookTestRunRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SherlockGithubActionsDeployHookTestRunRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SherlockGithubActionsDeployHookTestRunRequest) UnmarshalBinary(b []byte) error { + var res SherlockGithubActionsDeployHookTestRunRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_response.go b/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_response.go new file mode 100644 index 000000000..d91078a2c --- /dev/null +++ b/sherlock-go-client/client/models/sherlock_github_actions_deploy_hook_test_run_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SherlockGithubActionsDeployHookTestRunResponse sherlock github actions deploy hook test run response +// +// swagger:model sherlock.GithubActionsDeployHookTestRunResponse +type SherlockGithubActionsDeployHookTestRunResponse struct { + + // ok + Ok bool `json:"ok,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this sherlock github actions deploy hook test run response +func (m *SherlockGithubActionsDeployHookTestRunResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this sherlock github actions deploy hook test run response based on context it is used +func (m *SherlockGithubActionsDeployHookTestRunResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SherlockGithubActionsDeployHookTestRunResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SherlockGithubActionsDeployHookTestRunResponse) UnmarshalBinary(b []byte) error { + var res SherlockGithubActionsDeployHookTestRunResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_request.go b/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_request.go new file mode 100644 index 000000000..9acb268c1 --- /dev/null +++ b/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SherlockSlackDeployHookTestRunRequest sherlock slack deploy hook test run request +// +// swagger:model sherlock.SlackDeployHookTestRunRequest +type SherlockSlackDeployHookTestRunRequest struct { + + // Required, whether to actually send the Slack message + Execute bool `json:"execute,omitempty"` +} + +// Validate validates this sherlock slack deploy hook test run request +func (m *SherlockSlackDeployHookTestRunRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this sherlock slack deploy hook test run request based on context it is used +func (m *SherlockSlackDeployHookTestRunRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SherlockSlackDeployHookTestRunRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SherlockSlackDeployHookTestRunRequest) UnmarshalBinary(b []byte) error { + var res SherlockSlackDeployHookTestRunRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_response.go b/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_response.go new file mode 100644 index 000000000..0c99952f4 --- /dev/null +++ b/sherlock-go-client/client/models/sherlock_slack_deploy_hook_test_run_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SherlockSlackDeployHookTestRunResponse sherlock slack deploy hook test run response +// +// swagger:model sherlock.SlackDeployHookTestRunResponse +type SherlockSlackDeployHookTestRunResponse struct { + + // ok + Ok bool `json:"ok,omitempty"` +} + +// Validate validates this sherlock slack deploy hook test run response +func (m *SherlockSlackDeployHookTestRunResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this sherlock slack deploy hook test run response based on context it is used +func (m *SherlockSlackDeployHookTestRunResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SherlockSlackDeployHookTestRunResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SherlockSlackDeployHookTestRunResponse) UnmarshalBinary(b []byte) error { + var res SherlockSlackDeployHookTestRunResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/sherlock-typescript-client/.openapi-generator/FILES b/sherlock-typescript-client/.openapi-generator/FILES index c7e40bbe1..47c0909e0 100644 --- a/sherlock-typescript-client/.openapi-generator/FILES +++ b/sherlock-typescript-client/.openapi-generator/FILES @@ -42,9 +42,13 @@ src/models/SherlockCiRunV3Upsert.ts src/models/SherlockClusterV3.ts src/models/SherlockClusterV3Create.ts src/models/SherlockClusterV3Edit.ts +src/models/SherlockGithubActionsDeployHookTestRunRequest.ts +src/models/SherlockGithubActionsDeployHookTestRunResponse.ts src/models/SherlockGithubActionsDeployHookV3.ts src/models/SherlockGithubActionsDeployHookV3Create.ts src/models/SherlockGithubActionsDeployHookV3Edit.ts +src/models/SherlockSlackDeployHookTestRunRequest.ts +src/models/SherlockSlackDeployHookTestRunResponse.ts src/models/SherlockSlackDeployHookV3.ts src/models/SherlockSlackDeployHookV3Create.ts src/models/SherlockSlackDeployHookV3Edit.ts diff --git a/sherlock-typescript-client/README.md b/sherlock-typescript-client/README.md index 8842f57d7..e3de8d958 100644 --- a/sherlock-typescript-client/README.md +++ b/sherlock-typescript-client/README.md @@ -1,4 +1,4 @@ -## @sherlock-js-client/sherlock@v0.2.32 +## @sherlock-js-client/sherlock@v0.2.33 This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: @@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co _published:_ ``` -npm install @sherlock-js-client/sherlock@v0.2.32 --save +npm install @sherlock-js-client/sherlock@v0.2.33 --save ``` _unPublished (not recommended):_ diff --git a/sherlock-typescript-client/package-lock.json b/sherlock-typescript-client/package-lock.json index 6d44cda7a..b7f6d7fce 100644 --- a/sherlock-typescript-client/package-lock.json +++ b/sherlock-typescript-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.32", + "version": "v0.2.33", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.32", + "version": "v0.2.33", "devDependencies": { "typescript": "^4.0" } diff --git a/sherlock-typescript-client/package.json b/sherlock-typescript-client/package.json index 0be62666e..6d8e09ace 100644 --- a/sherlock-typescript-client/package.json +++ b/sherlock-typescript-client/package.json @@ -1,6 +1,6 @@ { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.32", + "version": "v0.2.33", "description": "OpenAPI client for @sherlock-js-client/sherlock", "author": "OpenAPI-Generator", "repository": { diff --git a/sherlock-typescript-client/src/apis/DeployHooksApi.ts b/sherlock-typescript-client/src/apis/DeployHooksApi.ts index da9a1c9a2..e6027850a 100644 --- a/sherlock-typescript-client/src/apis/DeployHooksApi.ts +++ b/sherlock-typescript-client/src/apis/DeployHooksApi.ts @@ -16,9 +16,13 @@ import * as runtime from '../runtime'; import type { ErrorsErrorResponse, + SherlockGithubActionsDeployHookTestRunRequest, + SherlockGithubActionsDeployHookTestRunResponse, SherlockGithubActionsDeployHookV3, SherlockGithubActionsDeployHookV3Create, SherlockGithubActionsDeployHookV3Edit, + SherlockSlackDeployHookTestRunRequest, + SherlockSlackDeployHookTestRunResponse, SherlockSlackDeployHookV3, SherlockSlackDeployHookV3Create, SherlockSlackDeployHookV3Edit, @@ -26,12 +30,20 @@ import type { import { ErrorsErrorResponseFromJSON, ErrorsErrorResponseToJSON, + SherlockGithubActionsDeployHookTestRunRequestFromJSON, + SherlockGithubActionsDeployHookTestRunRequestToJSON, + SherlockGithubActionsDeployHookTestRunResponseFromJSON, + SherlockGithubActionsDeployHookTestRunResponseToJSON, SherlockGithubActionsDeployHookV3FromJSON, SherlockGithubActionsDeployHookV3ToJSON, SherlockGithubActionsDeployHookV3CreateFromJSON, SherlockGithubActionsDeployHookV3CreateToJSON, SherlockGithubActionsDeployHookV3EditFromJSON, SherlockGithubActionsDeployHookV3EditToJSON, + SherlockSlackDeployHookTestRunRequestFromJSON, + SherlockSlackDeployHookTestRunRequestToJSON, + SherlockSlackDeployHookTestRunResponseFromJSON, + SherlockSlackDeployHookTestRunResponseToJSON, SherlockSlackDeployHookV3FromJSON, SherlockSlackDeployHookV3ToJSON, SherlockSlackDeployHookV3CreateFromJSON, @@ -40,6 +52,11 @@ import { SherlockSlackDeployHookV3EditToJSON, } from '../models/index'; +export interface ApiDeployHooksGithubActionsProceduresV3TestSelectorPostRequest { + selector: string; + request: SherlockGithubActionsDeployHookTestRunRequest; +} + export interface ApiDeployHooksGithubActionsV3GetRequest { createdAt?: Date; githubActionsDefaultRef?: string; @@ -74,6 +91,11 @@ export interface ApiDeployHooksGithubActionsV3SelectorPatchRequest { githubActionsDeployHook: SherlockGithubActionsDeployHookV3Edit; } +export interface ApiDeployHooksSlackProceduresV3TestSelectorPostRequest { + selector: string; + request: SherlockSlackDeployHookTestRunRequest; +} + export interface ApiDeployHooksSlackV3GetRequest { createdAt?: Date; id?: number; @@ -109,6 +131,45 @@ export interface ApiDeployHooksSlackV3SelectorPatchRequest { */ export class DeployHooksApi extends runtime.BaseAPI { + /** + * Run a GitHub Action to simulate a GithubActionsDeployHook + * Test a GithubActionsDeployHook + */ + async apiDeployHooksGithubActionsProceduresV3TestSelectorPostRaw(requestParameters: ApiDeployHooksGithubActionsProceduresV3TestSelectorPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.selector === null || requestParameters.selector === undefined) { + throw new runtime.RequiredError('selector','Required parameter requestParameters.selector was null or undefined when calling apiDeployHooksGithubActionsProceduresV3TestSelectorPost.'); + } + + if (requestParameters.request === null || requestParameters.request === undefined) { + throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling apiDeployHooksGithubActionsProceduresV3TestSelectorPost.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/deploy-hooks/github-actions/procedures/v3/test/{selector}`.replace(`{${"selector"}}`, encodeURIComponent(String(requestParameters.selector))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SherlockGithubActionsDeployHookTestRunRequestToJSON(requestParameters.request), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SherlockGithubActionsDeployHookTestRunResponseFromJSON(jsonValue)); + } + + /** + * Run a GitHub Action to simulate a GithubActionsDeployHook + * Test a GithubActionsDeployHook + */ + async apiDeployHooksGithubActionsProceduresV3TestSelectorPost(requestParameters: ApiDeployHooksGithubActionsProceduresV3TestSelectorPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiDeployHooksGithubActionsProceduresV3TestSelectorPostRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * List GithubActionsDeployHooks matching a filter. * List GithubActionsDeployHooks matching a filter @@ -331,6 +392,45 @@ export class DeployHooksApi extends runtime.BaseAPI { return await response.value(); } + /** + * Send a Slack message to simulate a SlackDeployHook + * Test a SlackDeployHook + */ + async apiDeployHooksSlackProceduresV3TestSelectorPostRaw(requestParameters: ApiDeployHooksSlackProceduresV3TestSelectorPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.selector === null || requestParameters.selector === undefined) { + throw new runtime.RequiredError('selector','Required parameter requestParameters.selector was null or undefined when calling apiDeployHooksSlackProceduresV3TestSelectorPost.'); + } + + if (requestParameters.request === null || requestParameters.request === undefined) { + throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling apiDeployHooksSlackProceduresV3TestSelectorPost.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/deploy-hooks/slack/procedures/v3/test/{selector}`.replace(`{${"selector"}}`, encodeURIComponent(String(requestParameters.selector))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SherlockSlackDeployHookTestRunRequestToJSON(requestParameters.request), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SherlockSlackDeployHookTestRunResponseFromJSON(jsonValue)); + } + + /** + * Send a Slack message to simulate a SlackDeployHook + * Test a SlackDeployHook + */ + async apiDeployHooksSlackProceduresV3TestSelectorPost(requestParameters: ApiDeployHooksSlackProceduresV3TestSelectorPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiDeployHooksSlackProceduresV3TestSelectorPostRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * List SlackDeployHooks matching a filter. * List SlackDeployHooks matching a filter diff --git a/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunRequest.ts b/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunRequest.ts new file mode 100644 index 000000000..a5388685a --- /dev/null +++ b/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sherlock + * The Data Science Platform\'s source-of-truth service. Note: this API will try to load and return associations in responses, so clients won\'t need to make as many requests. This behavior isn\'t recursive, though, so associations of associations are *not* fully loaded (even if it might seem that way from looking at the data types). + * + * The version of the OpenAPI document: development + * Contact: dsp-devops@broadinstitute.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SherlockGithubActionsDeployHookTestRunRequest + */ +export interface SherlockGithubActionsDeployHookTestRunRequest { + /** + * Required, whether to fully run the GHA + * @type {boolean} + * @memberof SherlockGithubActionsDeployHookTestRunRequest + */ + execute?: boolean; +} + +/** + * Check if a given object implements the SherlockGithubActionsDeployHookTestRunRequest interface. + */ +export function instanceOfSherlockGithubActionsDeployHookTestRunRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SherlockGithubActionsDeployHookTestRunRequestFromJSON(json: any): SherlockGithubActionsDeployHookTestRunRequest { + return SherlockGithubActionsDeployHookTestRunRequestFromJSONTyped(json, false); +} + +export function SherlockGithubActionsDeployHookTestRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SherlockGithubActionsDeployHookTestRunRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'execute': !exists(json, 'execute') ? undefined : json['execute'], + }; +} + +export function SherlockGithubActionsDeployHookTestRunRequestToJSON(value?: SherlockGithubActionsDeployHookTestRunRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'execute': value.execute, + }; +} + diff --git a/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunResponse.ts b/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunResponse.ts new file mode 100644 index 000000000..2b175b6e7 --- /dev/null +++ b/sherlock-typescript-client/src/models/SherlockGithubActionsDeployHookTestRunResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sherlock + * The Data Science Platform\'s source-of-truth service. Note: this API will try to load and return associations in responses, so clients won\'t need to make as many requests. This behavior isn\'t recursive, though, so associations of associations are *not* fully loaded (even if it might seem that way from looking at the data types). + * + * The version of the OpenAPI document: development + * Contact: dsp-devops@broadinstitute.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SherlockGithubActionsDeployHookTestRunResponse + */ +export interface SherlockGithubActionsDeployHookTestRunResponse { + /** + * + * @type {boolean} + * @memberof SherlockGithubActionsDeployHookTestRunResponse + */ + ok?: boolean; + /** + * + * @type {string} + * @memberof SherlockGithubActionsDeployHookTestRunResponse + */ + url?: string; +} + +/** + * Check if a given object implements the SherlockGithubActionsDeployHookTestRunResponse interface. + */ +export function instanceOfSherlockGithubActionsDeployHookTestRunResponse(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SherlockGithubActionsDeployHookTestRunResponseFromJSON(json: any): SherlockGithubActionsDeployHookTestRunResponse { + return SherlockGithubActionsDeployHookTestRunResponseFromJSONTyped(json, false); +} + +export function SherlockGithubActionsDeployHookTestRunResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SherlockGithubActionsDeployHookTestRunResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'ok': !exists(json, 'ok') ? undefined : json['ok'], + 'url': !exists(json, 'url') ? undefined : json['url'], + }; +} + +export function SherlockGithubActionsDeployHookTestRunResponseToJSON(value?: SherlockGithubActionsDeployHookTestRunResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'ok': value.ok, + 'url': value.url, + }; +} + diff --git a/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunRequest.ts b/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunRequest.ts new file mode 100644 index 000000000..91c4b07b6 --- /dev/null +++ b/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sherlock + * The Data Science Platform\'s source-of-truth service. Note: this API will try to load and return associations in responses, so clients won\'t need to make as many requests. This behavior isn\'t recursive, though, so associations of associations are *not* fully loaded (even if it might seem that way from looking at the data types). + * + * The version of the OpenAPI document: development + * Contact: dsp-devops@broadinstitute.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SherlockSlackDeployHookTestRunRequest + */ +export interface SherlockSlackDeployHookTestRunRequest { + /** + * Required, whether to actually send the Slack message + * @type {boolean} + * @memberof SherlockSlackDeployHookTestRunRequest + */ + execute?: boolean; +} + +/** + * Check if a given object implements the SherlockSlackDeployHookTestRunRequest interface. + */ +export function instanceOfSherlockSlackDeployHookTestRunRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SherlockSlackDeployHookTestRunRequestFromJSON(json: any): SherlockSlackDeployHookTestRunRequest { + return SherlockSlackDeployHookTestRunRequestFromJSONTyped(json, false); +} + +export function SherlockSlackDeployHookTestRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SherlockSlackDeployHookTestRunRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'execute': !exists(json, 'execute') ? undefined : json['execute'], + }; +} + +export function SherlockSlackDeployHookTestRunRequestToJSON(value?: SherlockSlackDeployHookTestRunRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'execute': value.execute, + }; +} + diff --git a/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunResponse.ts b/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunResponse.ts new file mode 100644 index 000000000..43ff4ad19 --- /dev/null +++ b/sherlock-typescript-client/src/models/SherlockSlackDeployHookTestRunResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sherlock + * The Data Science Platform\'s source-of-truth service. Note: this API will try to load and return associations in responses, so clients won\'t need to make as many requests. This behavior isn\'t recursive, though, so associations of associations are *not* fully loaded (even if it might seem that way from looking at the data types). + * + * The version of the OpenAPI document: development + * Contact: dsp-devops@broadinstitute.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SherlockSlackDeployHookTestRunResponse + */ +export interface SherlockSlackDeployHookTestRunResponse { + /** + * + * @type {boolean} + * @memberof SherlockSlackDeployHookTestRunResponse + */ + ok?: boolean; +} + +/** + * Check if a given object implements the SherlockSlackDeployHookTestRunResponse interface. + */ +export function instanceOfSherlockSlackDeployHookTestRunResponse(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SherlockSlackDeployHookTestRunResponseFromJSON(json: any): SherlockSlackDeployHookTestRunResponse { + return SherlockSlackDeployHookTestRunResponseFromJSONTyped(json, false); +} + +export function SherlockSlackDeployHookTestRunResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SherlockSlackDeployHookTestRunResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'ok': !exists(json, 'ok') ? undefined : json['ok'], + }; +} + +export function SherlockSlackDeployHookTestRunResponseToJSON(value?: SherlockSlackDeployHookTestRunResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'ok': value.ok, + }; +} + diff --git a/sherlock-typescript-client/src/models/index.ts b/sherlock-typescript-client/src/models/index.ts index a203f17dc..f1adaf4cd 100644 --- a/sherlock-typescript-client/src/models/index.ts +++ b/sherlock-typescript-client/src/models/index.ts @@ -24,9 +24,13 @@ export * from './SherlockCiRunV3Upsert'; export * from './SherlockClusterV3'; export * from './SherlockClusterV3Create'; export * from './SherlockClusterV3Edit'; +export * from './SherlockGithubActionsDeployHookTestRunRequest'; +export * from './SherlockGithubActionsDeployHookTestRunResponse'; export * from './SherlockGithubActionsDeployHookV3'; export * from './SherlockGithubActionsDeployHookV3Create'; export * from './SherlockGithubActionsDeployHookV3Edit'; +export * from './SherlockSlackDeployHookTestRunRequest'; +export * from './SherlockSlackDeployHookTestRunResponse'; export * from './SherlockSlackDeployHookV3'; export * from './SherlockSlackDeployHookV3Create'; export * from './SherlockSlackDeployHookV3Edit'; diff --git a/sherlock/docs/docs.go b/sherlock/docs/docs.go index 3e86ee02f..661f39326 100644 --- a/sherlock/docs/docs.go +++ b/sherlock/docs/docs.go @@ -2223,6 +2223,80 @@ const docTemplate = `{ } } }, + "/api/deploy-hooks/github-actions/procedures/v3/test/{selector}": { + "post": { + "description": "Run a GitHub Action to simulate a GithubActionsDeployHook", + "produces": [ + "application/json" + ], + "tags": [ + "DeployHooks" + ], + "summary": "Test a GithubActionsDeployHook", + "parameters": [ + { + "type": "string", + "description": "The ID of the GithubActionsDeployHook", + "name": "selector", + "in": "path", + "required": true + }, + { + "description": "Whether to fully execute the hook (JSON body helps with CSRF protection)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/sherlock.GithubActionsDeployHookTestRunRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/sherlock.GithubActionsDeployHookTestRunResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "407": { + "description": "Proxy Authentication Required", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, "/api/deploy-hooks/github-actions/v3": { "get": { "description": "List GithubActionsDeployHooks matching a filter.", @@ -2633,6 +2707,80 @@ const docTemplate = `{ } } }, + "/api/deploy-hooks/slack/procedures/v3/test/{selector}": { + "post": { + "description": "Send a Slack message to simulate a SlackDeployHook", + "produces": [ + "application/json" + ], + "tags": [ + "DeployHooks" + ], + "summary": "Test a SlackDeployHook", + "parameters": [ + { + "type": "string", + "description": "The ID of the SlackDeployHook to test", + "name": "selector", + "in": "path", + "required": true + }, + { + "description": "Whether to fully execute the hook (JSON body helps with CSRF protection)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/sherlock.SlackDeployHookTestRunRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/sherlock.SlackDeployHookTestRunResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "407": { + "description": "Proxy Authentication Required", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, "/api/deploy-hooks/slack/v3": { "get": { "description": "List SlackDeployHooks matching a filter.", @@ -10856,6 +11004,26 @@ const docTemplate = `{ } } }, + "sherlock.GithubActionsDeployHookTestRunRequest": { + "type": "object", + "properties": { + "execute": { + "description": "Required, whether to fully run the GHA", + "type": "boolean" + } + } + }, + "sherlock.GithubActionsDeployHookTestRunResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "url": { + "type": "string" + } + } + }, "sherlock.GithubActionsDeployHookV3": { "type": "object", "properties": { @@ -10990,6 +11158,23 @@ const docTemplate = `{ } } }, + "sherlock.SlackDeployHookTestRunRequest": { + "type": "object", + "properties": { + "execute": { + "description": "Required, whether to actually send the Slack message", + "type": "boolean" + } + } + }, + "sherlock.SlackDeployHookTestRunResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, "sherlock.SlackDeployHookV3": { "type": "object", "properties": { diff --git a/sherlock/docs/swagger.json b/sherlock/docs/swagger.json index 70bb040cc..1925aa406 100644 --- a/sherlock/docs/swagger.json +++ b/sherlock/docs/swagger.json @@ -2219,6 +2219,80 @@ } } }, + "/api/deploy-hooks/github-actions/procedures/v3/test/{selector}": { + "post": { + "description": "Run a GitHub Action to simulate a GithubActionsDeployHook", + "produces": [ + "application/json" + ], + "tags": [ + "DeployHooks" + ], + "summary": "Test a GithubActionsDeployHook", + "parameters": [ + { + "type": "string", + "description": "The ID of the GithubActionsDeployHook", + "name": "selector", + "in": "path", + "required": true + }, + { + "description": "Whether to fully execute the hook (JSON body helps with CSRF protection)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/sherlock.GithubActionsDeployHookTestRunRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/sherlock.GithubActionsDeployHookTestRunResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "407": { + "description": "Proxy Authentication Required", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, "/api/deploy-hooks/github-actions/v3": { "get": { "description": "List GithubActionsDeployHooks matching a filter.", @@ -2629,6 +2703,80 @@ } } }, + "/api/deploy-hooks/slack/procedures/v3/test/{selector}": { + "post": { + "description": "Send a Slack message to simulate a SlackDeployHook", + "produces": [ + "application/json" + ], + "tags": [ + "DeployHooks" + ], + "summary": "Test a SlackDeployHook", + "parameters": [ + { + "type": "string", + "description": "The ID of the SlackDeployHook to test", + "name": "selector", + "in": "path", + "required": true + }, + { + "description": "Whether to fully execute the hook (JSON body helps with CSRF protection)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/sherlock.SlackDeployHookTestRunRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/sherlock.SlackDeployHookTestRunResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "407": { + "description": "Proxy Authentication Required", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, "/api/deploy-hooks/slack/v3": { "get": { "description": "List SlackDeployHooks matching a filter.", @@ -10852,6 +11000,26 @@ } } }, + "sherlock.GithubActionsDeployHookTestRunRequest": { + "type": "object", + "properties": { + "execute": { + "description": "Required, whether to fully run the GHA", + "type": "boolean" + } + } + }, + "sherlock.GithubActionsDeployHookTestRunResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "url": { + "type": "string" + } + } + }, "sherlock.GithubActionsDeployHookV3": { "type": "object", "properties": { @@ -10986,6 +11154,23 @@ } } }, + "sherlock.SlackDeployHookTestRunRequest": { + "type": "object", + "properties": { + "execute": { + "description": "Required, whether to actually send the Slack message", + "type": "boolean" + } + } + }, + "sherlock.SlackDeployHookTestRunResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, "sherlock.SlackDeployHookV3": { "type": "object", "properties": { diff --git a/sherlock/docs/swagger.yaml b/sherlock/docs/swagger.yaml index 2c6151856..862afdb91 100644 --- a/sherlock/docs/swagger.yaml +++ b/sherlock/docs/swagger.yaml @@ -563,6 +563,19 @@ definitions: default: false type: boolean type: object + sherlock.GithubActionsDeployHookTestRunRequest: + properties: + execute: + description: Required, whether to fully run the GHA + type: boolean + type: object + sherlock.GithubActionsDeployHookTestRunResponse: + properties: + ok: + type: boolean + url: + type: string + type: object sherlock.GithubActionsDeployHookV3: properties: createdAt: @@ -678,6 +691,17 @@ definitions: onSuccess: type: boolean type: object + sherlock.SlackDeployHookTestRunRequest: + properties: + execute: + description: Required, whether to actually send the Slack message + type: boolean + type: object + sherlock.SlackDeployHookTestRunResponse: + properties: + ok: + type: boolean + type: object sherlock.SlackDeployHookV3: properties: createdAt: @@ -3545,6 +3569,56 @@ paths: summary: Edit an individual Cluster tags: - Clusters + /api/deploy-hooks/github-actions/procedures/v3/test/{selector}: + post: + description: Run a GitHub Action to simulate a GithubActionsDeployHook + parameters: + - description: The ID of the GithubActionsDeployHook + in: path + name: selector + required: true + type: string + - description: Whether to fully execute the hook (JSON body helps with CSRF + protection) + in: body + name: request + required: true + schema: + $ref: '#/definitions/sherlock.GithubActionsDeployHookTestRunRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/sherlock.GithubActionsDeployHookTestRunResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/errors.ErrorResponse' + "403": + description: Forbidden + schema: + $ref: '#/definitions/errors.ErrorResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/errors.ErrorResponse' + "407": + description: Proxy Authentication Required + schema: + $ref: '#/definitions/errors.ErrorResponse' + "409": + description: Conflict + schema: + $ref: '#/definitions/errors.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/errors.ErrorResponse' + summary: Test a GithubActionsDeployHook + tags: + - DeployHooks /api/deploy-hooks/github-actions/v3: get: description: List GithubActionsDeployHooks matching a filter. @@ -3822,6 +3896,56 @@ paths: summary: Edit an individual GithubActionsDeployHook tags: - DeployHooks + /api/deploy-hooks/slack/procedures/v3/test/{selector}: + post: + description: Send a Slack message to simulate a SlackDeployHook + parameters: + - description: The ID of the SlackDeployHook to test + in: path + name: selector + required: true + type: string + - description: Whether to fully execute the hook (JSON body helps with CSRF + protection) + in: body + name: request + required: true + schema: + $ref: '#/definitions/sherlock.SlackDeployHookTestRunRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/sherlock.SlackDeployHookTestRunResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/errors.ErrorResponse' + "403": + description: Forbidden + schema: + $ref: '#/definitions/errors.ErrorResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/errors.ErrorResponse' + "407": + description: Proxy Authentication Required + schema: + $ref: '#/definitions/errors.ErrorResponse' + "409": + description: Conflict + schema: + $ref: '#/definitions/errors.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/errors.ErrorResponse' + summary: Test a SlackDeployHook + tags: + - DeployHooks /api/deploy-hooks/slack/v3: get: description: List SlackDeployHooks matching a filter.