suppressions

package
v0.20231214.1094851 Latest Latest
Warning

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

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

README

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

The suppressions SDK allows for interaction with the Azure Resource Manager Service advisor (API Version 2022-10-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-sdk/resource-manager/advisor/2022-10-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 := suppressions.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 {
	Items []SuppressionContract
}

type ListOperationOptions

type ListOperationOptions struct {
	Top *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders added in v0.20230731.1080956

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

func (ListOperationOptions) ToOData added in v0.20230731.1080956

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

func (ListOperationOptions) ToQuery added in v0.20230731.1080956

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 added in v0.20231127.1171502

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