users

package
v0.20240606.1065251 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

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

The users 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/users"

Client Initialization

client := users.NewUsersClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: UsersClient.CreateOrUpdate

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

payload := users.User{
	// ...
}


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

Example Usage: UsersClient.Delete

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

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

Example Usage: UsersClient.Get

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

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

Example Usage: UsersClient.List

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

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

Example Usage: UsersClient.Update

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

payload := users.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 ValidateLabID

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

ValidateLabID checks that 'input' can be parsed as a Lab 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
	Model        *User
}

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

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

type GetOperationResponse

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

type LabId

type LabId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
}

LabId is a struct representing the Resource ID for a Lab

func NewLabID

func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId

NewLabID returns a new LabId struct

func ParseLabID

func ParseLabID(input string) (*LabId, error)

ParseLabID parses 'input' into a LabId

func ParseLabIDInsensitively

func ParseLabIDInsensitively(input string) (*LabId, error)

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

func (*LabId) FromParseResult

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

func (LabId) ID

func (id LabId) ID() string

ID returns the formatted Lab ID

func (LabId) Segments

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

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

func (LabId) String

func (id LabId) String() string

String returns a human-readable description of this Lab ID

type ListCompleteResult

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

type ListOperationOptions

type ListOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	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        *[]User
}

type UpdateOperationResponse

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

type UpdateResource

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

type User

type User struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *UserProperties    `json:"properties,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,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

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

type UserIdentity

type UserIdentity struct {
	AppId         *string `json:"appId,omitempty"`
	ObjectId      *string `json:"objectId,omitempty"`
	PrincipalId   *string `json:"principalId,omitempty"`
	PrincipalName *string `json:"principalName,omitempty"`
	TenantId      *string `json:"tenantId,omitempty"`
}

type UserOperationPredicate

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

func (UserOperationPredicate) Matches

func (p UserOperationPredicate) Matches(input User) bool

type UserProperties

type UserProperties struct {
	CreatedDate       *string          `json:"createdDate,omitempty"`
	Identity          *UserIdentity    `json:"identity,omitempty"`
	ProvisioningState *string          `json:"provisioningState,omitempty"`
	SecretStore       *UserSecretStore `json:"secretStore,omitempty"`
	UniqueIdentifier  *string          `json:"uniqueIdentifier,omitempty"`
}

func (*UserProperties) GetCreatedDateAsTime

func (o *UserProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*UserProperties) SetCreatedDateAsTime

func (o *UserProperties) SetCreatedDateAsTime(input time.Time)

type UserSecretStore

type UserSecretStore struct {
	KeyVaultId  *string `json:"keyVaultId,omitempty"`
	KeyVaultUri *string `json:"keyVaultUri,omitempty"`
}

type UsersClient

type UsersClient struct {
	Client *resourcemanager.Client
}

func NewUsersClientWithBaseURI

func NewUsersClientWithBaseURI(sdkApi sdkEnv.Api) (*UsersClient, error)

func (UsersClient) CreateOrUpdate

func (c UsersClient) CreateOrUpdate(ctx context.Context, id UserId, input User) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (UsersClient) CreateOrUpdateThenPoll

func (c UsersClient) CreateOrUpdateThenPoll(ctx context.Context, id UserId, input User) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (UsersClient) Delete

func (c UsersClient) Delete(ctx context.Context, id UserId) (result DeleteOperationResponse, err error)

Delete ...

func (UsersClient) DeleteThenPoll

func (c UsersClient) DeleteThenPoll(ctx context.Context, id UserId) error

DeleteThenPoll performs Delete then polls until it's completed

func (UsersClient) Get

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

Get ...

func (UsersClient) List

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

List ...

func (UsersClient) ListComplete

func (c UsersClient) ListComplete(ctx context.Context, id LabId, options ListOperationOptions) (ListCompleteResult, error)

ListComplete retrieves all the results into a single object

func (UsersClient) ListCompleteMatchingPredicate

func (c UsersClient) ListCompleteMatchingPredicate(ctx context.Context, id LabId, options ListOperationOptions, predicate UserOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (UsersClient) Update

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

Update ...

Jump to

Keyboard shortcuts

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