webhook

package
v0.0.0-...-c407d37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for webhook API

func (*Client) CreateWebhookNotification

func (a *Client) CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error)

CreateWebhookNotification tests endpoint for creating webhook notifications

This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation.

func (*Client) ReceiveWebhookNotification

func (a *Client) ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error)

ReceiveWebhookNotification tests endpoint for receiving messages from our own webhook client

This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The `webhook-client` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption is the option for Client methods

type ClientService

type ClientService interface {
	CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error)

	ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new webhook API client.

type CreateWebhookNotificationCreated

type CreateWebhookNotificationCreated struct {
	Payload *supportmessages.WebhookNotification
}

CreateWebhookNotificationCreated describes a response with status code 201, with default header values.

Successful creation

func NewCreateWebhookNotificationCreated

func NewCreateWebhookNotificationCreated() *CreateWebhookNotificationCreated

NewCreateWebhookNotificationCreated creates a CreateWebhookNotificationCreated with default headers values

func (*CreateWebhookNotificationCreated) Code

Code gets the status code for the create webhook notification created response

func (*CreateWebhookNotificationCreated) Error

func (*CreateWebhookNotificationCreated) GetPayload

func (*CreateWebhookNotificationCreated) IsClientError

func (o *CreateWebhookNotificationCreated) IsClientError() bool

IsClientError returns true when this create webhook notification created response has a 4xx status code

func (*CreateWebhookNotificationCreated) IsCode

func (o *CreateWebhookNotificationCreated) IsCode(code int) bool

IsCode returns true when this create webhook notification created response a status code equal to that given

func (*CreateWebhookNotificationCreated) IsRedirect

func (o *CreateWebhookNotificationCreated) IsRedirect() bool

IsRedirect returns true when this create webhook notification created response has a 3xx status code

func (*CreateWebhookNotificationCreated) IsServerError

func (o *CreateWebhookNotificationCreated) IsServerError() bool

IsServerError returns true when this create webhook notification created response has a 5xx status code

func (*CreateWebhookNotificationCreated) IsSuccess

func (o *CreateWebhookNotificationCreated) IsSuccess() bool

IsSuccess returns true when this create webhook notification created response has a 2xx status code

func (*CreateWebhookNotificationCreated) String

type CreateWebhookNotificationInternalServerError

type CreateWebhookNotificationInternalServerError struct {
	Payload *supportmessages.Error
}

CreateWebhookNotificationInternalServerError describes a response with status code 500, with default header values.

A server error occurred.

func NewCreateWebhookNotificationInternalServerError

func NewCreateWebhookNotificationInternalServerError() *CreateWebhookNotificationInternalServerError

NewCreateWebhookNotificationInternalServerError creates a CreateWebhookNotificationInternalServerError with default headers values

func (*CreateWebhookNotificationInternalServerError) Code

Code gets the status code for the create webhook notification internal server error response

func (*CreateWebhookNotificationInternalServerError) Error

func (*CreateWebhookNotificationInternalServerError) GetPayload

func (*CreateWebhookNotificationInternalServerError) IsClientError

IsClientError returns true when this create webhook notification internal server error response has a 4xx status code

func (*CreateWebhookNotificationInternalServerError) IsCode

IsCode returns true when this create webhook notification internal server error response a status code equal to that given

func (*CreateWebhookNotificationInternalServerError) IsRedirect

IsRedirect returns true when this create webhook notification internal server error response has a 3xx status code

func (*CreateWebhookNotificationInternalServerError) IsServerError

IsServerError returns true when this create webhook notification internal server error response has a 5xx status code

func (*CreateWebhookNotificationInternalServerError) IsSuccess

IsSuccess returns true when this create webhook notification internal server error response has a 2xx status code

func (*CreateWebhookNotificationInternalServerError) String

type CreateWebhookNotificationParams

