Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ package registrymanagement
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type RegistrySyndicatedRegistriesInlined struct {
SyndicatedRegistry *SyndicatedRegistry `json:"syndicatedRegistry,omitempty"`
SyndicatedRegistryGuid *string `json:"syndicatedRegistryGuid,omitempty"`
RegistryId *string `json:"registryId,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type AccountsGetChangeKeyVaultInformationOperationResponse struct {
Poller pollers.Poller
HttpResponse *http.Response
OData *odata.OData
Model *GetKeyVaultStatusResponse
}

// AccountsGetChangeKeyVaultInformation ...
Expand All @@ -26,6 +27,7 @@ func (c NetAppAccountsClient) AccountsGetChangeKeyVaultInformation(ctx context.C
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
http.StatusAccepted,
http.StatusOK,
},
HttpMethod: http.MethodPost,
Path: fmt.Sprintf("%s/getKeyVaultStatus", id.ID()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package containerapps
package netappaccounts

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type ContainerResources struct {
Cpu *float64 `json:"cpu,omitempty"`
Memory *string `json:"memory,omitempty"`
type GetKeyVaultStatusResponse struct {
Properties *GetKeyVaultStatusResponseProperties `json:"properties,omitempty"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package netappaccounts

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type GetKeyVaultStatusResponseProperties struct {
KeyName *string `json:"keyName,omitempty"`
KeyVaultPrivateEndpoints *[]KeyVaultPrivateEndpoint `json:"keyVaultPrivateEndpoints,omitempty"`
KeyVaultResourceId *string `json:"keyVaultResourceId,omitempty"`
KeyVaultUri *string `json:"keyVaultUri,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) {
type ProvisioningState string

const (
ProvisioningStateCanceled ProvisioningState = "Canceled"
ProvisioningStateCreating ProvisioningState = "Creating"
ProvisioningStateDeleting ProvisioningState = "Deleting"
ProvisioningStateFailed ProvisioningState = "Failed"
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
Expand All @@ -148,8 +146,6 @@ const (

func PossibleValuesForProvisioningState() []string {
return []string{
string(ProvisioningStateCanceled),
string(ProvisioningStateCreating),
string(ProvisioningStateDeleting),
string(ProvisioningStateFailed),
string(ProvisioningStateSucceeded),
Expand All @@ -172,8 +168,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error {

func parseProvisioningState(input string) (*ProvisioningState, error) {
vals := map[string]ProvisioningState{
"canceled": ProvisioningStateCanceled,
"creating": ProvisioningStateCreating,
"deleting": ProvisioningStateDeleting,
"failed": ProvisioningStateFailed,
"succeeded": ProvisioningStateSucceeded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ func parseIsGlobal(input string) (*IsGlobal, error) {
type ProvisioningState string

const (
ProvisioningStateCanceled ProvisioningState = "Canceled"
ProvisioningStateCreating ProvisioningState = "Creating"
ProvisioningStateDeleting ProvisioningState = "Deleting"
ProvisioningStateFailed ProvisioningState = "Failed"
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
Expand All @@ -227,8 +225,6 @@ const (

func PossibleValuesForProvisioningState() []string {
return []string{
string(ProvisioningStateCanceled),
string(ProvisioningStateCreating),
string(ProvisioningStateDeleting),
string(ProvisioningStateFailed),
string(ProvisioningStateSucceeded),
Expand All @@ -251,8 +247,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error {

func parseProvisioningState(input string) (*ProvisioningState, error) {
vals := map[string]ProvisioningState{
"canceled": ProvisioningStateCanceled,
"creating": ProvisioningStateCreating,
"deleting": ProvisioningStateDeleting,
"failed": ProvisioningStateFailed,
"succeeded": ProvisioningStateSucceeded,
Expand Down
62 changes: 62 additions & 0 deletions resource-manager/videoindexer/2025-01-01/accesstoken/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/videoindexer/2025-01-01/accesstoken` Documentation

The `accesstoken` SDK allows for interaction with Azure Resource Manager `videoindexer` (API Version `2025-01-01`).

This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs).

### Import Path

```go
import "github.com/hashicorp/go-azure-sdk/resource-manager/videoindexer/2025-01-01/accesstoken"
```


### Client Initialization

```go
client := accesstoken.NewAccessTokenClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
```


### Example Usage: `AccessTokenClient.GenerateAccessToken`

```go
ctx := context.TODO()
id := accesstoken.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName")

payload := accesstoken.GenerateAccessTokenParameters{
// ...
}


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


### Example Usage: `AccessTokenClient.GenerateRestrictedViewerAccessToken`

```go
ctx := context.TODO()
id := accesstoken.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName")

payload := accesstoken.GenerateRestrictedViewerAccessTokenParameters{
// ...
}


read, err := client.GenerateRestrictedViewerAccessToken(ctx, id, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package containerapps
package accesstoken

import (
"fmt"
Expand All @@ -10,17 +10,17 @@ import (
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type ContainerAppsClient struct {
type AccessTokenClient struct {
Client *resourcemanager.Client
}

func NewContainerAppsClientWithBaseURI(sdkApi sdkEnv.Api) (*ContainerAppsClient, error) {
client, err := resourcemanager.NewClient(sdkApi, "containerapps", defaultApiVersion)
func NewAccessTokenClientWithBaseURI(sdkApi sdkEnv.Api) (*AccessTokenClient, error) {
client, err := resourcemanager.NewClient(sdkApi, "accesstoken", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating ContainerAppsClient: %+v", err)
return nil, fmt.Errorf("instantiating AccessTokenClient: %+v", err)
}

return &ContainerAppsClient{
return &AccessTokenClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package accesstoken

import (
"encoding/json"
"fmt"
"strings"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type PermissionType string

const (
PermissionTypeContributor PermissionType = "Contributor"
PermissionTypeReader PermissionType = "Reader"
)

func PossibleValuesForPermissionType() []string {
return []string{
string(PermissionTypeContributor),
string(PermissionTypeReader),
}
}

func (s *PermissionType) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parsePermissionType(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parsePermissionType(input string) (*PermissionType, error) {
vals := map[string]PermissionType{
"contributor": PermissionTypeContributor,
"reader": PermissionTypeReader,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := PermissionType(input)
return &out, nil
}

type Scope string

const (
ScopeAccount Scope = "Account"
ScopeProject Scope = "Project"
ScopeVideo Scope = "Video"
)

func PossibleValuesForScope() []string {
return []string{
string(ScopeAccount),
string(ScopeProject),
string(ScopeVideo),
}
}

func (s *Scope) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseScope(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseScope(input string) (*Scope, error) {
vals := map[string]Scope{
"account": ScopeAccount,
"project": ScopeProject,
"video": ScopeVideo,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := Scope(input)
return &out, nil
}
Loading
Loading