webhooks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 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 webhooks API

func (*Client) GetHookEvents

func (a *Client) GetHookEvents(params *GetHookEventsParams, authInfo runtime.ClientAuthInfoWriter) (*GetHookEventsOK, error)
GetHookEvents Returns the webhook resource or subject types on which webhooks can

be registered.

Each resource/subject type contains an `events` link that returns the paginated list of specific events each individual subject type can emit.

This endpoint is publicly accessible and does not require authentication or scopes.

Example:

``` $ curl https://api.bitbucket.org/2.0/hook_events

{
    "repository": {
        "links": {
            "events": {
                "href": "https://api.bitbucket.org/2.0/hook_events/repository"
            }
        }
    },
    "team": {
        "links": {
            "events": {
                "href": "https://api.bitbucket.org/2.0/hook_events/team"
            }
        }
    },
    "user": {
        "links": {
            "events": {
                "href": "https://api.bitbucket.org/2.0/hook_events/user"
            }
        }
    }
}

```

func (*Client) GetHookEventsSubjectType

func (a *Client) GetHookEventsSubjectType(params *GetHookEventsSubjectTypeParams, authInfo runtime.ClientAuthInfoWriter) (*GetHookEventsSubjectTypeOK, error)
GetHookEventsSubjectType Returns a paginated list of all valid webhook events for the

specified entity.

This is public data that does not require any scopes or authentication.

Example:

NOTE: The following example is a truncated response object for the `team` `subject_type`. We return the same structure for the other `subject_type` objects.

``` $ curl https://api.bitbucket.org/2.0/hook_events/team

{
    "page": 1,
    "pagelen": 30,
    "size": 21,
    "values": [
        {
            "category": "Repository",
            "description": "Whenever a repository push occurs",
            "event": "repo:push",
            "label": "Push"
        },
        {
            "category": "Repository",
            "description": "Whenever a repository fork occurs",
            "event": "repo:fork",
            "label": "Fork"
        },
        ...
        {
            "category": "Repository",
            "description": "Whenever a repository import occurs",
            "event": "repo:imported",
            "label": "Import"
        }
    ]
}

```

func (*Client) SetTransport

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

SetTransport changes the transport on the client

type ClientService

