secrets

package
v0.20231214.1160726 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: 10 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/secrets Documentation

The secrets SDK allows for interaction with the Azure Resource Manager Service devtestlab (API Version 2018-09-15).

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/devtestlab/2018-09-15/secrets"

Client Initialization

client := secrets.NewSecretsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SecretsClient.CreateOrUpdate

ctx := context.TODO()
id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "secretValue")

payload := secrets.Secret{
	// ...
}


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

Example Usage: SecretsClient.Delete

ctx := context.TODO()
id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "secretValue")

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: SecretsClient.Get

ctx := context.TODO()
id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "secretValue")

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

Example Usage: SecretsClient.List

ctx := context.TODO()
id := secrets.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue")

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

Example Usage: SecretsClient.Update

ctx := context.TODO()
id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "secretValue")

payload := secrets.UpdateResource{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSecretID

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

ValidateSecretID checks that 'input' can be parsed as a Secret ID

func ValidateUserID

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

ValidateUserID checks that 'input' can be parsed as a User ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders added in v0.20230815.1165905

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

func (GetOperationOptions) ToOData added in v0.20230815.1165905

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

func (GetOperationOptions) ToQuery added in v0.20230815.1165905

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []Secret
}

type ListOperationOptions

type ListOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	Top     *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders added in v0.20230815.1165905

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

func (ListOperationOptions) ToOData added in v0.20230815.1165905

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

func (ListOperationOptions) ToQuery added in v0.20230815.1165905

type ListOperationResponse

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

type Secret

type Secret struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties SecretProperties   `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type SecretId

type SecretId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	UserName          string
	SecretName        string
}

SecretId is a struct representing the Resource ID for a Secret

func NewSecretID

func NewSecretID(subscriptionId string, resourceGroupName string, labName string, userName string, secretName string) SecretId

NewSecretID returns a new SecretId struct

func ParseSecretID

func ParseSecretID(input string) (*SecretId, error)

ParseSecretID parses 'input' into a SecretId

func ParseSecretIDInsensitively

func ParseSecretIDInsensitively(input string) (*SecretId, error)

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

func (*SecretId) FromParseResult added in v0.20231127.1171502

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

func (SecretId) ID

func (id SecretId) ID() string

ID returns the formatted Secret ID

func (SecretId) Segments

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

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

func (SecretId) String

func (id SecretId) String() string

String returns a human-readable description of this Secret ID

type SecretOperationPredicate

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

func (SecretOperationPredicate) Matches

func (p SecretOperationPredicate) Matches(input Secret) bool

type SecretProperties

type SecretProperties struct {
	ProvisioningState *string `json:"provisioningState,omitempty"`
	UniqueIdentifier  *string `json:"uniqueIdentifier,omitempty"`
	Value             *string `json:"value,omitempty"`
}

type SecretsClient

type SecretsClient struct {
	Client *resourcemanager.Client
}

func NewSecretsClientWithBaseURI

func NewSecretsClientWithBaseURI(sdkApi sdkEnv.Api) (*SecretsClient, error)

func (SecretsClient) CreateOrUpdate

func (c SecretsClient) CreateOrUpdate(ctx context.Context, id SecretId, input Secret) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (SecretsClient) CreateOrUpdateThenPoll

func (c SecretsClient) CreateOrUpdateThenPoll(ctx context.Context, id SecretId, input Secret) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (SecretsClient) Delete

func (c SecretsClient) Delete(ctx context.Context, id SecretId) (result DeleteOperationResponse, err error)

Delete ...

func (SecretsClient) Get

func (c SecretsClient) Get(ctx context.Context, id SecretId, options GetOperationOptions) (result GetOperationResponse, err error)

Get ...

func (SecretsClient) List

func (c SecretsClient) List(ctx context.Context, id UserId, options ListOperationOptions) (result ListOperationResponse, err error)

List ...

func (SecretsClient) ListComplete

func (c SecretsClient) ListComplete(ctx context.Context, id UserId, options ListOperationOptions) (ListCompleteResult, error)

ListComplete retrieves all the results into a single object

func (SecretsClient) ListCompleteMatchingPredicate

func (c SecretsClient) ListCompleteMatchingPredicate(ctx context.Context, id UserId, options ListOperationOptions, predicate SecretOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SecretsClient) Update

func (c SecretsClient) Update(ctx context.Context, id SecretId, input UpdateResource) (result UpdateOperationResponse, err error)

Update ...

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Secret
}

type UpdateResource

type UpdateResource struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type UserId

type UserId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	UserName          string
}

UserId is a struct representing the Resource ID for a User

func NewUserID

func NewUserID(subscriptionId string, resourceGroupName string, labName string, userName string) UserId

NewUserID returns a new UserId struct

func ParseUserID

func ParseUserID(input string) (*UserId, error)

ParseUserID parses 'input' into a UserId

func ParseUserIDInsensitively

func ParseUserIDInsensitively(input string) (*UserId, error)

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

func (*UserId) FromParseResult added in v0.20231127.1171502

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

func (UserId) ID

func (id UserId) ID() string

ID returns the formatted User ID

func (UserId) Segments

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

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

func (UserId) String

func (id UserId) String() string

String returns a human-readable description of this User ID

Jump to

Keyboard shortcuts

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