type CreateWebhookNotificationParams struct {

	/* Body.

	   The notification sent by webhook-client.
	*/
	Body *supportmessages.WebhookNotification

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

CreateWebhookNotificationParams contains all the parameters to send to the API endpoint

for the create webhook notification operation.

Typically these are written to a http.Request.

func NewCreateWebhookNotificationParams

func NewCreateWebhookNotificationParams() *CreateWebhookNotificationParams

NewCreateWebhookNotificationParams creates a new CreateWebhookNotificationParams 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 NewCreateWebhookNotificationParamsWithContext

func NewCreateWebhookNotificationParamsWithContext(ctx context.Context) *CreateWebhookNotificationParams

NewCreateWebhookNotificationParamsWithContext creates a new CreateWebhookNotificationParams object with the ability to set a context for a request.

func NewCreateWebhookNotificationParamsWithHTTPClient

func NewCreateWebhookNotificationParamsWithHTTPClient(client *http.Client) *CreateWebhookNotificationParams

NewCreateWebhookNotificationParamsWithHTTPClient creates a new CreateWebhookNotificationParams object with the ability to set a custom HTTPClient for a request.

func NewCreateWebhookNotificationParamsWithTimeout

func NewCreateWebhookNotificationParamsWithTimeout(timeout time.Duration) *CreateWebhookNotificationParams

NewCreateWebhookNotificationParamsWithTimeout creates a new CreateWebhookNotificationParams object with the ability to set a timeout on a request.

func (*CreateWebhookNotificationParams) SetBody

SetBody adds the body to the create webhook notification params

func (*CreateWebhookNotificationParams) SetContext

func (o *CreateWebhookNotificationParams) SetContext(ctx context.Context)

SetContext adds the context to the create webhook notification params

func (*CreateWebhookNotificationParams) SetDefaults

func (o *CreateWebhookNotificationParams) SetDefaults()

SetDefaults hydrates default values in the create webhook notification params (not the query body).

All values with no default are reset to their zero value.

func (*CreateWebhookNotificationParams) SetHTTPClient

func (o *CreateWebhookNotificationParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the create webhook notification params

func (*CreateWebhookNotificationParams) SetTimeout

func (o *CreateWebhookNotificationParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the create webhook notification params

func (*CreateWebhookNotificationParams) WithBody

WithBody adds the body to the create webhook notification params

func (*CreateWebhookNotificationParams) WithContext

WithContext adds the context to the create webhook notification params

func (*CreateWebhookNotificationParams) WithDefaults

WithDefaults hydrates default values in the create webhook notification params (not the query body).

All values with no default are reset to their zero value.

func (*CreateWebhookNotificationParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the create webhook notification params

func (*CreateWebhookNotificationParams) WithTimeout

WithTimeout adds the timeout to the create webhook notification params

func (*CreateWebhookNotificationParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type CreateWebhookNotificationReader

type CreateWebhookNotificationReader struct {
	// contains filtered or unexported fields
}

CreateWebhookNotificationReader is a Reader for the CreateWebhookNotification structure.

func (*CreateWebhookNotificationReader) ReadResponse

func (o *CreateWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type CreateWebhookNotificationUnprocessableEntity

type CreateWebhookNotificationUnprocessableEntity struct {
	Payload *supportmessages.ValidationError
}

CreateWebhookNotificationUnprocessableEntity describes a response with status code 422, with default header values.

The payload was unprocessable.

func NewCreateWebhookNotificationUnprocessableEntity

func NewCreateWebhookNotificationUnprocessableEntity() *CreateWebhookNotificationUnprocessableEntity

NewCreateWebhookNotificationUnprocessableEntity creates a CreateWebhookNotificationUnprocessableEntity with default headers values

func (*CreateWebhookNotificationUnprocessableEntity) Code

Code gets the status code for the create webhook notification unprocessable entity response

func (*CreateWebhookNotificationUnprocessableEntity) Error

func (*CreateWebhookNotificationUnprocessableEntity) GetPayload

func (*CreateWebhookNotificationUnprocessableEntity) IsClientError

IsClientError returns true when this create webhook notification unprocessable entity response has a 4xx status code

func (*CreateWebhookNotificationUnprocessableEntity) IsCode

IsCode returns true when this create webhook notification unprocessable entity response a status code equal to that given

func (*CreateWebhookNotificationUnprocessableEntity) IsRedirect

IsRedirect returns true when this create webhook notification unprocessable entity response has a 3xx status code

func (*CreateWebhookNotificationUnprocessableEntity) IsServerError

IsServerError returns true when this create webhook notification unprocessable entity response has a 5xx status code

func (*CreateWebhookNotificationUnprocessableEntity) IsSuccess

IsSuccess returns true when this create webhook notification unprocessable entity response has a 2xx status code

func (*CreateWebhookNotificationUnprocessableEntity) String

type ReceiveWebhookNotificationBadRequest

type ReceiveWebhookNotificationBadRequest struct {
	Payload *supportmessages.ClientError
}

ReceiveWebhookNotificationBadRequest describes a response with status code 400, with default header values.

The request payload is invalid.

func NewReceiveWebhookNotificationBadRequest

func NewReceiveWebhookNotificationBadRequest() *ReceiveWebhookNotificationBadRequest

NewReceiveWebhookNotificationBadRequest creates a ReceiveWebhookNotificationBadRequest with default headers values

func (*ReceiveWebhookNotificationBadRequest) Code

Code gets the status code for the receive webhook notification bad request response

func (*ReceiveWebhookNotificationBadRequest) Error

func (*ReceiveWebhookNotificationBadRequest) GetPayload

func (*ReceiveWebhookNotificationBadRequest) IsClientError

func (o *ReceiveWebhookNotificationBadRequest) IsClientError() bool

IsClientError returns true when this receive webhook notification bad request response has a 4xx status code

func (*ReceiveWebhookNotificationBadRequest) IsCode

IsCode returns true when this receive webhook notification bad request response a status code equal to that given

func (*ReceiveWebhookNotificationBadRequest) IsRedirect

IsRedirect returns true when this receive webhook notification bad request response has a 3xx status code

func (*ReceiveWebhookNotificationBadRequest) IsServerError

func (o *ReceiveWebhookNotificationBadRequest) IsServerError() bool

IsServerError returns true when this receive webhook notification bad request response has a 5xx status code

func (*ReceiveWebhookNotificationBadRequest) IsSuccess

IsSuccess returns true when this receive webhook notification bad request response has a 2xx status code

func (*ReceiveWebhookNotificationBadRequest) String

type ReceiveWebhookNotificationForbidden

type ReceiveWebhookNotificationForbidden struct {
	Payload *supportmessages.ClientError
}

ReceiveWebhookNotificationForbidden describes a response with status code 403, with default header values.

The request was denied.

func NewReceiveWebhookNotificationForbidden

func NewReceiveWebhookNotificationForbidden() *ReceiveWebhookNotificationForbidden

NewReceiveWebhookNotificationForbidden creates a ReceiveWebhookNotificationForbidden with default headers values

func (*ReceiveWebhookNotificationForbidden) Code

Code gets the status code for the receive webhook notification forbidden response

func (*ReceiveWebhookNotificationForbidden) Error

func (*ReceiveWebhookNotificationForbidden) GetPayload

func (*ReceiveWebhookNotificationForbidden) IsClientError

func (o *ReceiveWebhookNotificationForbidden) IsClientError() bool

IsClientError returns true when this receive webhook notification forbidden response has a 4xx status code

func (*ReceiveWebhookNotificationForbidden) IsCode

IsCode returns true when this receive webhook notification forbidden response a status code equal to that given

func (*ReceiveWebhookNotificationForbidden) IsRedirect

func (o *ReceiveWebhookNotificationForbidden) IsRedirect() bool

IsRedirect returns true when this receive webhook notification forbidden response has a 3xx status code

func (*ReceiveWebhookNotificationForbidden) IsServerError

func (o *ReceiveWebhookNotificationForbidden) IsServerError() bool

IsServerError returns true when this receive webhook notification forbidden response has a 5xx status code

func (*ReceiveWebhookNotificationForbidden) IsSuccess

IsSuccess returns true when this receive webhook notification forbidden response has a 2xx status code

func (*ReceiveWebhookNotificationForbidden) String

type ReceiveWebhookNotificationInternalServerError

type ReceiveWebhookNotificationInternalServerError struct {
	Payload *supportmessages.Error
}

ReceiveWebhookNotificationInternalServerError describes a response with status code 500, with default header values.

A server error occurred.

func NewReceiveWebhookNotificationInternalServerError

func NewReceiveWebhookNotificationInternalServerError() *ReceiveWebhookNotificationInternalServerError

NewReceiveWebhookNotificationInternalServerError creates a ReceiveWebhookNotificationInternalServerError with default headers values

func (*ReceiveWebhookNotificationInternalServerError) Code

Code gets the status code for the receive webhook notification internal server error response

func (*ReceiveWebhookNotificationInternalServerError) Error

func (*ReceiveWebhookNotificationInternalServerError) GetPayload

func (*ReceiveWebhookNotificationInternalServerError) IsClientError

IsClientError returns true when this receive webhook notification internal server error response has a 4xx status code

func (*ReceiveWebhookNotificationInternalServerError) IsCode

IsCode returns true when this receive webhook notification internal server error response a status code equal to that given

func (*ReceiveWebhookNotificationInternalServerError) IsRedirect

IsRedirect returns true when this receive webhook notification internal server error response has a 3xx status code

func (*ReceiveWebhookNotificationInternalServerError) IsServerError

IsServerError returns true when this receive webhook notification internal server error response has a 5xx status code

func (*ReceiveWebhookNotificationInternalServerError) IsSuccess

IsSuccess returns true when this receive webhook notification internal server error response has a 2xx status code

func (*ReceiveWebhookNotificationInternalServerError) String

type ReceiveWebhookNotificationOK

type ReceiveWebhookNotificationOK struct {
	Payload *supportmessages.WebhookNotification
}

ReceiveWebhookNotificationOK describes a response with status code 200, with default header values.

Received notification

func NewReceiveWebhookNotificationOK

func NewReceiveWebhookNotificationOK() *ReceiveWebhookNotificationOK

NewReceiveWebhookNotificationOK creates a ReceiveWebhookNotificationOK with default headers values

func (*ReceiveWebhookNotificationOK) Code

Code gets the status code for the receive webhook notification o k response

func (*ReceiveWebhookNotificationOK) Error

func (*ReceiveWebhookNotificationOK) GetPayload

func (*ReceiveWebhookNotificationOK) IsClientError

func (o *ReceiveWebhookNotificationOK) IsClientError() bool

IsClientError returns true when this receive webhook notification o k response has a 4xx status code

func (*ReceiveWebhookNotificationOK) IsCode

func (o *ReceiveWebhookNotificationOK) IsCode(code int) bool

IsCode returns true when this receive webhook notification o k response a status code equal to that given

func (*ReceiveWebhookNotificationOK) IsRedirect

func (o *ReceiveWebhookNotificationOK) IsRedirect() bool

IsRedirect returns true when this receive webhook notification o k response has a 3xx status code

func (*ReceiveWebhookNotificationOK) IsServerError

func (o *ReceiveWebhookNotificationOK) IsServerError() bool

IsServerError returns true when this receive webhook notification o k response has a 5xx status code

func (*ReceiveWebhookNotificationOK) IsSuccess

func (o *ReceiveWebhookNotificationOK) IsSuccess() bool

IsSuccess returns true when this receive webhook notification o k response has a 2xx status code

func (*ReceiveWebhookNotificationOK) String

type ReceiveWebhookNotificationParams

type ReceiveWebhookNotificationParams struct {

	/* Body.

	   The webhook notification being sent
	*/
	Body *supportmessages.WebhookNotification

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

ReceiveWebhookNotificationParams contains all the parameters to send to the API endpoint

for the receive webhook notification operation.

Typically these are written to a http.Request.

func NewReceiveWebhookNotificationParams

func NewReceiveWebhookNotificationParams() *ReceiveWebhookNotificationParams

NewReceiveWebhookNotificationParams creates a new ReceiveWebhookNotificationParams 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 NewReceiveWebhookNotificationParamsWithContext

func NewReceiveWebhookNotificationParamsWithContext(ctx context.Context) *ReceiveWebhookNotificationParams

NewReceiveWebhookNotificationParamsWithContext creates a new ReceiveWebhookNotificationParams object with the ability to set a context for a request.

func NewReceiveWebhookNotificationParamsWithHTTPClient

func NewReceiveWebhookNotificationParamsWithHTTPClient(client *http.Client) *ReceiveWebhookNotificationParams

NewReceiveWebhookNotificationParamsWithHTTPClient creates a new ReceiveWebhookNotificationParams object with the ability to set a custom HTTPClient for a request.

func NewReceiveWebhookNotificationParamsWithTimeout

func NewReceiveWebhookNotificationParamsWithTimeout(timeout time.Duration) *ReceiveWebhookNotificationParams

NewReceiveWebhookNotificationParamsWithTimeout creates a new ReceiveWebhookNotificationParams object with the ability to set a timeout on a request.

func (*ReceiveWebhookNotificationParams) SetBody

SetBody adds the body to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) SetContext

SetContext adds the context to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) SetDefaults

func (o *ReceiveWebhookNotificationParams) SetDefaults()

SetDefaults hydrates default values in the receive webhook notification params (not the query body).

All values with no default are reset to their zero value.

func (*ReceiveWebhookNotificationParams) SetHTTPClient

func (o *ReceiveWebhookNotificationParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) SetTimeout

func (o *ReceiveWebhookNotificationParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) WithBody

WithBody adds the body to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) WithContext

WithContext adds the context to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) WithDefaults

WithDefaults hydrates default values in the receive webhook notification params (not the query body).

All values with no default are reset to their zero value.

func (*ReceiveWebhookNotificationParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) WithTimeout

WithTimeout adds the timeout to the receive webhook notification params

func (*ReceiveWebhookNotificationParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type ReceiveWebhookNotificationReader

type ReceiveWebhookNotificationReader struct {
	// contains filtered or unexported fields
}

ReceiveWebhookNotificationReader is a Reader for the ReceiveWebhookNotification structure.

func (*ReceiveWebhookNotificationReader) ReadResponse

func (o *ReceiveWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type ReceiveWebhookNotificationUnauthorized

type ReceiveWebhookNotificationUnauthorized struct {
	Payload *supportmessages.ClientError
}

ReceiveWebhookNotificationUnauthorized describes a response with status code 401, with default header values.

The request was denied.

func NewReceiveWebhookNotificationUnauthorized

func NewReceiveWebhookNotificationUnauthorized() *ReceiveWebhookNotificationUnauthorized

NewReceiveWebhookNotificationUnauthorized creates a ReceiveWebhookNotificationUnauthorized with default headers values

func (*ReceiveWebhookNotificationUnauthorized) Code

Code gets the status code for the receive webhook notification unauthorized response

func (*ReceiveWebhookNotificationUnauthorized) Error

func (*ReceiveWebhookNotificationUnauthorized) GetPayload

func (*ReceiveWebhookNotificationUnauthorized) IsClientError

func (o *ReceiveWebhookNotificationUnauthorized) IsClientError() bool

IsClientError returns true when this receive webhook notification unauthorized response has a 4xx status code

func (*ReceiveWebhookNotificationUnauthorized) IsCode

IsCode returns true when this receive webhook notification unauthorized response a status code equal to that given

func (*ReceiveWebhookNotificationUnauthorized) IsRedirect

IsRedirect returns true when this receive webhook notification unauthorized response has a 3xx status code

func (*ReceiveWebhookNotificationUnauthorized) IsServerError

func (o *ReceiveWebhookNotificationUnauthorized) IsServerError() bool

IsServerError returns true when this receive webhook notification unauthorized response has a 5xx status code

func (*ReceiveWebhookNotificationUnauthorized) IsSuccess

IsSuccess returns true when this receive webhook notification unauthorized response has a 2xx status code

func (*ReceiveWebhookNotificationUnauthorized) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL