user

package
v0.20231109.1114643 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2023-06-07/user Documentation

The user SDK allows for interaction with the Azure Resource Manager Service labservices (API Version 2023-06-07).

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/labservices/2023-06-07/user"

Client Initialization

client := user.NewUserClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: UserClient.CreateOrUpdate

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

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


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

Example Usage: UserClient.Delete

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

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

Example Usage: UserClient.Get

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

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: UserClient.Invite

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

payload := user.InviteBody{
	// ...
}


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

Example Usage: UserClient.ListByLab

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

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

Example Usage: UserClient.Update

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

payload := user.UserUpdate{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForInvitationState

func PossibleValuesForInvitationState() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForRegistrationState

func PossibleValuesForRegistrationState() []string

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
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type InvitationState

type InvitationState string
const (
	InvitationStateFailed  InvitationState = "Failed"
	InvitationStateNotSent InvitationState = "NotSent"
	InvitationStateSending InvitationState = "Sending"
	InvitationStateSent    InvitationState = "Sent"
)

func (*InvitationState) UnmarshalJSON

func (s *InvitationState) UnmarshalJSON(bytes []byte) error

type InviteBody

type InviteBody struct {
	Text *string `json:"text,omitempty"`
}

type InviteOperationResponse

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

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) 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 ListByLabCompleteResult

type ListByLabCompleteResult struct {
	Items []User
}

type ListByLabOperationResponse

type ListByLabOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]User
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateLocked    ProvisioningState = "Locked"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type RegistrationState

type RegistrationState string
const (
	RegistrationStateNotRegistered RegistrationState = "NotRegistered"
	RegistrationStateRegistered    RegistrationState = "Registered"
)

func (*RegistrationState) UnmarshalJSON

func (s *RegistrationState) UnmarshalJSON(bytes []byte) error

type ResourceOperationError

type ResourceOperationError struct {
	Action    *string `json:"action,omitempty"`
	Code      *string `json:"code,omitempty"`
	Message   *string `json:"message,omitempty"`
	Timestamp *string `json:"timestamp,omitempty"`
}

func (*ResourceOperationError) GetTimestampAsTime

func (o *ResourceOperationError) GetTimestampAsTime() (*time.Time, error)

func (*ResourceOperationError) SetTimestampAsTime

func (o *ResourceOperationError) SetTimestampAsTime(input time.Time)

type UpdateOperationResponse

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

type User

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

type UserClient

type UserClient struct {
	Client *resourcemanager.Client
}

func NewUserClientWithBaseURI

func NewUserClientWithBaseURI(sdkApi sdkEnv.Api) (*UserClient, error)

func (UserClient) CreateOrUpdate

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

CreateOrUpdate ...

func (UserClient) CreateOrUpdateThenPoll

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

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (UserClient) Delete

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

Delete ...

func (UserClient) DeleteThenPoll

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

DeleteThenPoll performs Delete then polls until it's completed

func (UserClient) Get

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

Get ...

func (UserClient) Invite

func (c UserClient) Invite(ctx context.Context, id UserId, input InviteBody) (result InviteOperationResponse, err error)

Invite ...

func (UserClient) InviteThenPoll

func (c UserClient) InviteThenPoll(ctx context.Context, id UserId, input InviteBody) error

InviteThenPoll performs Invite then polls until it's completed

func (UserClient) ListByLab

func (c UserClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error)

ListByLab ...

func (UserClient) ListByLabComplete

func (c UserClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error)

ListByLabComplete retrieves all the results into a single object

func (UserClient) ListByLabCompleteMatchingPredicate

func (c UserClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate UserOperationPredicate) (result ListByLabCompleteResult, err error)

ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (UserClient) Update

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

Update ...

func (UserClient) UpdateThenPoll

func (c UserClient) UpdateThenPoll(ctx context.Context, id UserId, input UserUpdate) error

UpdateThenPoll performs Update then polls until it's completed

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) 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 UserOperationPredicate

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

func (UserOperationPredicate) Matches

func (p UserOperationPredicate) Matches(input User) bool

type UserProperties

type UserProperties struct {
	AdditionalUsageQuota   *string                 `json:"additionalUsageQuota,omitempty"`
	DisplayName            *string                 `json:"displayName,omitempty"`
	Email                  string                  `json:"email"`
	InvitationSent         *string                 `json:"invitationSent,omitempty"`
	InvitationState        *InvitationState        `json:"invitationState,omitempty"`
	ProvisioningState      *ProvisioningState      `json:"provisioningState,omitempty"`
	RegistrationState      *RegistrationState      `json:"registrationState,omitempty"`
	ResourceOperationError *ResourceOperationError `json:"resourceOperationError,omitempty"`
	TotalUsage             *string                 `json:"totalUsage,omitempty"`
}

func (*UserProperties) GetInvitationSentAsTime

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

func (*UserProperties) SetInvitationSentAsTime

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

type UserUpdate

type UserUpdate struct {
	Properties *UserUpdateProperties `json:"properties,omitempty"`
}

type UserUpdateProperties

type UserUpdateProperties struct {
	AdditionalUsageQuota *string `json:"additionalUsageQuota,omitempty"`
}

Jump to

Keyboard shortcuts

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