webhooks

package
v0.20231025.1113325 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks Documentation

The webhooks SDK allows for interaction with the Azure Resource Manager Service containerregistry (API Version 2021-08-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks"

Client Initialization

client := webhooks.NewWebHooksClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: WebHooksClient.Create

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

payload := webhooks.WebhookCreateParameters{
	// ...
}


if err := client.CreateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: WebHooksClient.Delete

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: WebHooksClient.Get

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: WebHooksClient.GetCallbackConfig

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

read, err := client.GetCallbackConfig(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: WebHooksClient.List

ctx := context.TODO()
id := webhooks.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: WebHooksClient.ListEvents

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

// alternatively `client.ListEvents(ctx, id)` can be used to do batched pagination
items, err := client.ListEventsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: WebHooksClient.Ping

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

read, err := client.Ping(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: WebHooksClient.Update

ctx := context.TODO()
id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue")

payload := webhooks.WebhookUpdateParameters{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForWebhookAction

func PossibleValuesForWebhookAction() []string

func PossibleValuesForWebhookStatus

func PossibleValuesForWebhookStatus() []string

func ValidateRegistryID

func ValidateRegistryID(input interface{}, key string) (warnings []string, errors []error)

ValidateRegistryID checks that 'input' can be parsed as a Registry ID

func ValidateWebHookID

func ValidateWebHookID(input interface{}, key string) (warnings []string, errors []error)

ValidateWebHookID checks that 'input' can be parsed as a Web Hook ID

Types

type Actor

type Actor struct {
	Name *string `json:"name,omitempty"`
}

type CallbackConfig

type CallbackConfig struct {
	CustomHeaders *map[string]string `json:"customHeaders,omitempty"`
	ServiceUri    string             `json:"serviceUri"`
}

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type Event

type Event struct {
	EventRequestMessage  *EventRequestMessage  `json:"eventRequestMessage,omitempty"`
	EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"`
	Id                   *string               `json:"id,omitempty"`
}

type EventContent

type EventContent struct {
	Action    *string  `json:"action,omitempty"`
	Actor     *Actor   `json:"actor,omitempty"`
	Id        *string  `json:"id,omitempty"`
	Request   *Request `json:"request,omitempty"`
	Source    *Source  `json:"source,omitempty"`
	Target    *Target  `json:"target,omitempty"`
	Timestamp *string  `json:"timestamp,omitempty"`
}

func (*EventContent) GetTimestampAsTime

func (o *EventContent) GetTimestampAsTime() (*time.Time, error)

func (*EventContent) SetTimestampAsTime

func (o *EventContent) SetTimestampAsTime(input time.Time)

type EventInfo

type EventInfo struct {
	Id *string `json:"id,omitempty"`
}

type EventOperationPredicate

type EventOperationPredicate struct {
	Id *string
}

func (EventOperationPredicate) Matches

func (p EventOperationPredicate) Matches(input Event) bool

type EventRequestMessage

type EventRequestMessage struct {
	Content    *EventContent      `json:"content,omitempty"`
	Headers    *map[string]string `json:"headers,omitempty"`
	Method     *string            `json:"method,omitempty"`
	RequestUri *string            `json:"requestUri,omitempty"`
	Version    *string            `json:"version,omitempty"`
}

type EventResponseMessage

type EventResponseMessage struct {
	Content      *string            `json:"content,omitempty"`
	Headers      *map[string]string `json:"headers,omitempty"`
	ReasonPhrase *string            `json:"reasonPhrase,omitempty"`
	StatusCode   *string            `json:"statusCode,omitempty"`
	Version      *string            `json:"version,omitempty"`
}

type GetCallbackConfigOperationResponse

type GetCallbackConfigOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CallbackConfig
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Webhook
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Webhook
}

type ListEventsCompleteResult

type ListEventsCompleteResult struct {
	Items []Event
}

type ListEventsOperationResponse

type ListEventsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Event
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Webhook
}

type PingOperationResponse

type PingOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *EventInfo
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON added in v0.20230406.1124617

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type RegistryId

type RegistryId struct {
	SubscriptionId    string
	ResourceGroupName string
	RegistryName      string
}

RegistryId is a struct representing the Resource ID for a Registry

func NewRegistryID

func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId

NewRegistryID returns a new RegistryId struct

func ParseRegistryID

func ParseRegistryID(input string) (*RegistryId, error)

ParseRegistryID parses 'input' into a RegistryId

func ParseRegistryIDInsensitively

func ParseRegistryIDInsensitively(input string) (*RegistryId, error)

ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId note: this method should only be used for API response data and not user input

func (RegistryId) ID

func (id RegistryId) ID() string

ID returns the formatted Registry ID

func (RegistryId) Segments

func (id RegistryId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Registry ID

func (RegistryId) String

func (id RegistryId) String() string

String returns a human-readable description of this Registry ID

type Request

type Request struct {
	Addr      *string `json:"addr,omitempty"`
	Host      *string `json:"host,omitempty"`
	Id        *string `json:"id,omitempty"`
	Method    *string `json:"method,omitempty"`
	Useragent *string `json:"useragent,omitempty"`
}

type Source

type Source struct {
	Addr       *string `json:"addr,omitempty"`
	InstanceID *string `json:"instanceID,omitempty"`
}

type Target

type Target struct {
	Digest     *string `json:"digest,omitempty"`
	Length     *int64  `json:"length,omitempty"`
	MediaType  *string `json:"mediaType,omitempty"`
	Name       *string `json:"name,omitempty"`
	Repository *string `json:"repository,omitempty"`
	Size       *int64  `json:"size,omitempty"`
	Tag        *string `json:"tag,omitempty"`
	Url        *string `json:"url,omitempty"`
	Version    *string `json:"version,omitempty"`
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type WebHookId

type WebHookId struct {
	SubscriptionId    string
	ResourceGroupName string
	RegistryName      string
	WebHookName       string
}

WebHookId is a struct representing the Resource ID for a Web Hook

func NewWebHookID

func NewWebHookID(subscriptionId string, resourceGroupName string, registryName string, webHookName string) WebHookId

NewWebHookID returns a new WebHookId struct

func ParseWebHookID

func ParseWebHookID(input string) (*WebHookId, error)

ParseWebHookID parses 'input' into a WebHookId

func ParseWebHookIDInsensitively

func ParseWebHookIDInsensitively(input string) (*WebHookId, error)

ParseWebHookIDInsensitively parses 'input' case-insensitively into a WebHookId note: this method should only be used for API response data and not user input

func (WebHookId) ID

func (id WebHookId) ID() string

ID returns the formatted Web Hook ID

func (WebHookId) Segments

func (id WebHookId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Web Hook ID

func (WebHookId) String

func (id WebHookId) String() string

String returns a human-readable description of this Web Hook ID

type WebHooksClient

type WebHooksClient struct {
	Client *resourcemanager.Client
}

func NewWebHooksClientWithBaseURI

func NewWebHooksClientWithBaseURI(sdkApi sdkEnv.Api) (*WebHooksClient, error)

func (WebHooksClient) Create

Create ...

func (WebHooksClient) CreateThenPoll

func (c WebHooksClient) CreateThenPoll(ctx context.Context, id WebHookId, input WebhookCreateParameters) error

CreateThenPoll performs Create then polls until it's completed

func (WebHooksClient) Delete

func (c WebHooksClient) Delete(ctx context.Context, id WebHookId) (result DeleteOperationResponse, err error)

Delete ...

func (WebHooksClient) DeleteThenPoll

func (c WebHooksClient) DeleteThenPoll(ctx context.Context, id WebHookId) error

DeleteThenPoll performs Delete then polls until it's completed

func (WebHooksClient) Get

func (c WebHooksClient) Get(ctx context.Context, id WebHookId) (result GetOperationResponse, err error)

Get ...

func (WebHooksClient) GetCallbackConfig

func (c WebHooksClient) GetCallbackConfig(ctx context.Context, id WebHookId) (result GetCallbackConfigOperationResponse, err error)

GetCallbackConfig ...

func (WebHooksClient) List

func (c WebHooksClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error)

List ...

func (WebHooksClient) ListComplete

func (c WebHooksClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error)

ListComplete retrieves all the results into a single object

func (WebHooksClient) ListCompleteMatchingPredicate

func (c WebHooksClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate WebhookOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (WebHooksClient) ListEvents

func (c WebHooksClient) ListEvents(ctx context.Context, id WebHookId) (result ListEventsOperationResponse, err error)

ListEvents ...

func (WebHooksClient) ListEventsComplete

func (c WebHooksClient) ListEventsComplete(ctx context.Context, id WebHookId) (ListEventsCompleteResult, error)

ListEventsComplete retrieves all the results into a single object

func (WebHooksClient) ListEventsCompleteMatchingPredicate

func (c WebHooksClient) ListEventsCompleteMatchingPredicate(ctx context.Context, id WebHookId, predicate EventOperationPredicate) (result ListEventsCompleteResult, err error)

ListEventsCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (WebHooksClient) Ping

func (c WebHooksClient) Ping(ctx context.Context, id WebHookId) (result PingOperationResponse, err error)

Ping ...

func (WebHooksClient) Update

Update ...

func (WebHooksClient) UpdateThenPoll

func (c WebHooksClient) UpdateThenPoll(ctx context.Context, id WebHookId, input WebhookUpdateParameters) error

UpdateThenPoll performs Update then polls until it's completed

type Webhook

type Webhook struct {
	Id         *string                `json:"id,omitempty"`
	Location   string                 `json:"location"`
	Name       *string                `json:"name,omitempty"`
	Properties *WebhookProperties     `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type WebhookAction

type WebhookAction string
const (
	WebhookActionChartDelete WebhookAction = "chart_delete"
	WebhookActionChartPush   WebhookAction = "chart_push"
	WebhookActionDelete      WebhookAction = "delete"
	WebhookActionPush        WebhookAction = "push"
	WebhookActionQuarantine  WebhookAction = "quarantine"
)

func (*WebhookAction) UnmarshalJSON added in v0.20230406.1124617

func (s *WebhookAction) UnmarshalJSON(bytes []byte) error

type WebhookCreateParameters

type WebhookCreateParameters struct {
	Location   string                             `json:"location"`
	Properties *WebhookPropertiesCreateParameters `json:"properties,omitempty"`
	Tags       *map[string]string                 `json:"tags,omitempty"`
}

type WebhookOperationPredicate

type WebhookOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (WebhookOperationPredicate) Matches

func (p WebhookOperationPredicate) Matches(input Webhook) bool

type WebhookProperties

type WebhookProperties struct {
	Actions           []WebhookAction    `json:"actions"`
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"`
	Scope             *string            `json:"scope,omitempty"`
	Status            *WebhookStatus     `json:"status,omitempty"`
}

type WebhookPropertiesCreateParameters

type WebhookPropertiesCreateParameters struct {
	Actions       []WebhookAction    `json:"actions"`
	CustomHeaders *map[string]string `json:"customHeaders,omitempty"`
	Scope         *string            `json:"scope,omitempty"`
	ServiceUri    string             `json:"serviceUri"`
	Status        *WebhookStatus     `json:"status,omitempty"`
}

type WebhookPropertiesUpdateParameters

type WebhookPropertiesUpdateParameters struct {
	Actions       *[]WebhookAction   `json:"actions,omitempty"`
	CustomHeaders *map[string]string `json:"customHeaders,omitempty"`
	Scope         *string            `json:"scope,omitempty"`
	ServiceUri    *string            `json:"serviceUri,omitempty"`
	Status        *WebhookStatus     `json:"status,omitempty"`
}

type WebhookStatus

type WebhookStatus string
const (
	WebhookStatusDisabled WebhookStatus = "disabled"
	WebhookStatusEnabled  WebhookStatus = "enabled"
)

func (*WebhookStatus) UnmarshalJSON added in v0.20230406.1124617

func (s *WebhookStatus) UnmarshalJSON(bytes []byte) error

type WebhookUpdateParameters

type WebhookUpdateParameters struct {
	Properties *WebhookPropertiesUpdateParameters `json:"properties,omitempty"`
	Tags       *map[string]string                 `json:"tags,omitempty"`
}

Jump to

Keyboard shortcuts

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