compliances

package
v0.20240322.1155759 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/compliances Documentation

The compliances SDK allows for interaction with the Azure Resource Manager Service security (API Version 2017-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/compliances"

Client Initialization

client := compliances.NewCompliancesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CompliancesClient.Get

ctx := context.TODO()
id := compliances.NewScopedComplianceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "complianceValue")

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

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

// 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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateScopedComplianceID

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

ValidateScopedComplianceID checks that 'input' can be parsed as a Scoped Compliance ID

Types

type Compliance

type Compliance struct {
	Id         *string               `json:"id,omitempty"`
	Name       *string               `json:"name,omitempty"`
	Properties *ComplianceProperties `json:"properties,omitempty"`
	Type       *string               `json:"type,omitempty"`
}

type ComplianceOperationPredicate

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

func (ComplianceOperationPredicate) Matches

func (p ComplianceOperationPredicate) Matches(input Compliance) bool

type ComplianceProperties

type ComplianceProperties struct {
	AssessmentResult           *[]ComplianceSegment `json:"assessmentResult,omitempty"`
	AssessmentTimestampUtcDate *string              `json:"assessmentTimestampUtcDate,omitempty"`
	ResourceCount              *int64               `json:"resourceCount,omitempty"`
}

func (*ComplianceProperties) GetAssessmentTimestampUtcDateAsTime

func (o *ComplianceProperties) GetAssessmentTimestampUtcDateAsTime() (*time.Time, error)

func (*ComplianceProperties) SetAssessmentTimestampUtcDateAsTime

func (o *ComplianceProperties) SetAssessmentTimestampUtcDateAsTime(input time.Time)

type ComplianceSegment

type ComplianceSegment struct {
	Percentage  *float64 `json:"percentage,omitempty"`
	SegmentType *string  `json:"segmentType,omitempty"`
}

type CompliancesClient

type CompliancesClient struct {
	Client *resourcemanager.Client
}

func NewCompliancesClientWithBaseURI

func NewCompliancesClientWithBaseURI(sdkApi sdkEnv.Api) (*CompliancesClient, error)

func (CompliancesClient) Get

Get ...

func (CompliancesClient) List

List ...

func (CompliancesClient) ListComplete

ListComplete retrieves all the results into a single object

func (CompliancesClient) ListCompleteMatchingPredicate

func (c CompliancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ComplianceOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type GetOperationResponse

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

type ListCompleteResult

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

type ListOperationResponse

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

type ScopedComplianceId

type ScopedComplianceId struct {
	Scope          string
	ComplianceName string
}

ScopedComplianceId is a struct representing the Resource ID for a Scoped Compliance

func NewScopedComplianceID

func NewScopedComplianceID(scope string, complianceName string) ScopedComplianceId

NewScopedComplianceID returns a new ScopedComplianceId struct

func ParseScopedComplianceID

func ParseScopedComplianceID(input string) (*ScopedComplianceId, error)

ParseScopedComplianceID parses 'input' into a ScopedComplianceId

func ParseScopedComplianceIDInsensitively

func ParseScopedComplianceIDInsensitively(input string) (*ScopedComplianceId, error)

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

func (*ScopedComplianceId) FromParseResult

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

func (ScopedComplianceId) ID

func (id ScopedComplianceId) ID() string

ID returns the formatted Scoped Compliance ID

func (ScopedComplianceId) Segments

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

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

func (ScopedComplianceId) String

func (id ScopedComplianceId) String() string

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

Jump to

Keyboard shortcuts

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