Documentation
¶
Overview ¶
Package event is the generated strict chi server for the Event REST API: the webhook subscription surface served under /event.
Role ¶
platform layer, in platform/gen, where make generate writes the strict server of every specification. oapi-codegen v2.8.0 writes server.gen.go, the server with its models and embedded document, from api/event.openapi.yaml with api/oapi-server-event.yaml; tools/stubgen writes unimplemented.gen.go from its strict interface. This doc.go is the one hand-written file, and make generate leaves it alone. In the target layout the notifications module's HTTP adapters implement the interface (P11), as a partial strict server composed over UnimplementedStrict (decision 0044). Of this repository's packages it imports only platform/httpkit/apierror.
Inputs ¶
- api/event.openapi.yaml, which make bundle builds from the webhook fragment in api/src/event. No operation in it is tagged handwritten, so the generated mux serves every one.
- At run time: an implementation of StrictServerInterface and the StrictHTTPServerOptions error handlers, for NewStrictHandlerWithOptions; the ChiServerOptions (BaseURL, BaseRouter, ErrorHandlerFunc), for HandlerWithOptions.
Outputs ¶
- StrictServerInterface, one method per operation with its request and response objects: list, create, read, update, delete and test a webhook subscription, and stream its troubleshooting events. NewStrictHandler and NewStrictHandlerWithOptions adapt an implementation to the generated chi ServerInterface, and Handler, HandlerFromMux, HandlerFromMuxWithBaseURL and HandlerWithOptions mount that on a chi router.
- The models of the request and response bodies (a subscription, its event filter and its webhook or custom webhook handlers with their named secrets), with Valid on each enum, and the embedded document (GetSpec, GetSpecJSON and PathToRawSpec).
- UnimplementedStrict: every method returns apierror.ErrNotImplemented, which the server renders as a 501 in the Access envelope, the one decision 0002 gives the Event service. A type that embeds it satisfies StrictServerInterface, and each operation the type implements shadows its stub.
Invariants ¶
- The *.gen.go files are never edited by hand: make generate rewrites both, and make verify-generate fails while either differs from what the document gives (decision 0002). A change goes into api/src/event or api/oapi-server-event.yaml.
- Servers embed UnimplementedStrict, not oapi-codegen's Unimplemented, which serves the non-strict ServerInterface with a bare 501 and no error envelope.
References ¶
- Decision 0002: docs/research/decisions/0002-spec-first-flat-crud-handwritten-item-paths.md.
- Decision 0011: docs/research/decisions/0011-webhooks.md.
- Decision 0044: docs/research/decisions/0044-modular-monolith-migration.md ("Composition and HTTP").
- Research 07: docs/research/07-webhooks-retention-projects.md.
- Target layout: docs/research/architecture-options/5-modular-monolith.md, lines 164 and 165 (platform/gen), line 812 (the event row of the generated code table), lines 819 to 823 (composition by embedding) and line 1020 (the mapping row).
- Plan: docs/implementation/plan.md#p1-data-model-and-api-schemas, tasks 3 and 4; #p11-projects-webhooks-retention-replication; #p9d-modular-monolith-migration, epic WEB (https://github.com/weaveplatform/artifactweave/issues/944).
- https://github.com/weaveplatform/artifactweave/issues/1001
Status ¶
Implemented P1, which authored the Event document and generated its server with the Artifactory and Access servers (plan P1, tasks 3 and 4); the files arrived in the baseline commit of phases P0 to P2. Since then only descriptions have changed, in the 7.x API audit (#430) and the rewording of the served contract (#434). The server's event service embeds UnimplementedStrict and implements nothing, so every operation answers 501 until P11 builds webhooks. Moved here in P9d.
Testing ¶
The package has no tests of its own, and .testcoverage.yml leaves it out of the coverage gate as generated code. The server's tests cover it:
- TestAccHandwrittenRoutesNotGenerated: the generated mux holds every operation of the document.
- TestAccUnimplementedOperationsAnswer501: every operation answers 501 with the Access body the envelope table gives under /event.
- TestAccAPIReliabilityLedger: the API reliability ledger, which names this package's unimplemented.gen.go as the handler of every operation, is current; make api-ledger rewrites it.
Package event provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func GetSpec() (swagger *openapi3.T, err error)
- func GetSpecJSON() ([]byte, error)
- func GetSwagger() (*openapi3.T, error)deprecated
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type CreateWebhookSubscription201JSONResponse
- type CreateWebhookSubscription400JSONResponse
- type CreateWebhookSubscription401JSONResponse
- type CreateWebhookSubscription403JSONResponse
- type CreateWebhookSubscription429JSONResponse
- type CreateWebhookSubscription503JSONResponse
- type CreateWebhookSubscriptionJSONRequestBody
- type CreateWebhookSubscriptionRequestObject
- type CreateWebhookSubscriptionResponseObject
- type CustomWebhookHandlerCreate
- type CustomWebhookHandlerCreateHandlerType
- type CustomWebhookHandlerCreateMethod
- type CustomWebhookHandlerRead
- type CustomWebhookHandlerReadHandlerType
- type CustomWebhookHandlerReadMethod
- type CustomWebhookHandlerUpdate
- type CustomWebhookHandlerUpdateHandlerType
- type CustomWebhookHandlerUpdateMethod
- type DeleteWebhookSubscription204Response
- type DeleteWebhookSubscription401JSONResponse
- type DeleteWebhookSubscription403JSONResponse
- type DeleteWebhookSubscription404JSONResponse
- type DeleteWebhookSubscription429JSONResponse
- type DeleteWebhookSubscription503JSONResponse
- type DeleteWebhookSubscriptionRequestObject
- type DeleteWebhookSubscriptionResponseObject
- type ErrorResponse
- type EventFilter
- type EventFilterCriteria
- type GetWebhookSubscription200JSONResponse
- type GetWebhookSubscription401JSONResponse
- type GetWebhookSubscription403JSONResponse
- type GetWebhookSubscription404JSONResponse
- type GetWebhookSubscription429JSONResponse
- type GetWebhookSubscription503JSONResponse
- type GetWebhookSubscriptionRequestObject
- type GetWebhookSubscriptionResponseObject
- type GetWebhookSubscriptions200JSONResponse
- type GetWebhookSubscriptions401JSONResponse
- type GetWebhookSubscriptions403JSONResponse
- type GetWebhookSubscriptions429JSONResponse
- type GetWebhookSubscriptions503JSONResponse
- type GetWebhookSubscriptionsRequestObject
- type GetWebhookSubscriptionsResponseObject
- type HttpHeader
- type IdempotencyKey
- type InvalidParamFormatError
- type MiddlewareFunc
- type NamedSecretCreate
- type NamedSecretRead
- type NamedSecretUpdate
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWebhookSubscriptions(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StreamWebhookTroubleshooting(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) TestWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateWebhookSubscription(w http.ResponseWriter, r *http.Request)
- type ServiceUnavailable
- type ServiceUnavailableJSONResponse
- type ServiceUnavailableResponseHeaders
- type StreamWebhookTroubleshooting200JSONResponse
- type StreamWebhookTroubleshooting401JSONResponse
- type StreamWebhookTroubleshooting403JSONResponse
- type StreamWebhookTroubleshooting429JSONResponse
- type StreamWebhookTroubleshooting503JSONResponse
- type StreamWebhookTroubleshootingParams
- type StreamWebhookTroubleshootingRequestObject
- type StreamWebhookTroubleshootingResponseObject
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TestWebhookSubscription200Response
- type TestWebhookSubscription400JSONResponse
- type TestWebhookSubscription401JSONResponse
- type TestWebhookSubscription403JSONResponse
- type TestWebhookSubscription429JSONResponse
- type TestWebhookSubscription503JSONResponse
- type TestWebhookSubscriptionJSONRequestBody
- type TestWebhookSubscriptionRequestObject
- type TestWebhookSubscriptionResponseObject
- type TooManyRequests
- type TooManyRequestsJSONResponse
- type TooManyRequestsResponseHeaders
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) CreateWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
- func (_ Unimplemented) GetWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
- func (_ Unimplemented) GetWebhookSubscriptions(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) StreamWebhookTroubleshooting(w http.ResponseWriter, r *http.Request, ...)
- func (_ Unimplemented) TestWebhookSubscription(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) UpdateWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
- type UnimplementedStrict
- func (UnimplementedStrict) CreateWebhookSubscription(context.Context, CreateWebhookSubscriptionRequestObject) (CreateWebhookSubscriptionResponseObject, error)
- func (UnimplementedStrict) DeleteWebhookSubscription(context.Context, DeleteWebhookSubscriptionRequestObject) (DeleteWebhookSubscriptionResponseObject, error)
- func (UnimplementedStrict) GetWebhookSubscription(context.Context, GetWebhookSubscriptionRequestObject) (GetWebhookSubscriptionResponseObject, error)
- func (UnimplementedStrict) GetWebhookSubscriptions(context.Context, GetWebhookSubscriptionsRequestObject) (GetWebhookSubscriptionsResponseObject, error)
- func (UnimplementedStrict) StreamWebhookTroubleshooting(context.Context, StreamWebhookTroubleshootingRequestObject) (StreamWebhookTroubleshootingResponseObject, error)
- func (UnimplementedStrict) TestWebhookSubscription(context.Context, TestWebhookSubscriptionRequestObject) (TestWebhookSubscriptionResponseObject, error)
- func (UnimplementedStrict) UpdateWebhookSubscription(context.Context, UpdateWebhookSubscriptionRequestObject) (UpdateWebhookSubscriptionResponseObject, error)
- type UnmarshalingParamError
- type UpdateWebhookSubscription204Response
- type UpdateWebhookSubscription400JSONResponse
- type UpdateWebhookSubscription401JSONResponse
- type UpdateWebhookSubscription403JSONResponse
- type UpdateWebhookSubscription404JSONResponse
- type UpdateWebhookSubscription429JSONResponse
- type UpdateWebhookSubscription503JSONResponse
- type UpdateWebhookSubscriptionJSONRequestBody
- type UpdateWebhookSubscriptionRequestObject
- type UpdateWebhookSubscriptionResponseObject
- type WebhookHandler
- type WebhookHandlerHandlerType
- type WebhookHandlerInputCreate
- func (t WebhookHandlerInputCreate) AsCustomWebhookHandlerCreate() (CustomWebhookHandlerCreate, error)
- func (t WebhookHandlerInputCreate) AsWebhookHandler() (WebhookHandler, error)
- func (t WebhookHandlerInputCreate) Discriminator() (string, error)
- func (t *WebhookHandlerInputCreate) FromCustomWebhookHandlerCreate(v CustomWebhookHandlerCreate) error
- func (t *WebhookHandlerInputCreate) FromWebhookHandler(v WebhookHandler) error
- func (t WebhookHandlerInputCreate) MarshalJSON() ([]byte, error)
- func (t *WebhookHandlerInputCreate) MergeCustomWebhookHandlerCreate(v CustomWebhookHandlerCreate) error
- func (t *WebhookHandlerInputCreate) MergeWebhookHandler(v WebhookHandler) error
- func (t *WebhookHandlerInputCreate) UnmarshalJSON(b []byte) error
- func (t WebhookHandlerInputCreate) ValueByDiscriminator() (interface{}, error)
- type WebhookHandlerInputUpdate
- func (t WebhookHandlerInputUpdate) AsCustomWebhookHandlerUpdate() (CustomWebhookHandlerUpdate, error)
- func (t WebhookHandlerInputUpdate) AsWebhookHandler() (WebhookHandler, error)
- func (t WebhookHandlerInputUpdate) Discriminator() (string, error)
- func (t *WebhookHandlerInputUpdate) FromCustomWebhookHandlerUpdate(v CustomWebhookHandlerUpdate) error
- func (t *WebhookHandlerInputUpdate) FromWebhookHandler(v WebhookHandler) error
- func (t WebhookHandlerInputUpdate) MarshalJSON() ([]byte, error)
- func (t *WebhookHandlerInputUpdate) MergeCustomWebhookHandlerUpdate(v CustomWebhookHandlerUpdate) error
- func (t *WebhookHandlerInputUpdate) MergeWebhookHandler(v WebhookHandler) error
- func (t *WebhookHandlerInputUpdate) UnmarshalJSON(b []byte) error
- func (t WebhookHandlerInputUpdate) ValueByDiscriminator() (interface{}, error)
- type WebhookHandlerRead
- type WebhookHandlerReadHandlerType
- type WebhookHandlerResponse
- func (t WebhookHandlerResponse) AsCustomWebhookHandlerRead() (CustomWebhookHandlerRead, error)
- func (t WebhookHandlerResponse) AsWebhookHandlerRead() (WebhookHandlerRead, error)
- func (t WebhookHandlerResponse) Discriminator() (string, error)
- func (t *WebhookHandlerResponse) FromCustomWebhookHandlerRead(v CustomWebhookHandlerRead) error
- func (t *WebhookHandlerResponse) FromWebhookHandlerRead(v WebhookHandlerRead) error
- func (t WebhookHandlerResponse) MarshalJSON() ([]byte, error)
- func (t *WebhookHandlerResponse) MergeCustomWebhookHandlerRead(v CustomWebhookHandlerRead) error
- func (t *WebhookHandlerResponse) MergeWebhookHandlerRead(v WebhookHandlerRead) error
- func (t *WebhookHandlerResponse) UnmarshalJSON(b []byte) error
- func (t WebhookHandlerResponse) ValueByDiscriminator() (interface{}, error)
- type WebhookSubscription
- type WebhookSubscriptionCreate
- type WebhookSubscriptionUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSpec ¶
GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.
func GetSpecJSON ¶
GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.
func GetSwagger
deprecated
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type CreateWebhookSubscription201JSONResponse ¶
type CreateWebhookSubscription201JSONResponse WebhookSubscription
func (CreateWebhookSubscription201JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription201JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscription400JSONResponse ¶
type CreateWebhookSubscription400JSONResponse ErrorResponse
func (CreateWebhookSubscription400JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription400JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscription401JSONResponse ¶
type CreateWebhookSubscription401JSONResponse ErrorResponse
func (CreateWebhookSubscription401JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription401JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscription403JSONResponse ¶
type CreateWebhookSubscription403JSONResponse ErrorResponse
func (CreateWebhookSubscription403JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription403JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscription429JSONResponse ¶
type CreateWebhookSubscription429JSONResponse struct{ TooManyRequestsJSONResponse }
func (CreateWebhookSubscription429JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription429JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscription503JSONResponse ¶
func (CreateWebhookSubscription503JSONResponse) VisitCreateWebhookSubscriptionResponse ¶
func (response CreateWebhookSubscription503JSONResponse) VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
type CreateWebhookSubscriptionJSONRequestBody ¶
type CreateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionCreate
CreateWebhookSubscriptionJSONRequestBody defines body for CreateWebhookSubscription for application/json ContentType.
type CreateWebhookSubscriptionRequestObject ¶
type CreateWebhookSubscriptionRequestObject struct {
Body *CreateWebhookSubscriptionJSONRequestBody
}
type CreateWebhookSubscriptionResponseObject ¶
type CreateWebhookSubscriptionResponseObject interface {
VisitCreateWebhookSubscriptionResponse(w http.ResponseWriter) error
}
type CustomWebhookHandlerCreate ¶
type CustomWebhookHandlerCreate struct {
// HandlerType Required within this object. Must be custom-webhook.
HandlerType CustomWebhookHandlerCreateHandlerType `json:"handler_type"`
// HttpHeaders Optional within this object. HTTP headers sent with every delivery. Values may reference secrets as {{.secrets.<name>}}.
HttpHeaders *[]HttpHeader `json:"http_headers,omitempty"`
// Method Optional within this object. HTTP method used for the delivery. Defaults to POST.
Method *CustomWebhookHandlerCreateMethod `json:"method,omitempty"`
// Payload Optional within this object. Go text/template rendered into the request body. The template sees the event as {{.data}} (for example {{.data.repo_key}}; {{json .data}} renders it as JSON), the subscription's secrets as {{.secrets.<name>}} and the acting user as {{.userContext.id}}. Omitted means the event's default JSON payload. A template that fails to parse is rejected with 400.
Payload *string `json:"payload,omitempty"`
// Proxy Optional within this object. Key of a configured outbound proxy to use for deliveries. Omitted means a direct connection, or the platform default proxy when one is set.
Proxy *string `json:"proxy,omitempty"`
// Secrets Optional within this object. Named secrets the templates can reference.
Secrets *[]NamedSecretCreate `json:"secrets,omitempty"`
// Url Required within this object. Absolute http or https URL the event is delivered to. Failed deliveries are retried with backoff. The URL may reference secrets as {{.secrets.<name>}}.
Url string `json:"url"`
}
CustomWebhookHandlerCreate A custom-webhook handler: the request is built from templates.
type CustomWebhookHandlerCreateHandlerType ¶
type CustomWebhookHandlerCreateHandlerType string
CustomWebhookHandlerCreateHandlerType Required within this object. Must be custom-webhook.
const (
CustomWebhookHandlerCreateHandlerTypeCustomWebhook CustomWebhookHandlerCreateHandlerType = "custom-webhook"
)
Defines values for CustomWebhookHandlerCreateHandlerType.
func (CustomWebhookHandlerCreateHandlerType) Valid ¶
func (e CustomWebhookHandlerCreateHandlerType) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerCreateHandlerType enum.
type CustomWebhookHandlerCreateMethod ¶
type CustomWebhookHandlerCreateMethod string
CustomWebhookHandlerCreateMethod Optional within this object. HTTP method used for the delivery. Defaults to POST.
const ( CustomWebhookHandlerCreateMethodDELETE CustomWebhookHandlerCreateMethod = "DELETE" CustomWebhookHandlerCreateMethodGET CustomWebhookHandlerCreateMethod = "GET" CustomWebhookHandlerCreateMethodPATCH CustomWebhookHandlerCreateMethod = "PATCH" CustomWebhookHandlerCreateMethodPOST CustomWebhookHandlerCreateMethod = "POST" CustomWebhookHandlerCreateMethodPUT CustomWebhookHandlerCreateMethod = "PUT" )
Defines values for CustomWebhookHandlerCreateMethod.
func (CustomWebhookHandlerCreateMethod) Valid ¶
func (e CustomWebhookHandlerCreateMethod) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerCreateMethod enum.
type CustomWebhookHandlerRead ¶
type CustomWebhookHandlerRead struct {
// HandlerType Required within this object. Always custom-webhook.
HandlerType CustomWebhookHandlerReadHandlerType `json:"handler_type"`
// HttpHeaders Optional within this object. The header templates.
HttpHeaders *[]HttpHeader `json:"http_headers,omitempty"`
// Method Optional within this object. The delivery method.
Method *CustomWebhookHandlerReadMethod `json:"method,omitempty"`
// Payload Optional within this object. The payload template.
Payload *string `json:"payload,omitempty"`
// Proxy Optional within this object. The proxy key, when one is set.
Proxy *string `json:"proxy,omitempty"`
// Secrets Optional within this object. The secret names; values are never returned.
Secrets *[]NamedSecretRead `json:"secrets,omitempty"`
// Url Required within this object. The delivery URL template.
Url string `json:"url"`
}
CustomWebhookHandlerRead A custom-webhook handler as the server returns it.
type CustomWebhookHandlerReadHandlerType ¶
type CustomWebhookHandlerReadHandlerType string
CustomWebhookHandlerReadHandlerType Required within this object. Always custom-webhook.
const (
CustomWebhookHandlerReadHandlerTypeCustomWebhook CustomWebhookHandlerReadHandlerType = "custom-webhook"
)
Defines values for CustomWebhookHandlerReadHandlerType.
func (CustomWebhookHandlerReadHandlerType) Valid ¶
func (e CustomWebhookHandlerReadHandlerType) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerReadHandlerType enum.
type CustomWebhookHandlerReadMethod ¶
type CustomWebhookHandlerReadMethod string
CustomWebhookHandlerReadMethod Optional within this object. The delivery method.
const ( CustomWebhookHandlerReadMethodDELETE CustomWebhookHandlerReadMethod = "DELETE" CustomWebhookHandlerReadMethodGET CustomWebhookHandlerReadMethod = "GET" CustomWebhookHandlerReadMethodPATCH CustomWebhookHandlerReadMethod = "PATCH" CustomWebhookHandlerReadMethodPOST CustomWebhookHandlerReadMethod = "POST" CustomWebhookHandlerReadMethodPUT CustomWebhookHandlerReadMethod = "PUT" )
Defines values for CustomWebhookHandlerReadMethod.
func (CustomWebhookHandlerReadMethod) Valid ¶
func (e CustomWebhookHandlerReadMethod) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerReadMethod enum.
type CustomWebhookHandlerUpdate ¶
type CustomWebhookHandlerUpdate struct {
// HandlerType Required within this object. Must be custom-webhook.
HandlerType CustomWebhookHandlerUpdateHandlerType `json:"handler_type"`
// HttpHeaders Optional within this object. HTTP headers sent with every delivery. Values may reference secrets as {{.secrets.<name>}}.
HttpHeaders *[]HttpHeader `json:"http_headers,omitempty"`
// Method Optional within this object. HTTP method used for the delivery. Defaults to POST.
Method *CustomWebhookHandlerUpdateMethod `json:"method,omitempty"`
// Payload Optional within this object. Go text/template rendered into the request body. The template sees the event as {{.data}} (for example {{.data.repo_key}}; {{json .data}} renders it as JSON), the subscription's secrets as {{.secrets.<name>}} and the acting user as {{.userContext.id}}. Omitted means the event's default JSON payload. A template that fails to parse is rejected with 400.
Payload *string `json:"payload,omitempty"`
// Proxy Optional within this object. Key of a configured outbound proxy to use for deliveries. Omitted means a direct connection, or the platform default proxy when one is set.
Proxy *string `json:"proxy,omitempty"`
// Secrets Optional within this object. Named secrets the payload and header templates can reference. On replace, a listed name without a value keeps that secret, a value rotates it, an empty string wipes it, and a secret whose name is not listed is removed.
Secrets *[]NamedSecretUpdate `json:"secrets,omitempty"`
// Url Required within this object. Absolute http or https URL the event is delivered to. Failed deliveries are retried with backoff.
Url string `json:"url"`
}
CustomWebhookHandlerUpdate A custom-webhook handler in a replace body.
type CustomWebhookHandlerUpdateHandlerType ¶
type CustomWebhookHandlerUpdateHandlerType string
CustomWebhookHandlerUpdateHandlerType Required within this object. Must be custom-webhook.
const (
CustomWebhookHandlerUpdateHandlerTypeCustomWebhook CustomWebhookHandlerUpdateHandlerType = "custom-webhook"
)
Defines values for CustomWebhookHandlerUpdateHandlerType.
func (CustomWebhookHandlerUpdateHandlerType) Valid ¶
func (e CustomWebhookHandlerUpdateHandlerType) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerUpdateHandlerType enum.
type CustomWebhookHandlerUpdateMethod ¶
type CustomWebhookHandlerUpdateMethod string
CustomWebhookHandlerUpdateMethod Optional within this object. HTTP method used for the delivery. Defaults to POST.
const ( CustomWebhookHandlerUpdateMethodDELETE CustomWebhookHandlerUpdateMethod = "DELETE" CustomWebhookHandlerUpdateMethodGET CustomWebhookHandlerUpdateMethod = "GET" CustomWebhookHandlerUpdateMethodPATCH CustomWebhookHandlerUpdateMethod = "PATCH" CustomWebhookHandlerUpdateMethodPOST CustomWebhookHandlerUpdateMethod = "POST" CustomWebhookHandlerUpdateMethodPUT CustomWebhookHandlerUpdateMethod = "PUT" )
Defines values for CustomWebhookHandlerUpdateMethod.
func (CustomWebhookHandlerUpdateMethod) Valid ¶
func (e CustomWebhookHandlerUpdateMethod) Valid() bool
Valid indicates whether the value is a known member of the CustomWebhookHandlerUpdateMethod enum.
type DeleteWebhookSubscription204Response ¶
type DeleteWebhookSubscription204Response struct {
}
func (DeleteWebhookSubscription204Response) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription204Response) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscription401JSONResponse ¶
type DeleteWebhookSubscription401JSONResponse ErrorResponse
func (DeleteWebhookSubscription401JSONResponse) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription401JSONResponse) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscription403JSONResponse ¶
type DeleteWebhookSubscription403JSONResponse ErrorResponse
func (DeleteWebhookSubscription403JSONResponse) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription403JSONResponse) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscription404JSONResponse ¶
type DeleteWebhookSubscription404JSONResponse ErrorResponse
func (DeleteWebhookSubscription404JSONResponse) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription404JSONResponse) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscription429JSONResponse ¶
type DeleteWebhookSubscription429JSONResponse struct{ TooManyRequestsJSONResponse }
func (DeleteWebhookSubscription429JSONResponse) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription429JSONResponse) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscription503JSONResponse ¶
func (DeleteWebhookSubscription503JSONResponse) VisitDeleteWebhookSubscriptionResponse ¶
func (response DeleteWebhookSubscription503JSONResponse) VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
type DeleteWebhookSubscriptionRequestObject ¶
type DeleteWebhookSubscriptionRequestObject struct {
Key string `json:"key"`
}
type DeleteWebhookSubscriptionResponseObject ¶
type DeleteWebhookSubscriptionResponseObject interface {
VisitDeleteWebhookSubscriptionResponse(w http.ResponseWriter) error
}
type ErrorResponse ¶
type ErrorResponse struct {
// Errors Required within this object. One entry per error.
Errors []struct {
// Code Required within this object. A symbolic code such as NOT_FOUND.
Code string `json:"code"`
// Message Required within this object. Human readable explanation.
Message string `json:"message"`
} `json:"errors"`
}
ErrorResponse The error envelope used by every /event response.
type EventFilter ¶
type EventFilter struct {
// Criteria Optional within this object. Resource conditions for the domain. Required for every domain except user and curation.
Criteria *EventFilterCriteria `json:"criteria,omitempty"`
// Domain Required within this object. One of artifact, artifact_property, docker, build, user, release_bundle, distribution, artifactory_release_bundle, destination, release_bundle_v2, release_bundle_v2_promotion, artifact_lifecycle, xray_scan_status, app_trust or curation. Subscriptions are accepted for every domain, but events are emitted only for artifact, artifact_property, docker, build and user. Project admins may only use artifact, artifact_property, docker and build.
Domain string `json:"domain"`
// EventTypes Required within this object. Events of the domain that trigger the subscription, at least one, spelled exactly as listed here. artifact: deployed, deleted, moved, copied, cached. artifact_property: added, deleted. docker: pushed, deleted, promoted. build: uploaded, deleted, promoted. user: locked. release_bundle: created, signed, deleted. distribution: distribute_started, distribute_completed, distribute_aborted, distribute_failed, delete_started, delete_completed, delete_failed. artifactory_release_bundle and destination: received, delete_started, delete_completed, delete_failed. release_bundle_v2: release_bundle_v2_started, release_bundle_v2_failed, release_bundle_v2_completed. release_bundle_v2_promotion: release_bundle_v2_promotion_started, release_bundle_v2_promotion_failed, release_bundle_v2_promotion_completed. artifact_lifecycle: archive, restore. An event type that does not belong to the domain is rejected with 400.
EventTypes []string `json:"event_types"`
}
EventFilter Selects the domain, the event types and the resources whose events are delivered.
type EventFilterCriteria ¶
type EventFilterCriteria struct {
// AnyBuild Optional within this object. Build domain: match every build.
AnyBuild *bool `json:"anyBuild,omitempty"`
// AnyFederated Optional within this object. Repository domains: match events in every federated repository.
AnyFederated *bool `json:"anyFederated,omitempty"`
// AnyLocal Optional within this object. Repository domains: match events in every local repository.
AnyLocal *bool `json:"anyLocal,omitempty"`
// AnyReleaseBundle Optional within this object. Release bundle domains: match every release bundle.
AnyReleaseBundle *bool `json:"anyReleaseBundle,omitempty"`
// AnyRemote Optional within this object. Repository domains: match events in every remote repository cache.
AnyRemote *bool `json:"anyRemote,omitempty"`
// ApplicationKeys Optional within this object. app_trust: application keys whose events match.
ApplicationKeys *[]string `json:"applicationKeys,omitempty"`
// ExcludePatterns Optional within this object. Repository and build domains: Ant patterns that exclude an otherwise matching path or build name.
ExcludePatterns *[]string `json:"excludePatterns,omitempty"`
// IncludePatterns Optional within this object. Repository and build domains: Ant patterns an artifact path (or build name) must match. Empty means everything.
IncludePatterns *[]string `json:"includePatterns,omitempty"`
// RegisteredReleaseBundlesNames Optional within this object. release_bundle, distribution, artifactory_release_bundle and destination: release bundle names that match.
RegisteredReleaseBundlesNames *[]string `json:"registeredReleaseBundlesNames,omitempty"`
// RepoKeys Optional within this object. Repository domains: repositories whose events match, in addition to the any* flags. A repository that does not exist is rejected with 400.
RepoKeys *[]string `json:"repoKeys,omitempty"`
// SelectedBuilds Optional within this object. Build domain: build names that match, in addition to anyBuild.
SelectedBuilds *[]string `json:"selectedBuilds,omitempty"`
// SelectedEnvironments Optional within this object. release_bundle_v2_promotion: target environments whose promotions match.
SelectedEnvironments *[]string `json:"selectedEnvironments,omitempty"`
// SelectedReleaseBundles Optional within this object. release_bundle_v2: map from release bundle name to the versions that match; an empty list matches every version of that bundle.
SelectedReleaseBundles *map[string][]string `json:"selectedReleaseBundles,omitempty"`
// Stages Optional within this object. app_trust: lifecycle stages whose events match.
Stages *[]string `json:"stages,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
EventFilterCriteria Resource conditions for the domain. Which fields apply depends on the domain: artifact, artifact_property, docker and artifact_lifecycle use anyLocal, anyRemote, anyFederated, repoKeys and the patterns; build uses anyBuild, selectedBuilds and the patterns; release_bundle, distribution, artifactory_release_bundle and destination use anyReleaseBundle and registeredReleaseBundlesNames; release_bundle_v2 uses anyReleaseBundle and selectedReleaseBundles; release_bundle_v2_promotion uses selectedEnvironments; app_trust uses applicationKeys and stages; user and curation take no criteria. Fields that do not apply to the domain are stored and echoed but have no effect. Unknown fields are kept as given.
func (EventFilterCriteria) Get ¶
func (a EventFilterCriteria) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for EventFilterCriteria. Returns the specified element and whether it was found
func (EventFilterCriteria) MarshalJSON ¶
func (a EventFilterCriteria) MarshalJSON() ([]byte, error)
Override default JSON handling for EventFilterCriteria to handle AdditionalProperties
func (*EventFilterCriteria) Set ¶
func (a *EventFilterCriteria) Set(fieldName string, value interface{})
Setter for additional properties for EventFilterCriteria
func (*EventFilterCriteria) UnmarshalJSON ¶
func (a *EventFilterCriteria) UnmarshalJSON(b []byte) error
Override default JSON handling for EventFilterCriteria to handle AdditionalProperties
type GetWebhookSubscription200JSONResponse ¶
type GetWebhookSubscription200JSONResponse WebhookSubscription
func (GetWebhookSubscription200JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription200JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscription401JSONResponse ¶
type GetWebhookSubscription401JSONResponse ErrorResponse
func (GetWebhookSubscription401JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription401JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscription403JSONResponse ¶
type GetWebhookSubscription403JSONResponse ErrorResponse
func (GetWebhookSubscription403JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription403JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscription404JSONResponse ¶
type GetWebhookSubscription404JSONResponse ErrorResponse
func (GetWebhookSubscription404JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription404JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscription429JSONResponse ¶
type GetWebhookSubscription429JSONResponse struct{ TooManyRequestsJSONResponse }
func (GetWebhookSubscription429JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription429JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscription503JSONResponse ¶
func (GetWebhookSubscription503JSONResponse) VisitGetWebhookSubscriptionResponse ¶
func (response GetWebhookSubscription503JSONResponse) VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
type GetWebhookSubscriptionRequestObject ¶
type GetWebhookSubscriptionRequestObject struct {
Key string `json:"key"`
}
type GetWebhookSubscriptionResponseObject ¶
type GetWebhookSubscriptionResponseObject interface {
VisitGetWebhookSubscriptionResponse(w http.ResponseWriter) error
}
type GetWebhookSubscriptions200JSONResponse ¶
type GetWebhookSubscriptions200JSONResponse []WebhookSubscription
func (GetWebhookSubscriptions200JSONResponse) VisitGetWebhookSubscriptionsResponse ¶
func (response GetWebhookSubscriptions200JSONResponse) VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
type GetWebhookSubscriptions401JSONResponse ¶
type GetWebhookSubscriptions401JSONResponse ErrorResponse
func (GetWebhookSubscriptions401JSONResponse) VisitGetWebhookSubscriptionsResponse ¶
func (response GetWebhookSubscriptions401JSONResponse) VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
type GetWebhookSubscriptions403JSONResponse ¶
type GetWebhookSubscriptions403JSONResponse ErrorResponse
func (GetWebhookSubscriptions403JSONResponse) VisitGetWebhookSubscriptionsResponse ¶
func (response GetWebhookSubscriptions403JSONResponse) VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
type GetWebhookSubscriptions429JSONResponse ¶
type GetWebhookSubscriptions429JSONResponse struct{ TooManyRequestsJSONResponse }
func (GetWebhookSubscriptions429JSONResponse) VisitGetWebhookSubscriptionsResponse ¶
func (response GetWebhookSubscriptions429JSONResponse) VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
type GetWebhookSubscriptions503JSONResponse ¶
func (GetWebhookSubscriptions503JSONResponse) VisitGetWebhookSubscriptionsResponse ¶
func (response GetWebhookSubscriptions503JSONResponse) VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
type GetWebhookSubscriptionsRequestObject ¶
type GetWebhookSubscriptionsRequestObject struct {
}
type GetWebhookSubscriptionsResponseObject ¶
type GetWebhookSubscriptionsResponseObject interface {
VisitGetWebhookSubscriptionsResponse(w http.ResponseWriter) error
}
type HttpHeader ¶
type HttpHeader struct {
// Name Required within this object. Header name.
Name string `json:"name"`
// Value Required within this object. Header value; custom-webhook values may reference {{.secrets.<name>}}.
Value string `json:"value"`
}
HttpHeader One HTTP header added to deliveries.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type NamedSecretCreate ¶
type NamedSecretCreate struct {
// Name Required within this object. Secret name, a letter or underscore followed by letters, digits or underscores.
Name string `json:"name"`
// Value Required within this object. Secret value. Write-only: responses return the name only.
Value *string `json:"value,omitempty"`
}
NamedSecretCreate A named secret for templates.
type NamedSecretRead ¶
type NamedSecretRead struct {
// Name Required within this object. Secret name.
Name string `json:"name"`
}
NamedSecretRead A named secret as the server returns it: the name only.
type NamedSecretUpdate ¶
type NamedSecretUpdate struct {
// Name Required within this object. Name of the secret to keep, rotate or wipe.
Name string `json:"name"`
// Value Optional within this object. Write-only. Omitted keeps the stored value, a non-empty value rotates it, and an empty string wipes it.
Value *string `json:"value,omitempty"`
}
NamedSecretUpdate A named secret in a replace body.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface {
// GetWebhookSubscriptions List webhook subscriptions
// (GET /api/v1/subscriptions)
GetWebhookSubscriptions(w http.ResponseWriter, r *http.Request)
// CreateWebhookSubscription Create a webhook subscription
// (POST /api/v1/subscriptions)
CreateWebhookSubscription(w http.ResponseWriter, r *http.Request)
// TestWebhookSubscription Send a test delivery
// (POST /api/v1/subscriptions/test)
TestWebhookSubscription(w http.ResponseWriter, r *http.Request)
// DeleteWebhookSubscription Delete a webhook subscription
// (DELETE /api/v1/subscriptions/{key})
DeleteWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
// GetWebhookSubscription Get a webhook subscription
// (GET /api/v1/subscriptions/{key})
GetWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
// UpdateWebhookSubscription Replace a webhook subscription
// (PUT /api/v1/subscriptions/{key})
UpdateWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
// StreamWebhookTroubleshooting Read the webhook delivery log
// (GET /api/v1/troubleshooting)
StreamWebhookTroubleshooting(w http.ResponseWriter, r *http.Request, params StreamWebhookTroubleshootingParams)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateWebhookSubscription ¶
func (siw *ServerInterfaceWrapper) CreateWebhookSubscription(w http.ResponseWriter, r *http.Request)
CreateWebhookSubscription operation middleware
func (*ServerInterfaceWrapper) DeleteWebhookSubscription ¶
func (siw *ServerInterfaceWrapper) DeleteWebhookSubscription(w http.ResponseWriter, r *http.Request)
DeleteWebhookSubscription operation middleware
func (*ServerInterfaceWrapper) GetWebhookSubscription ¶
func (siw *ServerInterfaceWrapper) GetWebhookSubscription(w http.ResponseWriter, r *http.Request)
GetWebhookSubscription operation middleware
func (*ServerInterfaceWrapper) GetWebhookSubscriptions ¶
func (siw *ServerInterfaceWrapper) GetWebhookSubscriptions(w http.ResponseWriter, r *http.Request)
GetWebhookSubscriptions operation middleware
func (*ServerInterfaceWrapper) StreamWebhookTroubleshooting ¶
func (siw *ServerInterfaceWrapper) StreamWebhookTroubleshooting(w http.ResponseWriter, r *http.Request)
StreamWebhookTroubleshooting operation middleware
func (*ServerInterfaceWrapper) TestWebhookSubscription ¶
func (siw *ServerInterfaceWrapper) TestWebhookSubscription(w http.ResponseWriter, r *http.Request)
TestWebhookSubscription operation middleware
func (*ServerInterfaceWrapper) UpdateWebhookSubscription ¶
func (siw *ServerInterfaceWrapper) UpdateWebhookSubscription(w http.ResponseWriter, r *http.Request)
UpdateWebhookSubscription operation middleware
type ServiceUnavailable ¶
type ServiceUnavailable = ErrorResponse
ServiceUnavailable The error envelope used by every /event response.
type ServiceUnavailableJSONResponse ¶
type ServiceUnavailableJSONResponse struct {
}
type ServiceUnavailableResponseHeaders ¶
type ServiceUnavailableResponseHeaders struct {
}
type StreamWebhookTroubleshooting200JSONResponse ¶
type StreamWebhookTroubleshooting200JSONResponse struct {
// ElapsedMillis Optional within this object. How long the attempt took, in milliseconds.
ElapsedMillis *int `json:"elapsed_millis,omitempty"`
// Errors Optional within this object. Errors met during the attempt (connection, timeout or template errors); empty on success.
Errors *[]string `json:"errors,omitempty"`
// Event Optional within this object. The event that was delivered.
Event *struct {
// Data Optional within this object. The event payload, serialised as a JSON string.
Data *string `json:"data,omitempty"`
// Domain Optional within this object. Event domain.
Domain *string `json:"domain,omitempty"`
// EventType Optional within this object. Event type.
EventType *string `json:"event_type,omitempty"`
// Id Optional within this object. Unique event identifier; retries of one event share it.
Id *string `json:"id,omitempty"`
// Source Optional within this object. Service that raised the event, for example jfrt@<service id>.
Source *string `json:"source,omitempty"`
// SubscriptionKey Optional within this object. Subscription that delivered it.
SubscriptionKey *string `json:"subscription_key,omitempty"`
} `json:"event,omitempty"`
// Request Optional within this object. The outgoing request, with secrets masked.
Request *struct {
// Headers Optional within this object. Request headers; the auth header and secret-bearing values are masked.
Headers *map[string]string `json:"headers,omitempty"`
// Method Optional within this object. HTTP method.
Method *string `json:"method,omitempty"`
// Payload Optional within this object. Rendered request body.
Payload *string `json:"payload,omitempty"`
// RetriesAttempted Optional within this object. Number of retries before this attempt.
RetriesAttempted *int `json:"retries_attempted,omitempty"`
// Url Optional within this object. Target URL.
Url *string `json:"url,omitempty"`
} `json:"request,omitempty"`
// Response Optional within this object. The receiver's answer; absent when no response arrived.
Response *struct {
// Body Optional within this object. Body the receiver returned, as text, truncated to the first 4 KiB.
Body *string `json:"body,omitempty"`
// Headers Optional within this object. Response headers.
Headers *map[string]string `json:"headers,omitempty"`
// Status Optional within this object. HTTP status code returned by the receiver.
Status *int `json:"status,omitempty"`
} `json:"response,omitempty"`
// Timestamp Optional within this object. When the delivery attempt was made, as Unix time in milliseconds.
Timestamp *int64 `json:"timestamp,omitempty"`
}
func (StreamWebhookTroubleshooting200JSONResponse) VisitStreamWebhookTroubleshootingResponse ¶
func (response StreamWebhookTroubleshooting200JSONResponse) VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
type StreamWebhookTroubleshooting401JSONResponse ¶
type StreamWebhookTroubleshooting401JSONResponse ErrorResponse
func (StreamWebhookTroubleshooting401JSONResponse) VisitStreamWebhookTroubleshootingResponse ¶
func (response StreamWebhookTroubleshooting401JSONResponse) VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
type StreamWebhookTroubleshooting403JSONResponse ¶
type StreamWebhookTroubleshooting403JSONResponse ErrorResponse
func (StreamWebhookTroubleshooting403JSONResponse) VisitStreamWebhookTroubleshootingResponse ¶
func (response StreamWebhookTroubleshooting403JSONResponse) VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
type StreamWebhookTroubleshooting429JSONResponse ¶
type StreamWebhookTroubleshooting429JSONResponse struct{ TooManyRequestsJSONResponse }
func (StreamWebhookTroubleshooting429JSONResponse) VisitStreamWebhookTroubleshootingResponse ¶
func (response StreamWebhookTroubleshooting429JSONResponse) VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
type StreamWebhookTroubleshooting503JSONResponse ¶
func (StreamWebhookTroubleshooting503JSONResponse) VisitStreamWebhookTroubleshootingResponse ¶
func (response StreamWebhookTroubleshooting503JSONResponse) VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
type StreamWebhookTroubleshootingParams ¶
type StreamWebhookTroubleshootingParams struct {
// Subscription Optional query parameter. Only records of this subscription key.
Subscription *string `form:"subscription,omitempty" json:"subscription,omitempty"`
// Target Optional query parameter. Only records whose target URL equals this value.
Target *string `form:"target,omitempty" json:"target,omitempty"`
// Start Optional query parameter. Earliest record to include, as Unix time in milliseconds, the unit of each record's timestamp; 0 means the oldest record held. Alone it keeps the stream live after the stored records; with end or count the call ends after them.
Start *int64 `form:"start,omitempty" json:"start,omitempty"`
// End Optional query parameter. Exclude records at or after this time, as Unix time in milliseconds. Only valid with start (400 otherwise); makes the call a bounded fetch.
End *int64 `form:"end,omitempty" json:"end,omitempty"`
// Count Optional query parameter. Maximum number of records returned. Only valid with start (400 otherwise); makes the call a bounded fetch.
Count *int `form:"count,omitempty" json:"count,omitempty"`
}
StreamWebhookTroubleshootingParams defines parameters for StreamWebhookTroubleshooting.
type StreamWebhookTroubleshootingRequestObject ¶
type StreamWebhookTroubleshootingRequestObject struct {
Params StreamWebhookTroubleshootingParams
}
type StreamWebhookTroubleshootingResponseObject ¶
type StreamWebhookTroubleshootingResponseObject interface {
VisitStreamWebhookTroubleshootingResponse(w http.ResponseWriter) error
}
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// GetWebhookSubscriptions List webhook subscriptions
// (GET /api/v1/subscriptions)
GetWebhookSubscriptions(ctx context.Context, request GetWebhookSubscriptionsRequestObject) (GetWebhookSubscriptionsResponseObject, error)
// CreateWebhookSubscription Create a webhook subscription
// (POST /api/v1/subscriptions)
CreateWebhookSubscription(ctx context.Context, request CreateWebhookSubscriptionRequestObject) (CreateWebhookSubscriptionResponseObject, error)
// TestWebhookSubscription Send a test delivery
// (POST /api/v1/subscriptions/test)
TestWebhookSubscription(ctx context.Context, request TestWebhookSubscriptionRequestObject) (TestWebhookSubscriptionResponseObject, error)
// DeleteWebhookSubscription Delete a webhook subscription
// (DELETE /api/v1/subscriptions/{key})
DeleteWebhookSubscription(ctx context.Context, request DeleteWebhookSubscriptionRequestObject) (DeleteWebhookSubscriptionResponseObject, error)
// GetWebhookSubscription Get a webhook subscription
// (GET /api/v1/subscriptions/{key})
GetWebhookSubscription(ctx context.Context, request GetWebhookSubscriptionRequestObject) (GetWebhookSubscriptionResponseObject, error)
// UpdateWebhookSubscription Replace a webhook subscription
// (PUT /api/v1/subscriptions/{key})
UpdateWebhookSubscription(ctx context.Context, request UpdateWebhookSubscriptionRequestObject) (UpdateWebhookSubscriptionResponseObject, error)
// StreamWebhookTroubleshooting Read the webhook delivery log
// (GET /api/v1/troubleshooting)
StreamWebhookTroubleshooting(ctx context.Context, request StreamWebhookTroubleshootingRequestObject) (StreamWebhookTroubleshootingResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TestWebhookSubscription200Response ¶
type TestWebhookSubscription200Response struct {
}
func (TestWebhookSubscription200Response) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription200Response) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscription400JSONResponse ¶
type TestWebhookSubscription400JSONResponse ErrorResponse
func (TestWebhookSubscription400JSONResponse) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription400JSONResponse) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscription401JSONResponse ¶
type TestWebhookSubscription401JSONResponse ErrorResponse
func (TestWebhookSubscription401JSONResponse) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription401JSONResponse) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscription403JSONResponse ¶
type TestWebhookSubscription403JSONResponse ErrorResponse
func (TestWebhookSubscription403JSONResponse) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription403JSONResponse) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscription429JSONResponse ¶
type TestWebhookSubscription429JSONResponse struct{ TooManyRequestsJSONResponse }
func (TestWebhookSubscription429JSONResponse) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription429JSONResponse) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscription503JSONResponse ¶
func (TestWebhookSubscription503JSONResponse) VisitTestWebhookSubscriptionResponse ¶
func (response TestWebhookSubscription503JSONResponse) VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
type TestWebhookSubscriptionJSONRequestBody ¶
type TestWebhookSubscriptionJSONRequestBody = WebhookSubscriptionCreate
TestWebhookSubscriptionJSONRequestBody defines body for TestWebhookSubscription for application/json ContentType.
type TestWebhookSubscriptionRequestObject ¶
type TestWebhookSubscriptionRequestObject struct {
Body *TestWebhookSubscriptionJSONRequestBody
}
type TestWebhookSubscriptionResponseObject ¶
type TestWebhookSubscriptionResponseObject interface {
VisitTestWebhookSubscriptionResponse(w http.ResponseWriter) error
}
type TooManyRequests ¶
type TooManyRequests = ErrorResponse
TooManyRequests The error envelope used by every /event response.
type TooManyRequestsJSONResponse ¶
type TooManyRequestsJSONResponse struct {
Body ErrorResponse
Headers TooManyRequestsResponseHeaders
}
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateWebhookSubscription ¶
func (_ Unimplemented) CreateWebhookSubscription(w http.ResponseWriter, r *http.Request)
CreateWebhookSubscription Create a webhook subscription (POST /api/v1/subscriptions)
func (Unimplemented) DeleteWebhookSubscription ¶
func (_ Unimplemented) DeleteWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
DeleteWebhookSubscription Delete a webhook subscription (DELETE /api/v1/subscriptions/{key})
func (Unimplemented) GetWebhookSubscription ¶
func (_ Unimplemented) GetWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
GetWebhookSubscription Get a webhook subscription (GET /api/v1/subscriptions/{key})
func (Unimplemented) GetWebhookSubscriptions ¶
func (_ Unimplemented) GetWebhookSubscriptions(w http.ResponseWriter, r *http.Request)
GetWebhookSubscriptions List webhook subscriptions (GET /api/v1/subscriptions)
func (Unimplemented) StreamWebhookTroubleshooting ¶
func (_ Unimplemented) StreamWebhookTroubleshooting(w http.ResponseWriter, r *http.Request, params StreamWebhookTroubleshootingParams)
StreamWebhookTroubleshooting Read the webhook delivery log (GET /api/v1/troubleshooting)
func (Unimplemented) TestWebhookSubscription ¶
func (_ Unimplemented) TestWebhookSubscription(w http.ResponseWriter, r *http.Request)
TestWebhookSubscription Send a test delivery (POST /api/v1/subscriptions/test)
func (Unimplemented) UpdateWebhookSubscription ¶
func (_ Unimplemented) UpdateWebhookSubscription(w http.ResponseWriter, r *http.Request, key string)
UpdateWebhookSubscription Replace a webhook subscription (PUT /api/v1/subscriptions/{key})
type UnimplementedStrict ¶
type UnimplementedStrict struct{}
UnimplementedStrict answers 501 for every strict operation. Services embed it and override the operations they implement.
func (UnimplementedStrict) CreateWebhookSubscription ¶
func (UnimplementedStrict) CreateWebhookSubscription(context.Context, CreateWebhookSubscriptionRequestObject) (CreateWebhookSubscriptionResponseObject, error)
func (UnimplementedStrict) DeleteWebhookSubscription ¶
func (UnimplementedStrict) DeleteWebhookSubscription(context.Context, DeleteWebhookSubscriptionRequestObject) (DeleteWebhookSubscriptionResponseObject, error)
func (UnimplementedStrict) GetWebhookSubscription ¶
func (UnimplementedStrict) GetWebhookSubscription(context.Context, GetWebhookSubscriptionRequestObject) (GetWebhookSubscriptionResponseObject, error)
func (UnimplementedStrict) GetWebhookSubscriptions ¶
func (UnimplementedStrict) GetWebhookSubscriptions(context.Context, GetWebhookSubscriptionsRequestObject) (GetWebhookSubscriptionsResponseObject, error)
func (UnimplementedStrict) StreamWebhookTroubleshooting ¶
func (UnimplementedStrict) StreamWebhookTroubleshooting(context.Context, StreamWebhookTroubleshootingRequestObject) (StreamWebhookTroubleshootingResponseObject, error)
func (UnimplementedStrict) TestWebhookSubscription ¶
func (UnimplementedStrict) TestWebhookSubscription(context.Context, TestWebhookSubscriptionRequestObject) (TestWebhookSubscriptionResponseObject, error)
func (UnimplementedStrict) UpdateWebhookSubscription ¶
func (UnimplementedStrict) UpdateWebhookSubscription(context.Context, UpdateWebhookSubscriptionRequestObject) (UpdateWebhookSubscriptionResponseObject, error)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateWebhookSubscription204Response ¶
type UpdateWebhookSubscription204Response struct {
}
func (UpdateWebhookSubscription204Response) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription204Response) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription400JSONResponse ¶
type UpdateWebhookSubscription400JSONResponse ErrorResponse
func (UpdateWebhookSubscription400JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription400JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription401JSONResponse ¶
type UpdateWebhookSubscription401JSONResponse ErrorResponse
func (UpdateWebhookSubscription401JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription401JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription403JSONResponse ¶
type UpdateWebhookSubscription403JSONResponse ErrorResponse
func (UpdateWebhookSubscription403JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription403JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription404JSONResponse ¶
type UpdateWebhookSubscription404JSONResponse ErrorResponse
func (UpdateWebhookSubscription404JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription404JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription429JSONResponse ¶
type UpdateWebhookSubscription429JSONResponse struct{ TooManyRequestsJSONResponse }
func (UpdateWebhookSubscription429JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription429JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscription503JSONResponse ¶
func (UpdateWebhookSubscription503JSONResponse) VisitUpdateWebhookSubscriptionResponse ¶
func (response UpdateWebhookSubscription503JSONResponse) VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
type UpdateWebhookSubscriptionJSONRequestBody ¶
type UpdateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionUpdate
UpdateWebhookSubscriptionJSONRequestBody defines body for UpdateWebhookSubscription for application/json ContentType.
type UpdateWebhookSubscriptionRequestObject ¶
type UpdateWebhookSubscriptionRequestObject struct {
Key string `json:"key"`
Body *UpdateWebhookSubscriptionJSONRequestBody
}
type UpdateWebhookSubscriptionResponseObject ¶
type UpdateWebhookSubscriptionResponseObject interface {
VisitUpdateWebhookSubscriptionResponse(w http.ResponseWriter) error
}
type WebhookHandler ¶
type WebhookHandler struct {
// CustomHttpHeaders Optional within this object. Extra HTTP headers sent with every delivery. Header names must be unique.
CustomHttpHeaders *[]HttpHeader `json:"custom_http_headers,omitempty"`
// HandlerType Required within this object. Must be webhook.
HandlerType WebhookHandlerHandlerType `json:"handler_type"`
// Proxy Optional within this object. Key of a configured outbound proxy to use for deliveries. Omitted means a direct connection, or the platform default proxy when one is set.
Proxy *string `json:"proxy,omitempty"`
// Secret Optional within this object. Shared secret for the `X-JFrog-Event-Auth` delivery header. Write-only: responses never echo it. On replace, omitting it keeps the stored secret, a new value rotates it, and an empty string removes it.
Secret *string `json:"secret,omitempty"`
// Url Required within this object. Absolute http or https URL the event is delivered to. Failed deliveries are retried with backoff.
Url string `json:"url"`
// UseSecretForSigning Optional within this object. Selects what `X-JFrog-Event-Auth` carries: false (the default) sends the secret itself, true sends the lower-case hex HMAC-SHA256 of the request body keyed with the secret, so the receiver can verify the payload. Ignored when no secret is set.
UseSecretForSigning *bool `json:"use_secret_for_signing,omitempty"`
}
WebhookHandler A webhook handler: the event is posted as JSON to url.
type WebhookHandlerHandlerType ¶
type WebhookHandlerHandlerType string
WebhookHandlerHandlerType Required within this object. Must be webhook.
const (
WebhookHandlerHandlerTypeWebhook WebhookHandlerHandlerType = "webhook"
)
Defines values for WebhookHandlerHandlerType.
func (WebhookHandlerHandlerType) Valid ¶
func (e WebhookHandlerHandlerType) Valid() bool
Valid indicates whether the value is a known member of the WebhookHandlerHandlerType enum.
type WebhookHandlerInputCreate ¶
type WebhookHandlerInputCreate struct {
// contains filtered or unexported fields
}
WebhookHandlerInputCreate A handler in a create body, discriminated by handler_type.
func (WebhookHandlerInputCreate) AsCustomWebhookHandlerCreate ¶
func (t WebhookHandlerInputCreate) AsCustomWebhookHandlerCreate() (CustomWebhookHandlerCreate, error)
AsCustomWebhookHandlerCreate returns the union data inside the WebhookHandlerInputCreate as a CustomWebhookHandlerCreate
func (WebhookHandlerInputCreate) AsWebhookHandler ¶
func (t WebhookHandlerInputCreate) AsWebhookHandler() (WebhookHandler, error)
AsWebhookHandler returns the union data inside the WebhookHandlerInputCreate as a WebhookHandler
func (WebhookHandlerInputCreate) Discriminator ¶
func (t WebhookHandlerInputCreate) Discriminator() (string, error)
func (*WebhookHandlerInputCreate) FromCustomWebhookHandlerCreate ¶
func (t *WebhookHandlerInputCreate) FromCustomWebhookHandlerCreate(v CustomWebhookHandlerCreate) error
FromCustomWebhookHandlerCreate overwrites any union data inside the WebhookHandlerInputCreate as the provided CustomWebhookHandlerCreate
func (*WebhookHandlerInputCreate) FromWebhookHandler ¶
func (t *WebhookHandlerInputCreate) FromWebhookHandler(v WebhookHandler) error
FromWebhookHandler overwrites any union data inside the WebhookHandlerInputCreate as the provided WebhookHandler
func (WebhookHandlerInputCreate) MarshalJSON ¶
func (t WebhookHandlerInputCreate) MarshalJSON() ([]byte, error)
func (*WebhookHandlerInputCreate) MergeCustomWebhookHandlerCreate ¶
func (t *WebhookHandlerInputCreate) MergeCustomWebhookHandlerCreate(v CustomWebhookHandlerCreate) error
MergeCustomWebhookHandlerCreate performs a merge with any union data inside the WebhookHandlerInputCreate, using the provided CustomWebhookHandlerCreate
func (*WebhookHandlerInputCreate) MergeWebhookHandler ¶
func (t *WebhookHandlerInputCreate) MergeWebhookHandler(v WebhookHandler) error
MergeWebhookHandler performs a merge with any union data inside the WebhookHandlerInputCreate, using the provided WebhookHandler
func (*WebhookHandlerInputCreate) UnmarshalJSON ¶
func (t *WebhookHandlerInputCreate) UnmarshalJSON(b []byte) error
func (WebhookHandlerInputCreate) ValueByDiscriminator ¶
func (t WebhookHandlerInputCreate) ValueByDiscriminator() (interface{}, error)
type WebhookHandlerInputUpdate ¶
type WebhookHandlerInputUpdate struct {
// contains filtered or unexported fields
}
WebhookHandlerInputUpdate A handler in a replace body, discriminated by handler_type.
func (WebhookHandlerInputUpdate) AsCustomWebhookHandlerUpdate ¶
func (t WebhookHandlerInputUpdate) AsCustomWebhookHandlerUpdate() (CustomWebhookHandlerUpdate, error)
AsCustomWebhookHandlerUpdate returns the union data inside the WebhookHandlerInputUpdate as a CustomWebhookHandlerUpdate
func (WebhookHandlerInputUpdate) AsWebhookHandler ¶
func (t WebhookHandlerInputUpdate) AsWebhookHandler() (WebhookHandler, error)
AsWebhookHandler returns the union data inside the WebhookHandlerInputUpdate as a WebhookHandler
func (WebhookHandlerInputUpdate) Discriminator ¶
func (t WebhookHandlerInputUpdate) Discriminator() (string, error)
func (*WebhookHandlerInputUpdate) FromCustomWebhookHandlerUpdate ¶
func (t *WebhookHandlerInputUpdate) FromCustomWebhookHandlerUpdate(v CustomWebhookHandlerUpdate) error
FromCustomWebhookHandlerUpdate overwrites any union data inside the WebhookHandlerInputUpdate as the provided CustomWebhookHandlerUpdate
func (*WebhookHandlerInputUpdate) FromWebhookHandler ¶
func (t *WebhookHandlerInputUpdate) FromWebhookHandler(v WebhookHandler) error
FromWebhookHandler overwrites any union data inside the WebhookHandlerInputUpdate as the provided WebhookHandler
func (WebhookHandlerInputUpdate) MarshalJSON ¶
func (t WebhookHandlerInputUpdate) MarshalJSON() ([]byte, error)
func (*WebhookHandlerInputUpdate) MergeCustomWebhookHandlerUpdate ¶
func (t *WebhookHandlerInputUpdate) MergeCustomWebhookHandlerUpdate(v CustomWebhookHandlerUpdate) error
MergeCustomWebhookHandlerUpdate performs a merge with any union data inside the WebhookHandlerInputUpdate, using the provided CustomWebhookHandlerUpdate
func (*WebhookHandlerInputUpdate) MergeWebhookHandler ¶
func (t *WebhookHandlerInputUpdate) MergeWebhookHandler(v WebhookHandler) error
MergeWebhookHandler performs a merge with any union data inside the WebhookHandlerInputUpdate, using the provided WebhookHandler
func (*WebhookHandlerInputUpdate) UnmarshalJSON ¶
func (t *WebhookHandlerInputUpdate) UnmarshalJSON(b []byte) error
func (WebhookHandlerInputUpdate) ValueByDiscriminator ¶
func (t WebhookHandlerInputUpdate) ValueByDiscriminator() (interface{}, error)
type WebhookHandlerRead ¶
type WebhookHandlerRead struct {
// CustomHttpHeaders Optional within this object. The extra headers.
CustomHttpHeaders *[]HttpHeader `json:"custom_http_headers,omitempty"`
// HandlerType Required within this object. Always webhook.
HandlerType WebhookHandlerReadHandlerType `json:"handler_type"`
// Proxy Optional within this object. The proxy key, when one is set.
Proxy *string `json:"proxy,omitempty"`
// Secret Optional within this object. Never the stored secret: absent when no secret is set, otherwise a fixed mask, so a client can tell that one exists.
Secret *string `json:"secret,omitempty"`
// Url Required within this object. The delivery URL.
Url string `json:"url"`
// UseSecretForSigning Optional within this object. Whether deliveries carry an HMAC signature rather than the raw secret.
UseSecretForSigning *bool `json:"use_secret_for_signing,omitempty"`
}
WebhookHandlerRead A webhook handler as the server returns it.
type WebhookHandlerReadHandlerType ¶
type WebhookHandlerReadHandlerType string
WebhookHandlerReadHandlerType Required within this object. Always webhook.
const (
WebhookHandlerReadHandlerTypeWebhook WebhookHandlerReadHandlerType = "webhook"
)
Defines values for WebhookHandlerReadHandlerType.
func (WebhookHandlerReadHandlerType) Valid ¶
func (e WebhookHandlerReadHandlerType) Valid() bool
Valid indicates whether the value is a known member of the WebhookHandlerReadHandlerType enum.
type WebhookHandlerResponse ¶
type WebhookHandlerResponse struct {
// contains filtered or unexported fields
}
WebhookHandlerResponse A handler as the server returns it, discriminated by handler_type.
func (WebhookHandlerResponse) AsCustomWebhookHandlerRead ¶
func (t WebhookHandlerResponse) AsCustomWebhookHandlerRead() (CustomWebhookHandlerRead, error)
AsCustomWebhookHandlerRead returns the union data inside the WebhookHandlerResponse as a CustomWebhookHandlerRead
func (WebhookHandlerResponse) AsWebhookHandlerRead ¶
func (t WebhookHandlerResponse) AsWebhookHandlerRead() (WebhookHandlerRead, error)
AsWebhookHandlerRead returns the union data inside the WebhookHandlerResponse as a WebhookHandlerRead
func (WebhookHandlerResponse) Discriminator ¶
func (t WebhookHandlerResponse) Discriminator() (string, error)
func (*WebhookHandlerResponse) FromCustomWebhookHandlerRead ¶
func (t *WebhookHandlerResponse) FromCustomWebhookHandlerRead(v CustomWebhookHandlerRead) error
FromCustomWebhookHandlerRead overwrites any union data inside the WebhookHandlerResponse as the provided CustomWebhookHandlerRead
func (*WebhookHandlerResponse) FromWebhookHandlerRead ¶
func (t *WebhookHandlerResponse) FromWebhookHandlerRead(v WebhookHandlerRead) error
FromWebhookHandlerRead overwrites any union data inside the WebhookHandlerResponse as the provided WebhookHandlerRead
func (WebhookHandlerResponse) MarshalJSON ¶
func (t WebhookHandlerResponse) MarshalJSON() ([]byte, error)
func (*WebhookHandlerResponse) MergeCustomWebhookHandlerRead ¶
func (t *WebhookHandlerResponse) MergeCustomWebhookHandlerRead(v CustomWebhookHandlerRead) error
MergeCustomWebhookHandlerRead performs a merge with any union data inside the WebhookHandlerResponse, using the provided CustomWebhookHandlerRead
func (*WebhookHandlerResponse) MergeWebhookHandlerRead ¶
func (t *WebhookHandlerResponse) MergeWebhookHandlerRead(v WebhookHandlerRead) error
MergeWebhookHandlerRead performs a merge with any union data inside the WebhookHandlerResponse, using the provided WebhookHandlerRead
func (*WebhookHandlerResponse) UnmarshalJSON ¶
func (t *WebhookHandlerResponse) UnmarshalJSON(b []byte) error
func (WebhookHandlerResponse) ValueByDiscriminator ¶
func (t WebhookHandlerResponse) ValueByDiscriminator() (interface{}, error)
type WebhookSubscription ¶
type WebhookSubscription struct {
// Debug Optional within this object. Whether successful deliveries are logged too.
Debug *bool `json:"debug,omitempty"`
// Description Optional within this object. The stored description.
Description *string `json:"description,omitempty"`
// Enabled Optional within this object. Whether events are delivered.
Enabled *bool `json:"enabled,omitempty"`
// EventFilter Optional within this object. The stored filter.
EventFilter *EventFilter `json:"event_filter,omitempty"`
// Handlers Optional within this object. The single handler, with secrets redacted.
Handlers *[]WebhookHandlerResponse `json:"handlers,omitempty"`
// Key Optional within this object. The subscription key.
Key *string `json:"key,omitempty"`
// ProjectKey Optional within this object. The owning project; absent for a global subscription.
ProjectKey *string `json:"project_key,omitempty"`
}
WebhookSubscription A stored webhook subscription as the server returns it, with secrets redacted.
type WebhookSubscriptionCreate ¶
type WebhookSubscriptionCreate struct {
// Debug Optional within this object. When true every delivery attempt, successful or not, is kept in the troubleshooting log; when false (the default) only failed attempts are kept.
Debug *bool `json:"debug,omitempty"`
// Description Optional within this object. Free text describing the subscription.
Description *string `json:"description,omitempty"`
// Enabled Required within this object. Whether events are delivered. A disabled subscription is stored but never fires.
Enabled bool `json:"enabled"`
// EventFilter Required within this object. Which events trigger the subscription. See EventFilter.
EventFilter EventFilter `json:"event_filter"`
// Handlers Required within this object. Exactly one delivery handler: a webhook (fixed JSON payload) or a custom-webhook (templated request).
Handlers []WebhookHandlerInputCreate `json:"handlers"`
// Key Required within this object. Subscription key, unique on the server: a letter followed by letters, digits, underscore or hyphen, at most 500 characters. Immutable once created; it is the {key} path parameter of the other operations.
Key string `json:"key"`
// ProjectKey Optional within this object. Project the subscription belongs to. Omitted means a global subscription. Project admins must set it to their own project. Immutable: a replace that changes it is rejected with 400.
ProjectKey *string `json:"project_key,omitempty"`
}
WebhookSubscriptionCreate Body for creating (or test-delivering) a webhook subscription.
type WebhookSubscriptionUpdate ¶
type WebhookSubscriptionUpdate struct {
// Debug Optional within this object. When true every delivery attempt, successful or not, is kept in the troubleshooting log; when false (the default) only failed attempts are kept.
Debug *bool `json:"debug,omitempty"`
// Description Optional within this object. Free text describing the subscription.
Description *string `json:"description,omitempty"`
// Enabled Required within this object. Whether events are delivered.
Enabled bool `json:"enabled"`
// EventFilter Required within this object. Which events trigger the subscription. See EventFilter.
EventFilter EventFilter `json:"event_filter"`
// Handlers Required within this object. Exactly one delivery handler: a webhook (fixed JSON payload) or a custom-webhook (templated request).
Handlers []WebhookHandlerInputUpdate `json:"handlers"`
// ProjectKey Optional within this object. Must equal the stored project key or be omitted; the project of a subscription cannot change.
ProjectKey *string `json:"project_key,omitempty"`
}
WebhookSubscriptionUpdate Body for replacing a webhook subscription. Every field is replaced except the key, which comes from the path, and secrets, which follow the keep, rotate and wipe rules on their fields.