type ClientService interface {
	GetHookEvents(params *GetHookEventsParams, authInfo runtime.ClientAuthInfoWriter) (*GetHookEventsOK, error)

	GetHookEventsSubjectType(params *GetHookEventsSubjectTypeParams, authInfo runtime.ClientAuthInfoWriter) (*GetHookEventsSubjectTypeOK, 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 webhooks API client.

type GetHookEventsOK

type GetHookEventsOK struct {
	Payload *models.SubjectTypes
}

GetHookEventsOK handles this case with default header values.

A mapping of resource/subject types pointing to their individual event types.

func NewGetHookEventsOK

func NewGetHookEventsOK() *GetHookEventsOK

NewGetHookEventsOK creates a GetHookEventsOK with default headers values

func (*GetHookEventsOK) Error

func (o *GetHookEventsOK) Error() string

func (*GetHookEventsOK) GetPayload

func (o *GetHookEventsOK) GetPayload() *models.SubjectTypes

type GetHookEventsParams

type GetHookEventsParams struct {
	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetHookEventsParams contains all the parameters to send to the API endpoint for the get hook events operation typically these are written to a http.Request

func NewGetHookEventsParams

func NewGetHookEventsParams() *GetHookEventsParams

NewGetHookEventsParams creates a new GetHookEventsParams object with the default values initialized.

func NewGetHookEventsParamsWithContext

func NewGetHookEventsParamsWithContext(ctx context.Context) *GetHookEventsParams

NewGetHookEventsParamsWithContext creates a new GetHookEventsParams object with the default values initialized, and the ability to set a context for a request

func NewGetHookEventsParamsWithHTTPClient

func NewGetHookEventsParamsWithHTTPClient(client *http.Client) *GetHookEventsParams

NewGetHookEventsParamsWithHTTPClient creates a new GetHookEventsParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewGetHookEventsParamsWithTimeout

func NewGetHookEventsParamsWithTimeout(timeout time.Duration) *GetHookEventsParams

NewGetHookEventsParamsWithTimeout creates a new GetHookEventsParams object with the default values initialized, and the ability to set a timeout on a request

func (*GetHookEventsParams) SetContext

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

SetContext adds the context to the get hook events params

func (*GetHookEventsParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the get hook events params

func (*GetHookEventsParams) SetTimeout

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

SetTimeout adds the timeout to the get hook events params

func (*GetHookEventsParams) WithContext

WithContext adds the context to the get hook events params

func (*GetHookEventsParams) WithHTTPClient

func (o *GetHookEventsParams) WithHTTPClient(client *http.Client) *GetHookEventsParams

WithHTTPClient adds the HTTPClient to the get hook events params

func (*GetHookEventsParams) WithTimeout

func (o *GetHookEventsParams) WithTimeout(timeout time.Duration) *GetHookEventsParams

WithTimeout adds the timeout to the get hook events params

func (*GetHookEventsParams) WriteToRequest

func (o *GetHookEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetHookEventsReader

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

GetHookEventsReader is a Reader for the GetHookEvents structure.

func (*GetHookEventsReader) ReadResponse

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

ReadResponse reads a server response into the received o.

type GetHookEventsSubjectTypeNotFound

type GetHookEventsSubjectTypeNotFound struct {
	Payload *models.Error
}

GetHookEventsSubjectTypeNotFound handles this case with default header values.

If an invalid `{subject_type}` value was specified.

func NewGetHookEventsSubjectTypeNotFound

func NewGetHookEventsSubjectTypeNotFound() *GetHookEventsSubjectTypeNotFound

NewGetHookEventsSubjectTypeNotFound creates a GetHookEventsSubjectTypeNotFound with default headers values

func (*GetHookEventsSubjectTypeNotFound) Error

func (*GetHookEventsSubjectTypeNotFound) GetPayload

type GetHookEventsSubjectTypeOK

type GetHookEventsSubjectTypeOK struct {
	Payload *models.PaginatedHookEvents
}

GetHookEventsSubjectTypeOK handles this case with default header values.

A paginated list of webhook types available to subscribe on.

func NewGetHookEventsSubjectTypeOK

func NewGetHookEventsSubjectTypeOK() *GetHookEventsSubjectTypeOK

NewGetHookEventsSubjectTypeOK creates a GetHookEventsSubjectTypeOK with default headers values

func (*GetHookEventsSubjectTypeOK) Error

func (*GetHookEventsSubjectTypeOK) GetPayload

type GetHookEventsSubjectTypeParams

type GetHookEventsSubjectTypeParams struct {

	/*SubjectType
	  A resource or subject type.

	*/
	SubjectType string

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

GetHookEventsSubjectTypeParams contains all the parameters to send to the API endpoint for the get hook events subject type operation typically these are written to a http.Request

func NewGetHookEventsSubjectTypeParams

func NewGetHookEventsSubjectTypeParams() *GetHookEventsSubjectTypeParams

NewGetHookEventsSubjectTypeParams creates a new GetHookEventsSubjectTypeParams object with the default values initialized.

func NewGetHookEventsSubjectTypeParamsWithContext

func NewGetHookEventsSubjectTypeParamsWithContext(ctx context.Context) *GetHookEventsSubjectTypeParams

NewGetHookEventsSubjectTypeParamsWithContext creates a new GetHookEventsSubjectTypeParams object with the default values initialized, and the ability to set a context for a request

func NewGetHookEventsSubjectTypeParamsWithHTTPClient

func NewGetHookEventsSubjectTypeParamsWithHTTPClient(client *http.Client) *GetHookEventsSubjectTypeParams

NewGetHookEventsSubjectTypeParamsWithHTTPClient creates a new GetHookEventsSubjectTypeParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewGetHookEventsSubjectTypeParamsWithTimeout

func NewGetHookEventsSubjectTypeParamsWithTimeout(timeout time.Duration) *GetHookEventsSubjectTypeParams

NewGetHookEventsSubjectTypeParamsWithTimeout creates a new GetHookEventsSubjectTypeParams object with the default values initialized, and the ability to set a timeout on a request

func (*GetHookEventsSubjectTypeParams) SetContext

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

SetContext adds the context to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) SetSubjectType

func (o *GetHookEventsSubjectTypeParams) SetSubjectType(subjectType string)

SetSubjectType adds the subjectType to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) SetTimeout

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

SetTimeout adds the timeout to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) WithContext

WithContext adds the context to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) WithSubjectType

func (o *GetHookEventsSubjectTypeParams) WithSubjectType(subjectType string) *GetHookEventsSubjectTypeParams

WithSubjectType adds the subjectType to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) WithTimeout

WithTimeout adds the timeout to the get hook events subject type params

func (*GetHookEventsSubjectTypeParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type GetHookEventsSubjectTypeReader

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

GetHookEventsSubjectTypeReader is a Reader for the GetHookEventsSubjectType structure.

func (*GetHookEventsSubjectTypeReader) ReadResponse

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

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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