suppressions

package
v0.20240715.1103416 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/advisor/2023-01-01/suppressions Documentation

The suppressions SDK allows for interaction with the Azure Resource Manager Service advisor (API Version 2023-01-01).

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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/advisor/2023-01-01/suppressions"

Client Initialization

client := suppressions.NewSuppressionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SuppressionsClient.Create

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

payload := suppressions.SuppressionContract{
	// ...
}


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

Example Usage: SuppressionsClient.Delete

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

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

Example Usage: SuppressionsClient.Get

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

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: SuppressionsClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateScopedSuppressionID

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

ValidateScopedSuppressionID checks that 'input' can be parsed as a Scoped Suppression ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SuppressionContract
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SuppressionContract
}

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

type ListOperationOptions struct {
	Top *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

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

type ScopedSuppressionId

type ScopedSuppressionId struct {
	ResourceUri      string
	RecommendationId string
	SuppressionName  string
}

ScopedSuppressionId is a struct representing the Resource ID for a Scoped Suppression

func NewScopedSuppressionID

func NewScopedSuppressionID(resourceUri string, recommendationId string, suppressionName string) ScopedSuppressionId

NewScopedSuppressionID returns a new ScopedSuppressionId struct

func ParseScopedSuppressionID

func ParseScopedSuppressionID(input string) (*ScopedSuppressionId, error)

ParseScopedSuppressionID parses 'input' into a ScopedSuppressionId

func ParseScopedSuppressionIDInsensitively

func ParseScopedSuppressionIDInsensitively(input string) (*ScopedSuppressionId, error)

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

func (*ScopedSuppressionId) FromParseResult

func (id *ScopedSuppressionId) FromParseResult(input resourceids.ParseResult) error

func (ScopedSuppressionId) ID

func (id ScopedSuppressionId) ID() string

ID returns the formatted Scoped Suppression ID

func (ScopedSuppressionId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scoped Suppression ID

func (ScopedSuppressionId) String

func (id ScopedSuppressionId) String() string

String returns a human-readable description of this Scoped Suppression ID

type SuppressionContract

type SuppressionContract struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *SuppressionProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type SuppressionContractOperationPredicate

type SuppressionContractOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (SuppressionContractOperationPredicate) Matches

type SuppressionProperties

type SuppressionProperties struct {
	ExpirationTimeStamp *string `json:"expirationTimeStamp,omitempty"`
	SuppressionId       *string `json:"suppressionId,omitempty"`
	Ttl                 *string `json:"ttl,omitempty"`
}

func (*SuppressionProperties) GetExpirationTimeStampAsTime

func (o *SuppressionProperties) GetExpirationTimeStampAsTime() (*time.Time, error)

func (*SuppressionProperties) SetExpirationTimeStampAsTime

func (o *SuppressionProperties) SetExpirationTimeStampAsTime(input time.Time)

type SuppressionsClient

type SuppressionsClient struct {
	Client *resourcemanager.Client
}

func NewSuppressionsClientWithBaseURI

func NewSuppressionsClientWithBaseURI(sdkApi sdkEnv.Api) (*SuppressionsClient, error)

func (SuppressionsClient) Create

Create ...

func (SuppressionsClient) Delete

Delete ...

func (SuppressionsClient) Get

Get ...

func (SuppressionsClient) List

List ...

func (SuppressionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (SuppressionsClient) ListCompleteMatchingPredicate

func (c SuppressionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate SuppressionContractOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

Jump to

Keyboard shortcuts

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