Skip to content

Commit

Permalink
Updating based on 205c6fb2
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-tf-azure committed Apr 25, 2024
1 parent 5c4be19 commit 2314a83
Show file tree
Hide file tree
Showing 158 changed files with 9,510 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type RedisCommonPropertiesRedisConfiguration struct {
MaxmemoryDelta *string `json:"maxmemory-delta,omitempty"`
MaxmemoryPolicy *string `json:"maxmemory-policy,omitempty"`
MaxmemoryReserved *string `json:"maxmemory-reserved,omitempty"`
NotifyKeyspaceEvents string `json:"notify-keyspace-events"`
NotifyKeyspaceEvents *string `json:"notify-keyspace-events,omitempty"`
PreferredDataArchiveAuthMethod *string `json:"preferred-data-archive-auth-method,omitempty"`
PreferredDataPersistenceAuthMethod *string `json:"preferred-data-persistence-auth-method,omitempty"`
RdbBackupEnabled *string `json:"rdb-backup-enabled,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,53 @@ import (
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type AssignmentType string

const (
AssignmentTypeCustom AssignmentType = "Custom"
AssignmentTypeNotSpecified AssignmentType = "NotSpecified"
AssignmentTypeSystem AssignmentType = "System"
AssignmentTypeSystemHidden AssignmentType = "SystemHidden"
)

func PossibleValuesForAssignmentType() []string {
return []string{
string(AssignmentTypeCustom),
string(AssignmentTypeNotSpecified),
string(AssignmentTypeSystem),
string(AssignmentTypeSystemHidden),
}
}

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

func parseAssignmentType(input string) (*AssignmentType, error) {
vals := map[string]AssignmentType{
"custom": AssignmentTypeCustom,
"notspecified": AssignmentTypeNotSpecified,
"system": AssignmentTypeSystem,
"systemhidden": AssignmentTypeSystemHidden,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type EnforcementMode string

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ package policyassignments
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type PolicyAssignmentProperties struct {
AssignmentType *AssignmentType `json:"assignmentType,omitempty"`
Description *string `json:"description,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
EnforcementMode *EnforcementMode `json:"enforcementMode,omitempty"`
IsSystemPolicy *bool `json:"isSystemPolicy,omitempty"`
Metadata *interface{} `json:"metadata,omitempty"`
NonComplianceMessages *[]NonComplianceMessage `json:"nonComplianceMessages,omitempty"`
NotScopes *[]string `json:"notScopes,omitempty"`
Expand Down
196 changes: 196 additions & 0 deletions resource-manager/storagecache/2024-03-01/amlfilesystems/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2024-03-01/amlfilesystems` Documentation

The `amlfilesystems` SDK allows for interaction with the Azure Resource Manager Service `storagecache` (API Version `2024-03-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2024-03-01/amlfilesystems"
```


### Client Initialization

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


### Example Usage: `AmlFilesystemsClient.Archive`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

payload := amlfilesystems.AmlFilesystemArchiveInfo{
// ...
}


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


### Example Usage: `AmlFilesystemsClient.CancelArchive`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

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


### Example Usage: `AmlFilesystemsClient.CheckAmlFSSubnets`

```go
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := amlfilesystems.AmlFilesystemSubnetInfo{
// ...
}


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


### Example Usage: `AmlFilesystemsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

payload := amlfilesystems.AmlFilesystem{
// ...
}


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


### Example Usage: `AmlFilesystemsClient.Delete`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

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


### Example Usage: `AmlFilesystemsClient.Get`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

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: `AmlFilesystemsClient.GetRequiredAmlFSSubnetsSize`

```go
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := amlfilesystems.RequiredAmlFilesystemSubnetsSizeInfo{
// ...
}


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


### Example Usage: `AmlFilesystemsClient.List`

```go
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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


### Example Usage: `AmlFilesystemsClient.ListByResourceGroup`

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

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


### Example Usage: `AmlFilesystemsClient.Update`

```go
ctx := context.TODO()
id := amlfilesystems.NewAmlFilesystemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "amlFilesystemValue")

payload := amlfilesystems.AmlFilesystemUpdate{
// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```
26 changes: 26 additions & 0 deletions resource-manager/storagecache/2024-03-01/amlfilesystems/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package amlfilesystems

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

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

type AmlFilesystemsClient struct {
Client *resourcemanager.Client
}

func NewAmlFilesystemsClientWithBaseURI(sdkApi sdkEnv.Api) (*AmlFilesystemsClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "amlfilesystems", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating AmlFilesystemsClient: %+v", err)
}

return &AmlFilesystemsClient{
Client: client,
}, nil
}
Loading

0 comments on commit 2314a83

Please sign in to comment.