From b9777b4d48e8a803eb5a5cdbb95353ae7b6143e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:55:06 -0700 Subject: [PATCH] Regenerate Swagger code 24aa4964 (#100) --- ...1_signals_webhook_targets_id_parameters.go | 148 +++++++++++ ...v1_signals_webhook_targets_id_responses.go | 83 +++++++ ...1_signals_webhook_targets_id_parameters.go | 148 +++++++++++ ...v1_signals_webhook_targets_id_responses.go | 83 +++++++ ...t_v1_signals_webhook_targets_parameters.go | 230 ++++++++++++++++++ ...et_v1_signals_webhook_targets_responses.go | 83 +++++++ ...1_signals_webhook_targets_id_parameters.go | 169 +++++++++++++ ...v1_signals_webhook_targets_id_responses.go | 83 +++++++ ...t_v1_signals_webhook_targets_parameters.go | 150 ++++++++++++ ...st_v1_signals_webhook_targets_responses.go | 83 +++++++ client/signals/signals_client.go | 215 ++++++++++++++++ models/incident_entity.go | 116 ++++++++- .../incidents_lifecycle_measurement_entity.go | 95 ++++++++ .../incidents_lifecycle_milestone_entity.go | 163 +++++++++++++ models/incidents_lifecycle_phase_entity.go | 131 ++++++++++ models/patch_v1_signals_email_targets_id.go | 7 +- models/patch_v1_signals_webhook_targets_id.go | 62 +++++ ...v1_teams_team_id_escalation_policies_id.go | 7 +- .../patch_v1_teams_team_id_signal_rules_id.go | 7 +- models/post_v1_signals_email_targets.go | 7 +- models/post_v1_signals_webhook_targets.go | 97 ++++++++ ...st_v1_teams_team_id_escalation_policies.go | 7 +- models/post_v1_teams_team_id_signal_rules.go | 7 +- models/post_v1_ticketing_tickets.go | 3 + 24 files changed, 2171 insertions(+), 13 deletions(-) create mode 100644 client/signals/delete_v1_signals_webhook_targets_id_parameters.go create mode 100644 client/signals/delete_v1_signals_webhook_targets_id_responses.go create mode 100644 client/signals/get_v1_signals_webhook_targets_id_parameters.go create mode 100644 client/signals/get_v1_signals_webhook_targets_id_responses.go create mode 100644 client/signals/get_v1_signals_webhook_targets_parameters.go create mode 100644 client/signals/get_v1_signals_webhook_targets_responses.go create mode 100644 client/signals/patch_v1_signals_webhook_targets_id_parameters.go create mode 100644 client/signals/patch_v1_signals_webhook_targets_id_responses.go create mode 100644 client/signals/post_v1_signals_webhook_targets_parameters.go create mode 100644 client/signals/post_v1_signals_webhook_targets_responses.go create mode 100644 models/incidents_lifecycle_measurement_entity.go create mode 100644 models/incidents_lifecycle_milestone_entity.go create mode 100644 models/incidents_lifecycle_phase_entity.go create mode 100644 models/patch_v1_signals_webhook_targets_id.go create mode 100644 models/post_v1_signals_webhook_targets.go diff --git a/client/signals/delete_v1_signals_webhook_targets_id_parameters.go b/client/signals/delete_v1_signals_webhook_targets_id_parameters.go new file mode 100644 index 0000000..56f6da0 --- /dev/null +++ b/client/signals/delete_v1_signals_webhook_targets_id_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// NewDeleteV1SignalsWebhookTargetsIDParams creates a new DeleteV1SignalsWebhookTargetsIDParams 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 NewDeleteV1SignalsWebhookTargetsIDParams() *DeleteV1SignalsWebhookTargetsIDParams { + return &DeleteV1SignalsWebhookTargetsIDParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteV1SignalsWebhookTargetsIDParamsWithTimeout creates a new DeleteV1SignalsWebhookTargetsIDParams object +// with the ability to set a timeout on a request. +func NewDeleteV1SignalsWebhookTargetsIDParamsWithTimeout(timeout time.Duration) *DeleteV1SignalsWebhookTargetsIDParams { + return &DeleteV1SignalsWebhookTargetsIDParams{ + timeout: timeout, + } +} + +// NewDeleteV1SignalsWebhookTargetsIDParamsWithContext creates a new DeleteV1SignalsWebhookTargetsIDParams object +// with the ability to set a context for a request. +func NewDeleteV1SignalsWebhookTargetsIDParamsWithContext(ctx context.Context) *DeleteV1SignalsWebhookTargetsIDParams { + return &DeleteV1SignalsWebhookTargetsIDParams{ + Context: ctx, + } +} + +// NewDeleteV1SignalsWebhookTargetsIDParamsWithHTTPClient creates a new DeleteV1SignalsWebhookTargetsIDParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteV1SignalsWebhookTargetsIDParamsWithHTTPClient(client *http.Client) *DeleteV1SignalsWebhookTargetsIDParams { + return &DeleteV1SignalsWebhookTargetsIDParams{ + HTTPClient: client, + } +} + +/* +DeleteV1SignalsWebhookTargetsIDParams contains all the parameters to send to the API endpoint + + for the delete v1 signals webhook targets Id operation. + + Typically these are written to a http.Request. +*/ +type DeleteV1SignalsWebhookTargetsIDParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteV1SignalsWebhookTargetsIDParams) WithDefaults() *DeleteV1SignalsWebhookTargetsIDParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteV1SignalsWebhookTargetsIDParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) WithTimeout(timeout time.Duration) *DeleteV1SignalsWebhookTargetsIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) WithContext(ctx context.Context) *DeleteV1SignalsWebhookTargetsIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) WithHTTPClient(client *http.Client) *DeleteV1SignalsWebhookTargetsIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) WithID(id string) *DeleteV1SignalsWebhookTargetsIDParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete v1 signals webhook targets Id params +func (o *DeleteV1SignalsWebhookTargetsIDParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteV1SignalsWebhookTargetsIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_v1_signals_webhook_targets_id_responses.go b/client/signals/delete_v1_signals_webhook_targets_id_responses.go new file mode 100644 index 0000000..13c65df --- /dev/null +++ b/client/signals/delete_v1_signals_webhook_targets_id_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// DeleteV1SignalsWebhookTargetsIDReader is a Reader for the DeleteV1SignalsWebhookTargetsID structure. +type DeleteV1SignalsWebhookTargetsIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteV1SignalsWebhookTargetsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteV1SignalsWebhookTargetsIDNoContent() + 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()) + } +} + +// NewDeleteV1SignalsWebhookTargetsIDNoContent creates a DeleteV1SignalsWebhookTargetsIDNoContent with default headers values +func NewDeleteV1SignalsWebhookTargetsIDNoContent() *DeleteV1SignalsWebhookTargetsIDNoContent { + return &DeleteV1SignalsWebhookTargetsIDNoContent{} +} + +/* +DeleteV1SignalsWebhookTargetsIDNoContent describes a response with status code 204, with default header values. + +Delete a Signals webhook target by ID +*/ +type DeleteV1SignalsWebhookTargetsIDNoContent struct { +} + +// IsSuccess returns true when this delete v1 signals webhook targets Id no content response has a 2xx status code +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete v1 signals webhook targets Id no content response has a 3xx status code +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete v1 signals webhook targets Id no content response has a 4xx status code +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete v1 signals webhook targets Id no content response has a 5xx status code +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete v1 signals webhook targets Id no content response a status code equal to that given +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/signals/webhook_targets/{id}][%d] deleteV1SignalsWebhookTargetsIdNoContent ", 204) +} + +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/signals/webhook_targets/{id}][%d] deleteV1SignalsWebhookTargetsIdNoContent ", 204) +} + +func (o *DeleteV1SignalsWebhookTargetsIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_v1_signals_webhook_targets_id_parameters.go b/client/signals/get_v1_signals_webhook_targets_id_parameters.go new file mode 100644 index 0000000..1daf8e1 --- /dev/null +++ b/client/signals/get_v1_signals_webhook_targets_id_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// NewGetV1SignalsWebhookTargetsIDParams creates a new GetV1SignalsWebhookTargetsIDParams 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 NewGetV1SignalsWebhookTargetsIDParams() *GetV1SignalsWebhookTargetsIDParams { + return &GetV1SignalsWebhookTargetsIDParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetV1SignalsWebhookTargetsIDParamsWithTimeout creates a new GetV1SignalsWebhookTargetsIDParams object +// with the ability to set a timeout on a request. +func NewGetV1SignalsWebhookTargetsIDParamsWithTimeout(timeout time.Duration) *GetV1SignalsWebhookTargetsIDParams { + return &GetV1SignalsWebhookTargetsIDParams{ + timeout: timeout, + } +} + +// NewGetV1SignalsWebhookTargetsIDParamsWithContext creates a new GetV1SignalsWebhookTargetsIDParams object +// with the ability to set a context for a request. +func NewGetV1SignalsWebhookTargetsIDParamsWithContext(ctx context.Context) *GetV1SignalsWebhookTargetsIDParams { + return &GetV1SignalsWebhookTargetsIDParams{ + Context: ctx, + } +} + +// NewGetV1SignalsWebhookTargetsIDParamsWithHTTPClient creates a new GetV1SignalsWebhookTargetsIDParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetV1SignalsWebhookTargetsIDParamsWithHTTPClient(client *http.Client) *GetV1SignalsWebhookTargetsIDParams { + return &GetV1SignalsWebhookTargetsIDParams{ + HTTPClient: client, + } +} + +/* +GetV1SignalsWebhookTargetsIDParams contains all the parameters to send to the API endpoint + + for the get v1 signals webhook targets Id operation. + + Typically these are written to a http.Request. +*/ +type GetV1SignalsWebhookTargetsIDParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1SignalsWebhookTargetsIDParams) WithDefaults() *GetV1SignalsWebhookTargetsIDParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1SignalsWebhookTargetsIDParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) WithTimeout(timeout time.Duration) *GetV1SignalsWebhookTargetsIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) WithContext(ctx context.Context) *GetV1SignalsWebhookTargetsIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) WithHTTPClient(client *http.Client) *GetV1SignalsWebhookTargetsIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) WithID(id string) *GetV1SignalsWebhookTargetsIDParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get v1 signals webhook targets Id params +func (o *GetV1SignalsWebhookTargetsIDParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetV1SignalsWebhookTargetsIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_v1_signals_webhook_targets_id_responses.go b/client/signals/get_v1_signals_webhook_targets_id_responses.go new file mode 100644 index 0000000..7be523a --- /dev/null +++ b/client/signals/get_v1_signals_webhook_targets_id_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// GetV1SignalsWebhookTargetsIDReader is a Reader for the GetV1SignalsWebhookTargetsID structure. +type GetV1SignalsWebhookTargetsIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetV1SignalsWebhookTargetsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetV1SignalsWebhookTargetsIDOK() + 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()) + } +} + +// NewGetV1SignalsWebhookTargetsIDOK creates a GetV1SignalsWebhookTargetsIDOK with default headers values +func NewGetV1SignalsWebhookTargetsIDOK() *GetV1SignalsWebhookTargetsIDOK { + return &GetV1SignalsWebhookTargetsIDOK{} +} + +/* +GetV1SignalsWebhookTargetsIDOK describes a response with status code 200, with default header values. + +Get a Signals webhook target by ID +*/ +type GetV1SignalsWebhookTargetsIDOK struct { +} + +// IsSuccess returns true when this get v1 signals webhook targets Id o k response has a 2xx status code +func (o *GetV1SignalsWebhookTargetsIDOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get v1 signals webhook targets Id o k response has a 3xx status code +func (o *GetV1SignalsWebhookTargetsIDOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v1 signals webhook targets Id o k response has a 4xx status code +func (o *GetV1SignalsWebhookTargetsIDOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get v1 signals webhook targets Id o k response has a 5xx status code +func (o *GetV1SignalsWebhookTargetsIDOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get v1 signals webhook targets Id o k response a status code equal to that given +func (o *GetV1SignalsWebhookTargetsIDOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetV1SignalsWebhookTargetsIDOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets/{id}][%d] getV1SignalsWebhookTargetsIdOK ", 200) +} + +func (o *GetV1SignalsWebhookTargetsIDOK) String() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets/{id}][%d] getV1SignalsWebhookTargetsIdOK ", 200) +} + +func (o *GetV1SignalsWebhookTargetsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_v1_signals_webhook_targets_parameters.go b/client/signals/get_v1_signals_webhook_targets_parameters.go new file mode 100644 index 0000000..3318645 --- /dev/null +++ b/client/signals/get_v1_signals_webhook_targets_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// NewGetV1SignalsWebhookTargetsParams creates a new GetV1SignalsWebhookTargetsParams 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 NewGetV1SignalsWebhookTargetsParams() *GetV1SignalsWebhookTargetsParams { + return &GetV1SignalsWebhookTargetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetV1SignalsWebhookTargetsParamsWithTimeout creates a new GetV1SignalsWebhookTargetsParams object +// with the ability to set a timeout on a request. +func NewGetV1SignalsWebhookTargetsParamsWithTimeout(timeout time.Duration) *GetV1SignalsWebhookTargetsParams { + return &GetV1SignalsWebhookTargetsParams{ + timeout: timeout, + } +} + +// NewGetV1SignalsWebhookTargetsParamsWithContext creates a new GetV1SignalsWebhookTargetsParams object +// with the ability to set a context for a request. +func NewGetV1SignalsWebhookTargetsParamsWithContext(ctx context.Context) *GetV1SignalsWebhookTargetsParams { + return &GetV1SignalsWebhookTargetsParams{ + Context: ctx, + } +} + +// NewGetV1SignalsWebhookTargetsParamsWithHTTPClient creates a new GetV1SignalsWebhookTargetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetV1SignalsWebhookTargetsParamsWithHTTPClient(client *http.Client) *GetV1SignalsWebhookTargetsParams { + return &GetV1SignalsWebhookTargetsParams{ + HTTPClient: client, + } +} + +/* +GetV1SignalsWebhookTargetsParams contains all the parameters to send to the API endpoint + + for the get v1 signals webhook targets operation. + + Typically these are written to a http.Request. +*/ +type GetV1SignalsWebhookTargetsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query string for searching through the list of webhook targets. + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get v1 signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1SignalsWebhookTargetsParams) WithDefaults() *GetV1SignalsWebhookTargetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v1 signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1SignalsWebhookTargetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithTimeout(timeout time.Duration) *GetV1SignalsWebhookTargetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithContext(ctx context.Context) *GetV1SignalsWebhookTargetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithHTTPClient(client *http.Client) *GetV1SignalsWebhookTargetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithPage(page *int32) *GetV1SignalsWebhookTargetsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithPerPage(perPage *int32) *GetV1SignalsWebhookTargetsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) WithQuery(query *string) *GetV1SignalsWebhookTargetsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get v1 signals webhook targets params +func (o *GetV1SignalsWebhookTargetsParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *GetV1SignalsWebhookTargetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_v1_signals_webhook_targets_responses.go b/client/signals/get_v1_signals_webhook_targets_responses.go new file mode 100644 index 0000000..5d2f600 --- /dev/null +++ b/client/signals/get_v1_signals_webhook_targets_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// GetV1SignalsWebhookTargetsReader is a Reader for the GetV1SignalsWebhookTargets structure. +type GetV1SignalsWebhookTargetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetV1SignalsWebhookTargetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetV1SignalsWebhookTargetsOK() + 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()) + } +} + +// NewGetV1SignalsWebhookTargetsOK creates a GetV1SignalsWebhookTargetsOK with default headers values +func NewGetV1SignalsWebhookTargetsOK() *GetV1SignalsWebhookTargetsOK { + return &GetV1SignalsWebhookTargetsOK{} +} + +/* +GetV1SignalsWebhookTargetsOK describes a response with status code 200, with default header values. + +List all Signals webhook targets. +*/ +type GetV1SignalsWebhookTargetsOK struct { +} + +// IsSuccess returns true when this get v1 signals webhook targets o k response has a 2xx status code +func (o *GetV1SignalsWebhookTargetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get v1 signals webhook targets o k response has a 3xx status code +func (o *GetV1SignalsWebhookTargetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v1 signals webhook targets o k response has a 4xx status code +func (o *GetV1SignalsWebhookTargetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get v1 signals webhook targets o k response has a 5xx status code +func (o *GetV1SignalsWebhookTargetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get v1 signals webhook targets o k response a status code equal to that given +func (o *GetV1SignalsWebhookTargetsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetV1SignalsWebhookTargetsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets][%d] getV1SignalsWebhookTargetsOK ", 200) +} + +func (o *GetV1SignalsWebhookTargetsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets][%d] getV1SignalsWebhookTargetsOK ", 200) +} + +func (o *GetV1SignalsWebhookTargetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/patch_v1_signals_webhook_targets_id_parameters.go b/client/signals/patch_v1_signals_webhook_targets_id_parameters.go new file mode 100644 index 0000000..78a0095 --- /dev/null +++ b/client/signals/patch_v1_signals_webhook_targets_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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/firehydrant/api-client-go/models" +) + +// NewPatchV1SignalsWebhookTargetsIDParams creates a new PatchV1SignalsWebhookTargetsIDParams 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 NewPatchV1SignalsWebhookTargetsIDParams() *PatchV1SignalsWebhookTargetsIDParams { + return &PatchV1SignalsWebhookTargetsIDParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPatchV1SignalsWebhookTargetsIDParamsWithTimeout creates a new PatchV1SignalsWebhookTargetsIDParams object +// with the ability to set a timeout on a request. +func NewPatchV1SignalsWebhookTargetsIDParamsWithTimeout(timeout time.Duration) *PatchV1SignalsWebhookTargetsIDParams { + return &PatchV1SignalsWebhookTargetsIDParams{ + timeout: timeout, + } +} + +// NewPatchV1SignalsWebhookTargetsIDParamsWithContext creates a new PatchV1SignalsWebhookTargetsIDParams object +// with the ability to set a context for a request. +func NewPatchV1SignalsWebhookTargetsIDParamsWithContext(ctx context.Context) *PatchV1SignalsWebhookTargetsIDParams { + return &PatchV1SignalsWebhookTargetsIDParams{ + Context: ctx, + } +} + +// NewPatchV1SignalsWebhookTargetsIDParamsWithHTTPClient creates a new PatchV1SignalsWebhookTargetsIDParams object +// with the ability to set a custom HTTPClient for a request. +func NewPatchV1SignalsWebhookTargetsIDParamsWithHTTPClient(client *http.Client) *PatchV1SignalsWebhookTargetsIDParams { + return &PatchV1SignalsWebhookTargetsIDParams{ + HTTPClient: client, + } +} + +/* +PatchV1SignalsWebhookTargetsIDParams contains all the parameters to send to the API endpoint + + for the patch v1 signals webhook targets Id operation. + + Typically these are written to a http.Request. +*/ +type PatchV1SignalsWebhookTargetsIDParams struct { + + // ID. + ID string + + // PatchV1SignalsWebhookTargetsID. + PatchV1SignalsWebhookTargetsID *models.PatchV1SignalsWebhookTargetsID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the patch v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchV1SignalsWebhookTargetsIDParams) WithDefaults() *PatchV1SignalsWebhookTargetsIDParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch v1 signals webhook targets Id params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchV1SignalsWebhookTargetsIDParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) WithTimeout(timeout time.Duration) *PatchV1SignalsWebhookTargetsIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) WithContext(ctx context.Context) *PatchV1SignalsWebhookTargetsIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) WithHTTPClient(client *http.Client) *PatchV1SignalsWebhookTargetsIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) WithID(id string) *PatchV1SignalsWebhookTargetsIDParams { + o.SetID(id) + return o +} + +// SetID adds the id to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) SetID(id string) { + o.ID = id +} + +// WithPatchV1SignalsWebhookTargetsID adds the patchV1SignalsWebhookTargetsID to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) WithPatchV1SignalsWebhookTargetsID(patchV1SignalsWebhookTargetsID *models.PatchV1SignalsWebhookTargetsID) *PatchV1SignalsWebhookTargetsIDParams { + o.SetPatchV1SignalsWebhookTargetsID(patchV1SignalsWebhookTargetsID) + return o +} + +// SetPatchV1SignalsWebhookTargetsID adds the patchV1SignalsWebhookTargetsId to the patch v1 signals webhook targets Id params +func (o *PatchV1SignalsWebhookTargetsIDParams) SetPatchV1SignalsWebhookTargetsID(patchV1SignalsWebhookTargetsID *models.PatchV1SignalsWebhookTargetsID) { + o.PatchV1SignalsWebhookTargetsID = patchV1SignalsWebhookTargetsID +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchV1SignalsWebhookTargetsIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.PatchV1SignalsWebhookTargetsID != nil { + if err := r.SetBodyParam(o.PatchV1SignalsWebhookTargetsID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/patch_v1_signals_webhook_targets_id_responses.go b/client/signals/patch_v1_signals_webhook_targets_id_responses.go new file mode 100644 index 0000000..66cb74f --- /dev/null +++ b/client/signals/patch_v1_signals_webhook_targets_id_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// PatchV1SignalsWebhookTargetsIDReader is a Reader for the PatchV1SignalsWebhookTargetsID structure. +type PatchV1SignalsWebhookTargetsIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchV1SignalsWebhookTargetsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPatchV1SignalsWebhookTargetsIDOK() + 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()) + } +} + +// NewPatchV1SignalsWebhookTargetsIDOK creates a PatchV1SignalsWebhookTargetsIDOK with default headers values +func NewPatchV1SignalsWebhookTargetsIDOK() *PatchV1SignalsWebhookTargetsIDOK { + return &PatchV1SignalsWebhookTargetsIDOK{} +} + +/* +PatchV1SignalsWebhookTargetsIDOK describes a response with status code 200, with default header values. + +Update a Signals webhook target by ID +*/ +type PatchV1SignalsWebhookTargetsIDOK struct { +} + +// IsSuccess returns true when this patch v1 signals webhook targets Id o k response has a 2xx status code +func (o *PatchV1SignalsWebhookTargetsIDOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this patch v1 signals webhook targets Id o k response has a 3xx status code +func (o *PatchV1SignalsWebhookTargetsIDOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch v1 signals webhook targets Id o k response has a 4xx status code +func (o *PatchV1SignalsWebhookTargetsIDOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch v1 signals webhook targets Id o k response has a 5xx status code +func (o *PatchV1SignalsWebhookTargetsIDOK) IsServerError() bool { + return false +} + +// IsCode returns true when this patch v1 signals webhook targets Id o k response a status code equal to that given +func (o *PatchV1SignalsWebhookTargetsIDOK) IsCode(code int) bool { + return code == 200 +} + +func (o *PatchV1SignalsWebhookTargetsIDOK) Error() string { + return fmt.Sprintf("[PATCH /v1/signals/webhook_targets/{id}][%d] patchV1SignalsWebhookTargetsIdOK ", 200) +} + +func (o *PatchV1SignalsWebhookTargetsIDOK) String() string { + return fmt.Sprintf("[PATCH /v1/signals/webhook_targets/{id}][%d] patchV1SignalsWebhookTargetsIdOK ", 200) +} + +func (o *PatchV1SignalsWebhookTargetsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/post_v1_signals_webhook_targets_parameters.go b/client/signals/post_v1_signals_webhook_targets_parameters.go new file mode 100644 index 0000000..0bd0483 --- /dev/null +++ b/client/signals/post_v1_signals_webhook_targets_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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/firehydrant/api-client-go/models" +) + +// NewPostV1SignalsWebhookTargetsParams creates a new PostV1SignalsWebhookTargetsParams 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 NewPostV1SignalsWebhookTargetsParams() *PostV1SignalsWebhookTargetsParams { + return &PostV1SignalsWebhookTargetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostV1SignalsWebhookTargetsParamsWithTimeout creates a new PostV1SignalsWebhookTargetsParams object +// with the ability to set a timeout on a request. +func NewPostV1SignalsWebhookTargetsParamsWithTimeout(timeout time.Duration) *PostV1SignalsWebhookTargetsParams { + return &PostV1SignalsWebhookTargetsParams{ + timeout: timeout, + } +} + +// NewPostV1SignalsWebhookTargetsParamsWithContext creates a new PostV1SignalsWebhookTargetsParams object +// with the ability to set a context for a request. +func NewPostV1SignalsWebhookTargetsParamsWithContext(ctx context.Context) *PostV1SignalsWebhookTargetsParams { + return &PostV1SignalsWebhookTargetsParams{ + Context: ctx, + } +} + +// NewPostV1SignalsWebhookTargetsParamsWithHTTPClient creates a new PostV1SignalsWebhookTargetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostV1SignalsWebhookTargetsParamsWithHTTPClient(client *http.Client) *PostV1SignalsWebhookTargetsParams { + return &PostV1SignalsWebhookTargetsParams{ + HTTPClient: client, + } +} + +/* +PostV1SignalsWebhookTargetsParams contains all the parameters to send to the API endpoint + + for the post v1 signals webhook targets operation. + + Typically these are written to a http.Request. +*/ +type PostV1SignalsWebhookTargetsParams struct { + + // PostV1SignalsWebhookTargets. + PostV1SignalsWebhookTargets *models.PostV1SignalsWebhookTargets + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post v1 signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostV1SignalsWebhookTargetsParams) WithDefaults() *PostV1SignalsWebhookTargetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post v1 signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostV1SignalsWebhookTargetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) WithTimeout(timeout time.Duration) *PostV1SignalsWebhookTargetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) WithContext(ctx context.Context) *PostV1SignalsWebhookTargetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) WithHTTPClient(client *http.Client) *PostV1SignalsWebhookTargetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPostV1SignalsWebhookTargets adds the postV1SignalsWebhookTargets to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) WithPostV1SignalsWebhookTargets(postV1SignalsWebhookTargets *models.PostV1SignalsWebhookTargets) *PostV1SignalsWebhookTargetsParams { + o.SetPostV1SignalsWebhookTargets(postV1SignalsWebhookTargets) + return o +} + +// SetPostV1SignalsWebhookTargets adds the postV1SignalsWebhookTargets to the post v1 signals webhook targets params +func (o *PostV1SignalsWebhookTargetsParams) SetPostV1SignalsWebhookTargets(postV1SignalsWebhookTargets *models.PostV1SignalsWebhookTargets) { + o.PostV1SignalsWebhookTargets = postV1SignalsWebhookTargets +} + +// WriteToRequest writes these params to a swagger request +func (o *PostV1SignalsWebhookTargetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PostV1SignalsWebhookTargets != nil { + if err := r.SetBodyParam(o.PostV1SignalsWebhookTargets); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/post_v1_signals_webhook_targets_responses.go b/client/signals/post_v1_signals_webhook_targets_responses.go new file mode 100644 index 0000000..6c26ef0 --- /dev/null +++ b/client/signals/post_v1_signals_webhook_targets_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// 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" +) + +// PostV1SignalsWebhookTargetsReader is a Reader for the PostV1SignalsWebhookTargets structure. +type PostV1SignalsWebhookTargetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostV1SignalsWebhookTargetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPostV1SignalsWebhookTargetsCreated() + 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()) + } +} + +// NewPostV1SignalsWebhookTargetsCreated creates a PostV1SignalsWebhookTargetsCreated with default headers values +func NewPostV1SignalsWebhookTargetsCreated() *PostV1SignalsWebhookTargetsCreated { + return &PostV1SignalsWebhookTargetsCreated{} +} + +/* +PostV1SignalsWebhookTargetsCreated describes a response with status code 201, with default header values. + +Create a Signals webhook target. +*/ +type PostV1SignalsWebhookTargetsCreated struct { +} + +// IsSuccess returns true when this post v1 signals webhook targets created response has a 2xx status code +func (o *PostV1SignalsWebhookTargetsCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post v1 signals webhook targets created response has a 3xx status code +func (o *PostV1SignalsWebhookTargetsCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post v1 signals webhook targets created response has a 4xx status code +func (o *PostV1SignalsWebhookTargetsCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this post v1 signals webhook targets created response has a 5xx status code +func (o *PostV1SignalsWebhookTargetsCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this post v1 signals webhook targets created response a status code equal to that given +func (o *PostV1SignalsWebhookTargetsCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *PostV1SignalsWebhookTargetsCreated) Error() string { + return fmt.Sprintf("[POST /v1/signals/webhook_targets][%d] postV1SignalsWebhookTargetsCreated ", 201) +} + +func (o *PostV1SignalsWebhookTargetsCreated) String() string { + return fmt.Sprintf("[POST /v1/signals/webhook_targets][%d] postV1SignalsWebhookTargetsCreated ", 201) +} + +func (o *PostV1SignalsWebhookTargetsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/signals_client.go b/client/signals/signals_client.go index c15c148..fecc179 100644 --- a/client/signals/signals_client.go +++ b/client/signals/signals_client.go @@ -32,6 +32,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { DeleteV1SignalsEmailTargetsID(params *DeleteV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsEmailTargetsIDNoContent, error) + DeleteV1SignalsWebhookTargetsID(params *DeleteV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsWebhookTargetsIDNoContent, error) + GetV1SignalsAnalyticsGroupedMetrics(params *GetV1SignalsAnalyticsGroupedMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsGroupedMetricsOK, error) GetV1SignalsAnalyticsMttx(params *GetV1SignalsAnalyticsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsMttxOK, error) @@ -48,12 +50,20 @@ type ClientService interface { GetV1SignalsTransposers(params *GetV1SignalsTransposersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsTransposersOK, error) + GetV1SignalsWebhookTargets(params *GetV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsOK, error) + + GetV1SignalsWebhookTargetsID(params *GetV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsIDOK, error) + PatchV1SignalsEmailTargetsID(params *PatchV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsEmailTargetsIDOK, error) + PatchV1SignalsWebhookTargetsID(params *PatchV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsWebhookTargetsIDOK, error) + PostV1SignalsDebugger(params *PostV1SignalsDebuggerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsDebuggerCreated, error) PostV1SignalsEmailTargets(params *PostV1SignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsEmailTargetsCreated, error) + PostV1SignalsWebhookTargets(params *PostV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsWebhookTargetsCreated, error) + SetTransport(transport runtime.ClientTransport) } @@ -98,6 +108,47 @@ func (a *Client) DeleteV1SignalsEmailTargetsID(params *DeleteV1SignalsEmailTarge panic(msg) } +/* +DeleteV1SignalsWebhookTargetsID deletes an webhook target + +Delete a Signals webhook target by ID +*/ +func (a *Client) DeleteV1SignalsWebhookTargetsID(params *DeleteV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsWebhookTargetsIDNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteV1SignalsWebhookTargetsIDParams() + } + op := &runtime.ClientOperation{ + ID: "deleteV1SignalsWebhookTargetsId", + Method: "DELETE", + PathPattern: "/v1/signals/webhook_targets/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteV1SignalsWebhookTargetsIDReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteV1SignalsWebhookTargetsIDNoContent) + 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 deleteV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetV1SignalsAnalyticsGroupedMetrics generates grouped alert metrics @@ -422,6 +473,88 @@ func (a *Client) GetV1SignalsTransposers(params *GetV1SignalsTransposersParams, panic(msg) } +/* +GetV1SignalsWebhookTargets lists webhook targets + +List all Signals webhook targets. +*/ +func (a *Client) GetV1SignalsWebhookTargets(params *GetV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetV1SignalsWebhookTargetsParams() + } + op := &runtime.ClientOperation{ + ID: "getV1SignalsWebhookTargets", + Method: "GET", + PathPattern: "/v1/signals/webhook_targets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetV1SignalsWebhookTargetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetV1SignalsWebhookTargetsOK) + 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 getV1SignalsWebhookTargets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetV1SignalsWebhookTargetsID gets an webhook target + +Get a Signals webhook target by ID +*/ +func (a *Client) GetV1SignalsWebhookTargetsID(params *GetV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetV1SignalsWebhookTargetsIDParams() + } + op := &runtime.ClientOperation{ + ID: "getV1SignalsWebhookTargetsId", + Method: "GET", + PathPattern: "/v1/signals/webhook_targets/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetV1SignalsWebhookTargetsIDReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetV1SignalsWebhookTargetsIDOK) + 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 getV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PatchV1SignalsEmailTargetsID updates an email target @@ -463,6 +596,47 @@ func (a *Client) PatchV1SignalsEmailTargetsID(params *PatchV1SignalsEmailTargets panic(msg) } +/* +PatchV1SignalsWebhookTargetsID updates an webhook target + +Update a Signals webhook target by ID +*/ +func (a *Client) PatchV1SignalsWebhookTargetsID(params *PatchV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsWebhookTargetsIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPatchV1SignalsWebhookTargetsIDParams() + } + op := &runtime.ClientOperation{ + ID: "patchV1SignalsWebhookTargetsId", + Method: "PATCH", + PathPattern: "/v1/signals/webhook_targets/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PatchV1SignalsWebhookTargetsIDReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PatchV1SignalsWebhookTargetsIDOK) + 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 patchV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PostV1SignalsDebugger post v1 signals debugger API */ @@ -543,6 +717,47 @@ func (a *Client) PostV1SignalsEmailTargets(params *PostV1SignalsEmailTargetsPara panic(msg) } +/* +PostV1SignalsWebhookTargets creates an webhook target + +Create a Signals webhook target. +*/ +func (a *Client) PostV1SignalsWebhookTargets(params *PostV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsWebhookTargetsCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostV1SignalsWebhookTargetsParams() + } + op := &runtime.ClientOperation{ + ID: "postV1SignalsWebhookTargets", + Method: "POST", + PathPattern: "/v1/signals/webhook_targets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostV1SignalsWebhookTargetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostV1SignalsWebhookTargetsCreated) + 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 postV1SignalsWebhookTargets: 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/models/incident_entity.go b/models/incident_entity.go index 8bb3027..2e77db4 100644 --- a/models/incident_entity.go +++ b/models/incident_entity.go @@ -106,7 +106,13 @@ type IncidentEntity struct { // last update LastUpdate string `json:"last_update,omitempty"` - // milestones + // lifecycle measurements + LifecycleMeasurements []*IncidentsLifecycleMeasurementEntity `json:"lifecycle_measurements"` + + // lifecycle phases + LifecyclePhases []*IncidentsLifecyclePhaseEntity `json:"lifecycle_phases"` + + // DEPRECATED: Please use lifecycle phases instead Milestones []*IncidentsMilestoneEntity `json:"milestones"` // monetary impact @@ -246,6 +252,14 @@ func (m *IncidentEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLifecycleMeasurements(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLifecyclePhases(formats); err != nil { + res = append(res, err) + } + if err := m.validateMilestones(formats); err != nil { res = append(res, err) } @@ -607,6 +621,58 @@ func (m *IncidentEntity) validateLastNote(formats strfmt.Registry) error { return nil } +func (m *IncidentEntity) validateLifecycleMeasurements(formats strfmt.Registry) error { + if swag.IsZero(m.LifecycleMeasurements) { // not required + return nil + } + + for i := 0; i < len(m.LifecycleMeasurements); i++ { + if swag.IsZero(m.LifecycleMeasurements[i]) { // not required + continue + } + + if m.LifecycleMeasurements[i] != nil { + if err := m.LifecycleMeasurements[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lifecycle_measurements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lifecycle_measurements" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IncidentEntity) validateLifecyclePhases(formats strfmt.Registry) error { + if swag.IsZero(m.LifecyclePhases) { // not required + return nil + } + + for i := 0; i < len(m.LifecyclePhases); i++ { + if swag.IsZero(m.LifecyclePhases[i]) { // not required + continue + } + + if m.LifecyclePhases[i] != nil { + if err := m.LifecyclePhases[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lifecycle_phases" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lifecycle_phases" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *IncidentEntity) validateMilestones(formats strfmt.Registry) error { if swag.IsZero(m.Milestones) { // not required return nil @@ -877,6 +943,14 @@ func (m *IncidentEntity) ContextValidate(ctx context.Context, formats strfmt.Reg res = append(res, err) } + if err := m.contextValidateLifecycleMeasurements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLifecyclePhases(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMilestones(ctx, formats); err != nil { res = append(res, err) } @@ -1147,6 +1221,46 @@ func (m *IncidentEntity) contextValidateLastNote(ctx context.Context, formats st return nil } +func (m *IncidentEntity) contextValidateLifecycleMeasurements(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.LifecycleMeasurements); i++ { + + if m.LifecycleMeasurements[i] != nil { + if err := m.LifecycleMeasurements[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lifecycle_measurements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lifecycle_measurements" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IncidentEntity) contextValidateLifecyclePhases(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.LifecyclePhases); i++ { + + if m.LifecyclePhases[i] != nil { + if err := m.LifecyclePhases[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lifecycle_phases" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lifecycle_phases" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *IncidentEntity) contextValidateMilestones(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Milestones); i++ { diff --git a/models/incidents_lifecycle_measurement_entity.go b/models/incidents_lifecycle_measurement_entity.go new file mode 100644 index 0000000..8caa96d --- /dev/null +++ b/models/incidents_lifecycle_measurement_entity.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IncidentsLifecycleMeasurementEntity incidents lifecycle measurement entity +// +// swagger:model Incidents_LifecycleMeasurementEntity +type IncidentsLifecycleMeasurementEntity struct { + + // calculated at + // Format: date-time + CalculatedAt strfmt.DateTime `json:"calculated_at,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // ends at milestone + EndsAtMilestone string `json:"ends_at_milestone,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` + + // starts at milestone + StartsAtMilestone string `json:"starts_at_milestone,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this incidents lifecycle measurement entity +func (m *IncidentsLifecycleMeasurementEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCalculatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IncidentsLifecycleMeasurementEntity) validateCalculatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CalculatedAt) { // not required + return nil + } + + if err := validate.FormatOf("calculated_at", "body", "date-time", m.CalculatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this incidents lifecycle measurement entity based on context it is used +func (m *IncidentsLifecycleMeasurementEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IncidentsLifecycleMeasurementEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IncidentsLifecycleMeasurementEntity) UnmarshalBinary(b []byte) error { + var res IncidentsLifecycleMeasurementEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/incidents_lifecycle_milestone_entity.go b/models/incidents_lifecycle_milestone_entity.go new file mode 100644 index 0000000..8a1bc23 --- /dev/null +++ b/models/incidents_lifecycle_milestone_entity.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IncidentsLifecycleMilestoneEntity incidents lifecycle milestone entity +// +// swagger:model Incidents_LifecycleMilestoneEntity +type IncidentsLifecycleMilestoneEntity struct { + + // description + Description string `json:"description,omitempty"` + + // duration + Duration string `json:"duration,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // occurred at + // Format: date-time + OccurredAt strfmt.DateTime `json:"occurred_at,omitempty"` + + // position + Position int32 `json:"position,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` + + // updated by + UpdatedBy *AuthorEntity `json:"updated_by,omitempty"` +} + +// Validate validates this incidents lifecycle milestone entity +func (m *IncidentsLifecycleMilestoneEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedBy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IncidentsLifecycleMilestoneEntity) validateOccurredAt(formats strfmt.Registry) error { + if swag.IsZero(m.OccurredAt) { // not required + return nil + } + + if err := validate.FormatOf("occurred_at", "body", "date-time", m.OccurredAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *IncidentsLifecycleMilestoneEntity) 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 +} + +func (m *IncidentsLifecycleMilestoneEntity) validateUpdatedBy(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedBy) { // not required + return nil + } + + if m.UpdatedBy != nil { + if err := m.UpdatedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("updated_by") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("updated_by") + } + return err + } + } + + return nil +} + +// ContextValidate validate this incidents lifecycle milestone entity based on the context it is used +func (m *IncidentsLifecycleMilestoneEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUpdatedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IncidentsLifecycleMilestoneEntity) contextValidateUpdatedBy(ctx context.Context, formats strfmt.Registry) error { + + if m.UpdatedBy != nil { + if err := m.UpdatedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("updated_by") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("updated_by") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IncidentsLifecycleMilestoneEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IncidentsLifecycleMilestoneEntity) UnmarshalBinary(b []byte) error { + var res IncidentsLifecycleMilestoneEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/incidents_lifecycle_phase_entity.go b/models/incidents_lifecycle_phase_entity.go new file mode 100644 index 0000000..7c3ee2c --- /dev/null +++ b/models/incidents_lifecycle_phase_entity.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IncidentsLifecyclePhaseEntity incidents lifecycle phase entity +// +// swagger:model Incidents_LifecyclePhaseEntity +type IncidentsLifecyclePhaseEntity struct { + + // description + Description string `json:"description,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // milestones + Milestones []*IncidentsLifecycleMilestoneEntity `json:"milestones"` + + // name + Name string `json:"name,omitempty"` + + // position + Position int32 `json:"position,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this incidents lifecycle phase entity +func (m *IncidentsLifecyclePhaseEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMilestones(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IncidentsLifecyclePhaseEntity) validateMilestones(formats strfmt.Registry) error { + if swag.IsZero(m.Milestones) { // not required + return nil + } + + for i := 0; i < len(m.Milestones); i++ { + if swag.IsZero(m.Milestones[i]) { // not required + continue + } + + if m.Milestones[i] != nil { + if err := m.Milestones[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this incidents lifecycle phase entity based on the context it is used +func (m *IncidentsLifecyclePhaseEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMilestones(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IncidentsLifecyclePhaseEntity) contextValidateMilestones(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Milestones); i++ { + + if m.Milestones[i] != nil { + if err := m.Milestones[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IncidentsLifecyclePhaseEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IncidentsLifecyclePhaseEntity) UnmarshalBinary(b []byte) error { + var res IncidentsLifecyclePhaseEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/patch_v1_signals_email_targets_id.go b/models/patch_v1_signals_email_targets_id.go index ad3ac8d..daac5b5 100644 --- a/models/patch_v1_signals_email_targets_id.go +++ b/models/patch_v1_signals_email_targets_id.go @@ -190,7 +190,7 @@ type PatchV1SignalsEmailTargetsIDTarget struct { // The type of target that the inbound email will notify when matched. // Required: true - // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel] + // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel Webhook] Type *string `json:"type"` } @@ -225,7 +225,7 @@ var patchV1SignalsEmailTargetsIdTargetTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -252,6 +252,9 @@ const ( // PatchV1SignalsEmailTargetsIDTargetTypeSlackChannel captures enum value "SlackChannel" PatchV1SignalsEmailTargetsIDTargetTypeSlackChannel string = "SlackChannel" + + // PatchV1SignalsEmailTargetsIDTargetTypeWebhook captures enum value "Webhook" + PatchV1SignalsEmailTargetsIDTargetTypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/patch_v1_signals_webhook_targets_id.go b/models/patch_v1_signals_webhook_targets_id.go new file mode 100644 index 0000000..a6d549e --- /dev/null +++ b/models/patch_v1_signals_webhook_targets_id.go @@ -0,0 +1,62 @@ +// 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" +) + +// PatchV1SignalsWebhookTargetsID Update a Signals webhook target by ID +// +// swagger:model patchV1SignalsWebhookTargetsId +type PatchV1SignalsWebhookTargetsID struct { + + // An optional detailed description of the webhook target. + Description string `json:"description,omitempty"` + + // The webhook target's name. + Name string `json:"name,omitempty"` + + // An optional secret we will provide in the `FH-Signature` header + // when sending a payload to the webhook target. This key will not be + // shown in any response once configured. + // + SigningKey string `json:"signing_key,omitempty"` + + // The URL that the webhook target will notify. + URL string `json:"url,omitempty"` +} + +// Validate validates this patch v1 signals webhook targets Id +func (m *PatchV1SignalsWebhookTargetsID) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this patch v1 signals webhook targets Id based on context it is used +func (m *PatchV1SignalsWebhookTargetsID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PatchV1SignalsWebhookTargetsID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchV1SignalsWebhookTargetsID) UnmarshalBinary(b []byte) error { + var res PatchV1SignalsWebhookTargetsID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/patch_v1_teams_team_id_escalation_policies_id.go b/models/patch_v1_teams_team_id_escalation_policies_id.go index 4a472b9..befaf88 100644 --- a/models/patch_v1_teams_team_id_escalation_policies_id.go +++ b/models/patch_v1_teams_team_id_escalation_policies_id.go @@ -412,7 +412,7 @@ type PatchV1TeamsTeamIDEscalationPoliciesIDStepsItems0TargetsItems0 struct { // The type of target that the step will notify. // Required: true - // Enum: [OnCallSchedule User SlackChannel EntireTeam] + // Enum: [OnCallSchedule User SlackChannel EntireTeam Webhook] Type *string `json:"type"` } @@ -447,7 +447,7 @@ var patchV1TeamsTeamIdEscalationPoliciesIdStepsItems0TargetsItems0TypeTypePropEn func init() { var res []string - if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -468,6 +468,9 @@ const ( // PatchV1TeamsTeamIDEscalationPoliciesIDStepsItems0TargetsItems0TypeEntireTeam captures enum value "EntireTeam" PatchV1TeamsTeamIDEscalationPoliciesIDStepsItems0TargetsItems0TypeEntireTeam string = "EntireTeam" + + // PatchV1TeamsTeamIDEscalationPoliciesIDStepsItems0TargetsItems0TypeWebhook captures enum value "Webhook" + PatchV1TeamsTeamIDEscalationPoliciesIDStepsItems0TargetsItems0TypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/patch_v1_teams_team_id_signal_rules_id.go b/models/patch_v1_teams_team_id_signal_rules_id.go index 1a3fa01..f304f67 100644 --- a/models/patch_v1_teams_team_id_signal_rules_id.go +++ b/models/patch_v1_teams_team_id_signal_rules_id.go @@ -37,7 +37,7 @@ type PatchV1TeamsTeamIDSignalRulesID struct { TargetID string `json:"target_id,omitempty"` // The type of target that the rule will notify when matched. - // Enum: [EscalationPolicy OnCallSchedule User] + // Enum: [EscalationPolicy OnCallSchedule User Webhook] TargetType string `json:"target_type,omitempty"` } @@ -111,7 +111,7 @@ var patchV1TeamsTeamIdSignalRulesIdTypeTargetTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -129,6 +129,9 @@ const ( // PatchV1TeamsTeamIDSignalRulesIDTargetTypeUser captures enum value "User" PatchV1TeamsTeamIDSignalRulesIDTargetTypeUser string = "User" + + // PatchV1TeamsTeamIDSignalRulesIDTargetTypeWebhook captures enum value "Webhook" + PatchV1TeamsTeamIDSignalRulesIDTargetTypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/post_v1_signals_email_targets.go b/models/post_v1_signals_email_targets.go index d6db549..0fc2aca 100644 --- a/models/post_v1_signals_email_targets.go +++ b/models/post_v1_signals_email_targets.go @@ -204,7 +204,7 @@ type PostV1SignalsEmailTargetsTarget struct { // The type of target that the inbound email will notify when matched. // Required: true - // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel] + // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel Webhook] Type *string `json:"type"` } @@ -239,7 +239,7 @@ var postV1SignalsEmailTargetsTargetTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -266,6 +266,9 @@ const ( // PostV1SignalsEmailTargetsTargetTypeSlackChannel captures enum value "SlackChannel" PostV1SignalsEmailTargetsTargetTypeSlackChannel string = "SlackChannel" + + // PostV1SignalsEmailTargetsTargetTypeWebhook captures enum value "Webhook" + PostV1SignalsEmailTargetsTargetTypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/post_v1_signals_webhook_targets.go b/models/post_v1_signals_webhook_targets.go new file mode 100644 index 0000000..c7d10a8 --- /dev/null +++ b/models/post_v1_signals_webhook_targets.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PostV1SignalsWebhookTargets Create a Signals webhook target. +// +// swagger:model postV1SignalsWebhookTargets +type PostV1SignalsWebhookTargets struct { + + // An optional detailed description of the webhook target. + Description string `json:"description,omitempty"` + + // The webhook target's name. + // Required: true + Name *string `json:"name"` + + // An optional secret we will provide in the `FH-Signature` header + // when sending a payload to the webhook target. This key will not be + // shown in any response once configured. + // + SigningKey string `json:"signing_key,omitempty"` + + // The URL that the webhook target will notify. + // Required: true + URL *string `json:"url"` +} + +// Validate validates this post v1 signals webhook targets +func (m *PostV1SignalsWebhookTargets) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostV1SignalsWebhookTargets) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *PostV1SignalsWebhookTargets) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this post v1 signals webhook targets based on context it is used +func (m *PostV1SignalsWebhookTargets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PostV1SignalsWebhookTargets) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PostV1SignalsWebhookTargets) UnmarshalBinary(b []byte) error { + var res PostV1SignalsWebhookTargets + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/post_v1_teams_team_id_escalation_policies.go b/models/post_v1_teams_team_id_escalation_policies.go index 8b4645c..1b1c0c1 100644 --- a/models/post_v1_teams_team_id_escalation_policies.go +++ b/models/post_v1_teams_team_id_escalation_policies.go @@ -430,7 +430,7 @@ type PostV1TeamsTeamIDEscalationPoliciesStepsItems0TargetsItems0 struct { // The type of target that the step will notify. // Required: true - // Enum: [OnCallSchedule User SlackChannel EntireTeam] + // Enum: [OnCallSchedule User SlackChannel EntireTeam Webhook] Type *string `json:"type"` } @@ -465,7 +465,7 @@ var postV1TeamsTeamIdEscalationPoliciesStepsItems0TargetsItems0TypeTypePropEnum func init() { var res []string - if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -486,6 +486,9 @@ const ( // PostV1TeamsTeamIDEscalationPoliciesStepsItems0TargetsItems0TypeEntireTeam captures enum value "EntireTeam" PostV1TeamsTeamIDEscalationPoliciesStepsItems0TargetsItems0TypeEntireTeam string = "EntireTeam" + + // PostV1TeamsTeamIDEscalationPoliciesStepsItems0TargetsItems0TypeWebhook captures enum value "Webhook" + PostV1TeamsTeamIDEscalationPoliciesStepsItems0TargetsItems0TypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/post_v1_teams_team_id_signal_rules.go b/models/post_v1_teams_team_id_signal_rules.go index 1fca453..047eb3f 100644 --- a/models/post_v1_teams_team_id_signal_rules.go +++ b/models/post_v1_teams_team_id_signal_rules.go @@ -41,7 +41,7 @@ type PostV1TeamsTeamIDSignalRules struct { // The type of target that the rule will notify when matched. // Required: true - // Enum: [EscalationPolicy OnCallSchedule User] + // Enum: [EscalationPolicy OnCallSchedule User Webhook] TargetType *string `json:"target_type"` } @@ -154,7 +154,7 @@ var postV1TeamsTeamIdSignalRulesTypeTargetTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User","Webhook"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -172,6 +172,9 @@ const ( // PostV1TeamsTeamIDSignalRulesTargetTypeUser captures enum value "User" PostV1TeamsTeamIDSignalRulesTargetTypeUser string = "User" + + // PostV1TeamsTeamIDSignalRulesTargetTypeWebhook captures enum value "Webhook" + PostV1TeamsTeamIDSignalRulesTargetTypeWebhook string = "Webhook" ) // prop value enum diff --git a/models/post_v1_ticketing_tickets.go b/models/post_v1_ticketing_tickets.go index b2fef9e..9bca732 100644 --- a/models/post_v1_ticketing_tickets.go +++ b/models/post_v1_ticketing_tickets.go @@ -28,6 +28,9 @@ type PostV1TicketingTickets struct { // project id ProjectID string `json:"project_id,omitempty"` + // Which incident this ticket is related to, in the format of 'incident/UUID' + RelatedTo string `json:"related_to,omitempty"` + // The remote URL for an existing ticket in a supported and configured ticketing integration RemoteURL string `json:"remote_url,omitempty"`