webhooksv1

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package webhooksv1 : Operations and models for the WebhooksV1 service

Index

Constants

View Source
const DefaultServiceName = "webhooks"

DefaultServiceName is the default key used to find external configuration information.

View Source
const DefaultServiceURL = "https://api.cis.cloud.ibm.com"

DefaultServiceURL is the default URL to make service requests to.

Variables

This section is empty.

Functions

func GetServiceURLForRegion

func GetServiceURLForRegion(region string) (string, error)

GetServiceURLForRegion returns the service URL to be used for the specified region

func UnmarshalGetAlertWebhookResp

func UnmarshalGetAlertWebhookResp(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalGetAlertWebhookResp unmarshals an instance of GetAlertWebhookResp from the specified map of raw messages.

func UnmarshalGetAlertWebhookRespResult

func UnmarshalGetAlertWebhookRespResult(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalGetAlertWebhookRespResult unmarshals an instance of GetAlertWebhookRespResult from the specified map of raw messages.

func UnmarshalListAlertWebhooksResp

func UnmarshalListAlertWebhooksResp(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalListAlertWebhooksResp unmarshals an instance of ListAlertWebhooksResp from the specified map of raw messages.

func UnmarshalListAlertWebhooksRespResultItem

func UnmarshalListAlertWebhooksRespResultItem(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalListAlertWebhooksRespResultItem unmarshals an instance of ListAlertWebhooksRespResultItem from the specified map of raw messages.

func UnmarshalWebhookSuccessResp

func UnmarshalWebhookSuccessResp(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWebhookSuccessResp unmarshals an instance of WebhookSuccessResp from the specified map of raw messages.

func UnmarshalWebhookSuccessRespResult

func UnmarshalWebhookSuccessRespResult(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWebhookSuccessRespResult unmarshals an instance of WebhookSuccessRespResult from the specified map of raw messages.

Types

type CreateAlertWebhookOptions

type CreateAlertWebhookOptions struct {
	// Webhook Name.
	Name *string `json:"name,omitempty"`

	// Webhook url.
	URL *string `json:"url,omitempty"`

	// The optional secret or API key needed to use the webhook.
	Secret *string `json:"secret,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

CreateAlertWebhookOptions : The CreateAlertWebhook options.

func (*CreateAlertWebhookOptions) SetHeaders

func (options *CreateAlertWebhookOptions) SetHeaders(param map[string]string) *CreateAlertWebhookOptions

SetHeaders : Allow user to set Headers

func (*CreateAlertWebhookOptions) SetName

SetName : Allow user to set Name

func (*CreateAlertWebhookOptions) SetSecret

func (_options *CreateAlertWebhookOptions) SetSecret(secret string) *CreateAlertWebhookOptions

SetSecret : Allow user to set Secret

func (*CreateAlertWebhookOptions) SetURL

SetURL : Allow user to set URL

type DeleteWebhookOptions

type DeleteWebhookOptions struct {
	// Alert webhook identifier.
	WebhookID *string `json:"webhook_id" validate:"required,ne="`

	// Allows users to set headers on API requests
	Headers map[string]string
}

DeleteWebhookOptions : The DeleteWebhook options.

func (*DeleteWebhookOptions) SetHeaders

func (options *DeleteWebhookOptions) SetHeaders(param map[string]string) *DeleteWebhookOptions

SetHeaders : Allow user to set Headers

func (*DeleteWebhookOptions) SetWebhookID

func (_options *DeleteWebhookOptions) SetWebhookID(webhookID string) *DeleteWebhookOptions

SetWebhookID : Allow user to set WebhookID

type GetAlertWebhookResp

type GetAlertWebhookResp struct {
	// Was operation successful.
	Success *bool `json:"success" validate:"required"`

	// Array of errors encountered.
	Errors [][]string `json:"errors" validate:"required"`

	// Array of messages returned.
	Messages [][]string `json:"messages" validate:"required"`

	// Container for response information.
	Result *GetAlertWebhookRespResult `json:"result" validate:"required"`
}

GetAlertWebhookResp : Get Alert Webhooks Response.

type GetAlertWebhookRespResult

type GetAlertWebhookRespResult struct {
	// Webhook ID.
	ID *string `json:"id" validate:"required"`

	// Webhook Name.
	Name *string `json:"name" validate:"required"`

	// Webhook url.
	URL *string `json:"url" validate:"required"`

	// Webhook type.
	Type *string `json:"type" validate:"required"`

	// When was the webhook created.
	CreatedAt *string `json:"created_at" validate:"required"`

	// When was the webhook last used successfully.
	LastSuccess *string `json:"last_success" validate:"required"`

	// When was the webhook last used and failed.
	LastFailure *string `json:"last_failure" validate:"required"`
}

GetAlertWebhookRespResult : Container for response information.

type GetWebhookOptions

type GetWebhookOptions struct {
	// Alert webhook identifier.
	WebhookID *string `json:"webhook_id" validate:"required,ne="`

	// Allows users to set headers on API requests
	Headers map[string]string
}

GetWebhookOptions : The GetWebhook options.

func (*GetWebhookOptions) SetHeaders

func (options *GetWebhookOptions) SetHeaders(param map[string]string) *GetWebhookOptions

SetHeaders : Allow user to set Headers

func (*GetWebhookOptions) SetWebhookID

func (_options *GetWebhookOptions) SetWebhookID(webhookID string) *GetWebhookOptions

SetWebhookID : Allow user to set WebhookID

type ListAlertWebhooksResp

type ListAlertWebhooksResp struct {
	// Was operation successful.
	Success *bool `json:"success" validate:"required"`

	// Array of errors encountered.
	Errors [][]string `json:"errors" validate:"required"`

	// Array of messages returned.
	Messages [][]string `json:"messages" validate:"required"`

	// Container for response information.
	Result []ListAlertWebhooksRespResultItem `json:"result" validate:"required"`
}

ListAlertWebhooksResp : List Alert Webhooks Response.

type ListAlertWebhooksRespResultItem

type ListAlertWebhooksRespResultItem struct {
	// Webhook ID.
	ID *string `json:"id" validate:"required"`

	// Webhook Name.
	Name *string `json:"name" validate:"required"`

	// Webhook url.
	URL *string `json:"url" validate:"required"`

	// Webhook type.
	Type *string `json:"type" validate:"required"`

	// When was the webhook created.
	CreatedAt *string `json:"created_at" validate:"required"`

	// When was the webhook last used successfully.
	LastSuccess *string `json:"last_success" validate:"required"`

	// When was the webhook last used and failed.
	LastFailure *string `json:"last_failure" validate:"required"`
}

ListAlertWebhooksRespResultItem : ListAlertWebhooksRespResultItem struct

type ListWebhooksOptions

type ListWebhooksOptions struct {

	// Allows users to set headers on API requests
	Headers map[string]string
}

ListWebhooksOptions : The ListWebhooks options.

func (*ListWebhooksOptions) SetHeaders

func (options *ListWebhooksOptions) SetHeaders(param map[string]string) *ListWebhooksOptions

SetHeaders : Allow user to set Headers

type UpdateAlertWebhookOptions

type UpdateAlertWebhookOptions struct {
	// Alert webhook identifier.
	WebhookID *string `json:"webhook_id" validate:"required,ne="`

	// Webhook Name.
	Name *string `json:"name,omitempty"`

	// Webhook url.
	URL *string `json:"url,omitempty"`

	// The optional secret or API key needed to use the webhook.
	Secret *string `json:"secret,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

UpdateAlertWebhookOptions : The UpdateAlertWebhook options.

func (*UpdateAlertWebhookOptions) SetHeaders

func (options *UpdateAlertWebhookOptions) SetHeaders(param map[string]string) *UpdateAlertWebhookOptions

SetHeaders : Allow user to set Headers

func (*UpdateAlertWebhookOptions) SetName

SetName : Allow user to set Name

func (*UpdateAlertWebhookOptions) SetSecret

func (_options *UpdateAlertWebhookOptions) SetSecret(secret string) *UpdateAlertWebhookOptions

SetSecret : Allow user to set Secret

func (*UpdateAlertWebhookOptions) SetURL

SetURL : Allow user to set URL

func (*UpdateAlertWebhookOptions) SetWebhookID

func (_options *UpdateAlertWebhookOptions) SetWebhookID(webhookID string) *UpdateAlertWebhookOptions

SetWebhookID : Allow user to set WebhookID

type WebhookSuccessResp

type WebhookSuccessResp struct {
	// Was operation successful.
	Success *bool `json:"success" validate:"required"`

	// Array of errors encountered.
	Errors [][]string `json:"errors" validate:"required"`

	// Array of messages returned.
	Messages [][]string `json:"messages" validate:"required"`

	// Container for response information.
	Result *WebhookSuccessRespResult `json:"result" validate:"required"`
}

WebhookSuccessResp : Alert Webhooks Response.

type WebhookSuccessRespResult

type WebhookSuccessRespResult struct {
	// Webhook ID.
	ID *string `json:"id" validate:"required"`
}

WebhookSuccessRespResult : Container for response information.

type WebhooksV1

type WebhooksV1 struct {
	Service *core.BaseService

	// Full url-encoded CRN of the service instance.
	Crn *string
}

WebhooksV1 : CIS Alert Webhooks

API Version: 1.0.0

func NewWebhooksV1

func NewWebhooksV1(options *WebhooksV1Options) (service *WebhooksV1, err error)

NewWebhooksV1 : constructs an instance of WebhooksV1 with passed in options.

func NewWebhooksV1UsingExternalConfig

func NewWebhooksV1UsingExternalConfig(options *WebhooksV1Options) (webhooks *WebhooksV1, err error)

NewWebhooksV1UsingExternalConfig : constructs an instance of WebhooksV1 with passed in options and external configuration.

func (*WebhooksV1) Clone

func (webhooks *WebhooksV1) Clone() *WebhooksV1

Clone makes a copy of "webhooks" suitable for processing requests.

func (*WebhooksV1) CreateAlertWebhook

func (webhooks *WebhooksV1) CreateAlertWebhook(createAlertWebhookOptions *CreateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

CreateAlertWebhook : Create an alert webhook Create a new alert webhook for the CIS instance.

func (*WebhooksV1) CreateAlertWebhookWithContext

func (webhooks *WebhooksV1) CreateAlertWebhookWithContext(ctx context.Context, createAlertWebhookOptions *CreateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

CreateAlertWebhookWithContext is an alternate form of the CreateAlertWebhook method which supports a Context parameter

func (*WebhooksV1) DeleteWebhook

func (webhooks *WebhooksV1) DeleteWebhook(deleteWebhookOptions *DeleteWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

DeleteWebhook : Delete an alert webhook Delete an alert webhook for the CIS instance.

func (*WebhooksV1) DeleteWebhookWithContext

func (webhooks *WebhooksV1) DeleteWebhookWithContext(ctx context.Context, deleteWebhookOptions *DeleteWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

DeleteWebhookWithContext is an alternate form of the DeleteWebhook method which supports a Context parameter

func (*WebhooksV1) DisableRetries

func (webhooks *WebhooksV1) DisableRetries()

DisableRetries disables automatic retries for requests invoked for this service instance.

func (*WebhooksV1) EnableRetries

func (webhooks *WebhooksV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)

EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.

func (*WebhooksV1) GetEnableGzipCompression

func (webhooks *WebhooksV1) GetEnableGzipCompression() bool

GetEnableGzipCompression returns the service's EnableGzipCompression field

func (*WebhooksV1) GetServiceURL

func (webhooks *WebhooksV1) GetServiceURL() string

GetServiceURL returns the service URL

func (*WebhooksV1) GetWebhook

func (webhooks *WebhooksV1) GetWebhook(getWebhookOptions *GetWebhookOptions) (result *GetAlertWebhookResp, response *core.DetailedResponse, err error)

GetWebhook : Get an alert webhook Get an alert webhook for the CIS instance.

func (*WebhooksV1) GetWebhookWithContext

func (webhooks *WebhooksV1) GetWebhookWithContext(ctx context.Context, getWebhookOptions *GetWebhookOptions) (result *GetAlertWebhookResp, response *core.DetailedResponse, err error)

GetWebhookWithContext is an alternate form of the GetWebhook method which supports a Context parameter

func (*WebhooksV1) ListWebhooks

func (webhooks *WebhooksV1) ListWebhooks(listWebhooksOptions *ListWebhooksOptions) (result *ListAlertWebhooksResp, response *core.DetailedResponse, err error)

ListWebhooks : List alert webhooks List configured alert webhooks for the CIS instance.

func (*WebhooksV1) ListWebhooksWithContext

func (webhooks *WebhooksV1) ListWebhooksWithContext(ctx context.Context, listWebhooksOptions *ListWebhooksOptions) (result *ListAlertWebhooksResp, response *core.DetailedResponse, err error)

ListWebhooksWithContext is an alternate form of the ListWebhooks method which supports a Context parameter

func (*WebhooksV1) NewCreateAlertWebhookOptions

func (*WebhooksV1) NewCreateAlertWebhookOptions() *CreateAlertWebhookOptions

NewCreateAlertWebhookOptions : Instantiate CreateAlertWebhookOptions

func (*WebhooksV1) NewDeleteWebhookOptions

func (*WebhooksV1) NewDeleteWebhookOptions(webhookID string) *DeleteWebhookOptions

NewDeleteWebhookOptions : Instantiate DeleteWebhookOptions

func (*WebhooksV1) NewGetWebhookOptions

func (*WebhooksV1) NewGetWebhookOptions(webhookID string) *GetWebhookOptions

NewGetWebhookOptions : Instantiate GetWebhookOptions

func (*WebhooksV1) NewListWebhooksOptions

func (*WebhooksV1) NewListWebhooksOptions() *ListWebhooksOptions

NewListWebhooksOptions : Instantiate ListWebhooksOptions

func (*WebhooksV1) NewUpdateAlertWebhookOptions

func (*WebhooksV1) NewUpdateAlertWebhookOptions(webhookID string) *UpdateAlertWebhookOptions

NewUpdateAlertWebhookOptions : Instantiate UpdateAlertWebhookOptions

func (*WebhooksV1) SetDefaultHeaders

func (webhooks *WebhooksV1) SetDefaultHeaders(headers http.Header)

SetDefaultHeaders sets HTTP headers to be sent in every request

func (*WebhooksV1) SetEnableGzipCompression

func (webhooks *WebhooksV1) SetEnableGzipCompression(enableGzip bool)

SetEnableGzipCompression sets the service's EnableGzipCompression field

func (*WebhooksV1) SetServiceURL

func (webhooks *WebhooksV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

func (*WebhooksV1) UpdateAlertWebhook

func (webhooks *WebhooksV1) UpdateAlertWebhook(updateAlertWebhookOptions *UpdateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

UpdateAlertWebhook : Update an alert webhook Update an existing alert webhook for the CIS instance.

func (*WebhooksV1) UpdateAlertWebhookWithContext

func (webhooks *WebhooksV1) UpdateAlertWebhookWithContext(ctx context.Context, updateAlertWebhookOptions *UpdateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error)

UpdateAlertWebhookWithContext is an alternate form of the UpdateAlertWebhook method which supports a Context parameter

type WebhooksV1Options

type WebhooksV1Options struct {
	ServiceName   string
	URL           string
	Authenticator core.Authenticator

	// Full url-encoded CRN of the service instance.
	Crn *string `validate:"required"`
}

WebhooksV1Options : Service options

Jump to

Keyboard shortcuts

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