diff --git a/sdk/resourcemanager/redis/armredis/CHANGELOG.md b/sdk/resourcemanager/redis/armredis/CHANGELOG.md index 8931855226ef..ad883927f98c 100644 --- a/sdk/resourcemanager/redis/armredis/CHANGELOG.md +++ b/sdk/resourcemanager/redis/armredis/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 3.2.0 (2024-04-16) +### Features Added + +- New field `NotifyKeyspaceEvents` in struct `CommonPropertiesRedisConfiguration` + + ## 3.1.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/redis/armredis/README.md b/sdk/resourcemanager/redis/armredis/README.md index 1f7b05d44447..b2804ad4b545 100644 --- a/sdk/resourcemanager/redis/armredis/README.md +++ b/sdk/resourcemanager/redis/armredis/README.md @@ -57,7 +57,7 @@ clientFactory, err := armredis.NewClientFactory(, cred, &option A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewClient() +client := clientFactory.NewAccessPolicyAssignmentClient() ``` ## Fakes diff --git a/sdk/resourcemanager/redis/armredis/accesspolicy_client_example_test.go b/sdk/resourcemanager/redis/armredis/accesspolicy_client_example_test.go deleted file mode 100644 index 0acd685feed6..000000000000 --- a/sdk/resourcemanager/redis/armredis/accesspolicy_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyCreateUpdate.json -func ExampleAccessPolicyClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessPolicyClient().BeginCreateUpdate(ctx, "rg1", "cache1", "accessPolicy1", armredis.CacheAccessPolicy{ - Properties: &armredis.CacheAccessPolicyProperties{ - Permissions: to.Ptr("+get +hget"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheAccessPolicy = armredis.CacheAccessPolicy{ - // Name: to.Ptr("accessPolicy1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/accessPolicies/accessPolicy1"), - // Properties: &armredis.CacheAccessPolicyProperties{ - // Type: to.Ptr(armredis.AccessPolicyTypeCustom), - // Permissions: to.Ptr("+get +hget"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyDelete.json -func ExampleAccessPolicyClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessPolicyClient().BeginDelete(ctx, "rg1", "cache1", "accessPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyGet.json -func ExampleAccessPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccessPolicyClient().Get(ctx, "rg1", "cache1", "accessPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheAccessPolicy = armredis.CacheAccessPolicy{ - // Name: to.Ptr("accessPolicy1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/accessPolicies/accessPolicy1"), - // Properties: &armredis.CacheAccessPolicyProperties{ - // Type: to.Ptr(armredis.AccessPolicyTypeCustom), - // Permissions: to.Ptr("+get +hget"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyList.json -func ExampleAccessPolicyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccessPolicyClient().NewListPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CacheAccessPolicyList = armredis.CacheAccessPolicyList{ - // Value: []*armredis.CacheAccessPolicy{ - // { - // Name: to.Ptr("accessPolicyBuiltIn"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/accessPolicies/accessPolicyBuiltIn"), - // Properties: &armredis.CacheAccessPolicyProperties{ - // Type: to.Ptr(armredis.AccessPolicyTypeBuiltIn), - // Permissions: to.Ptr("+get +hget"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("accessPolicy1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/accessPolicies/accessPolicy1"), - // Properties: &armredis.CacheAccessPolicyProperties{ - // Type: to.Ptr(armredis.AccessPolicyTypeCustom), - // Permissions: to.Ptr("+get +hget"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client_example_test.go b/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client_example_test.go deleted file mode 100644 index d407e4b99e45..000000000000 --- a/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json -func ExampleAccessPolicyAssignmentClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginCreateUpdate(ctx, "rg1", "cache1", "accessPolicyAssignmentName1", armredis.CacheAccessPolicyAssignment{ - Properties: &armredis.CacheAccessPolicyAssignmentProperties{ - AccessPolicyName: to.Ptr("accessPolicy1"), - ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), - ObjectIDAlias: to.Ptr("TestAADAppRedis"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheAccessPolicyAssignment = armredis.CacheAccessPolicyAssignment{ - // Name: to.Ptr("accessPolicyAssignmentName1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), - // Properties: &armredis.CacheAccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("accessPolicy1"), - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), - // ObjectIDAlias: to.Ptr("TestAADAppRedis"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyAssignmentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyAssignmentDelete.json -func ExampleAccessPolicyAssignmentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginDelete(ctx, "rg1", "cache1", "accessPolicyAssignmentName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyAssignmentGet.json -func ExampleAccessPolicyAssignmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccessPolicyAssignmentClient().Get(ctx, "rg1", "cache1", "accessPolicyAssignmentName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheAccessPolicyAssignment = armredis.CacheAccessPolicyAssignment{ - // Name: to.Ptr("accessPolicyAssignmentName1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), - // Properties: &armredis.CacheAccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("accessPolicy1"), - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), - // ObjectIDAlias: to.Ptr("TestAADAppRedis"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyAssignmentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAccessPolicyAssignmentList.json -func ExampleAccessPolicyAssignmentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccessPolicyAssignmentClient().NewListPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CacheAccessPolicyAssignmentList = armredis.CacheAccessPolicyAssignmentList{ - // Value: []*armredis.CacheAccessPolicyAssignment{ - // { - // Name: to.Ptr("accessPolicyAssignmentName1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), - // Properties: &armredis.CacheAccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("accessPolicy1"), - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), - // ObjectIDAlias: to.Ptr("TestAADAppRedis1"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyAssignmentProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("accessPolicyAssignmentName2"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName2"), - // Properties: &armredis.CacheAccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("accessPolicy2"), - // ObjectID: to.Ptr("7497c918-11ad-41e7-1b0f-7c518a87d0b0"), - // ObjectIDAlias: to.Ptr("TestAADAppRedis2"), - // ProvisioningState: to.Ptr(armredis.AccessPolicyAssignmentProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client_example_test.go b/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client_example_test.go deleted file mode 100644 index 973624d9cbf4..000000000000 --- a/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheAsyncOperationStatus.json -func ExampleAsyncOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAsyncOperationStatusClient().Get(ctx, "East US", "c7ba2bf5-5939-4d79-b037-2964ccf097da", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armredis.OperationStatus{ - // Name: to.Ptr("c7ba2bf5-5939-4d79-b037-2964ccf097da"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Cache/locations/East US/asyncOperations/c7ba2bf5-5939-4d79-b037-2964ccf097da"), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/redis/armredis/autorest.md b/sdk/resourcemanager/redis/armredis/autorest.md index 9454b3479ddd..c1732e543d79 100644 --- a/sdk/resourcemanager/redis/armredis/autorest.md +++ b/sdk/resourcemanager/redis/armredis/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redis/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redis/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.1.0 -tag: package-2023-08 +module-version: 3.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/redis/armredis/client_example_test.go b/sdk/resourcemanager/redis/armredis/client_example_test.go deleted file mode 100644 index 4d398cfb24ec..000000000000 --- a/sdk/resourcemanager/redis/armredis/client_example_test.go +++ /dev/null @@ -1,930 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheCheckNameAvailability.json -func ExampleClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClient().CheckNameAvailability(ctx, armredis.CheckNameAvailabilityParameters{ - Name: to.Ptr("cacheName"), - Type: to.Ptr("Microsoft.Cache/Redis"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheListUpgradeNotifications.json -func ExampleClient_NewListUpgradeNotificationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListUpgradeNotificationsPager("rg1", "cache1", 5000, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NotificationListResponse = armredis.NotificationListResponse{ - // Value: []*armredis.UpgradeNotification{ - // { - // Name: to.Ptr("notification1"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-16T23:20:50.520Z"); return t}()), - // UpsellNotification: map[string]*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheCreate.json -func ExampleClient_BeginCreate_redisCacheCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "rg1", "cache1", armredis.CreateParameters{ - Location: to.Ptr("West US"), - Properties: &armredis.CreateProperties{ - EnableNonSSLPort: to.Ptr(true), - MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - MaxmemoryPolicy: to.Ptr("allkeys-lru"), - }, - RedisVersion: to.Ptr("4"), - ReplicasPerPrimary: to.Ptr[int32](2), - ShardCount: to.Ptr[int32](2), - SKU: &armredis.SKU{ - Name: to.Ptr(armredis.SKUNamePremium), - Capacity: to.Ptr[int32](1), - Family: to.Ptr(armredis.SKUFamilyP), - }, - StaticIP: to.Ptr("192.168.0.5"), - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceInfo = armredis.ResourceInfo{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(false), - // MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // Maxclients: to.Ptr("1000"), - // MaxmemoryDelta: to.Ptr("50"), - // MaxmemoryReserved: to.Ptr("50"), - // }, - // RedisVersion: to.Ptr("4.0.14"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr(armredis.SKUFamilyP), - // }, - // AccessKeys: &armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15000), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15001), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15002), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13003), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15003), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13004), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15004), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13005), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15005), - // Zone: to.Ptr("1"), - // }}, - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheCreateDefaultVersion.json -func ExampleClient_BeginCreate_redisCacheCreateDefaultVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "rg1", "cache1", armredis.CreateParameters{ - Location: to.Ptr("West US"), - Properties: &armredis.CreateProperties{ - EnableNonSSLPort: to.Ptr(true), - MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - MaxmemoryPolicy: to.Ptr("allkeys-lru"), - }, - ReplicasPerPrimary: to.Ptr[int32](2), - ShardCount: to.Ptr[int32](2), - SKU: &armredis.SKU{ - Name: to.Ptr(armredis.SKUNamePremium), - Capacity: to.Ptr[int32](1), - Family: to.Ptr(armredis.SKUFamilyP), - }, - StaticIP: to.Ptr("192.168.0.5"), - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceInfo = armredis.ResourceInfo{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(false), - // MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // Maxclients: to.Ptr("1000"), - // MaxmemoryDelta: to.Ptr("50"), - // MaxmemoryReserved: to.Ptr("50"), - // }, - // RedisVersion: to.Ptr("6.0.14"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr(armredis.SKUFamilyP), - // }, - // AccessKeys: &armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15000), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15001), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15002), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13003), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15003), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13004), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15004), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13005), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15005), - // Zone: to.Ptr("1"), - // }}, - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheCreateLatestVersion.json -func ExampleClient_BeginCreate_redisCacheCreateLatestVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "rg1", "cache1", armredis.CreateParameters{ - Location: to.Ptr("West US"), - Properties: &armredis.CreateProperties{ - EnableNonSSLPort: to.Ptr(true), - MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - MaxmemoryPolicy: to.Ptr("allkeys-lru"), - }, - RedisVersion: to.Ptr("Latest"), - ReplicasPerPrimary: to.Ptr[int32](2), - ShardCount: to.Ptr[int32](2), - SKU: &armredis.SKU{ - Name: to.Ptr(armredis.SKUNamePremium), - Capacity: to.Ptr[int32](1), - Family: to.Ptr(armredis.SKUFamilyP), - }, - StaticIP: to.Ptr("192.168.0.5"), - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceInfo = armredis.ResourceInfo{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(false), - // MinimumTLSVersion: to.Ptr(armredis.TLSVersionOne2), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // Maxclients: to.Ptr("1000"), - // MaxmemoryDelta: to.Ptr("50"), - // MaxmemoryReserved: to.Ptr("50"), - // }, - // RedisVersion: to.Ptr("6.0.14"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr(armredis.SKUFamilyP), - // }, - // AccessKeys: &armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15000), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15001), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // ShardID: to.Ptr[int32](0), - // SSLPort: to.Ptr[int32](15002), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13003), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15003), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13004), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15004), - // Zone: to.Ptr("1"), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13005), - // ShardID: to.Ptr[int32](1), - // SSLPort: to.Ptr[int32](15005), - // Zone: to.Ptr("1"), - // }}, - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheUpdate.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginUpdate(ctx, "rg1", "cache1", armredis.UpdateParameters{ - Properties: &armredis.UpdateProperties{ - EnableNonSSLPort: to.Ptr(true), - ReplicasPerPrimary: to.Ptr[int32](2), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceInfo = armredis.ResourceInfo{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(true), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // Maxclients: to.Ptr("1000"), - // MaxmemoryDelta: to.Ptr("50"), - // MaxmemoryReserved: to.Ptr("50"), - // }, - // RedisVersion: to.Ptr("3.0"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr(armredis.SKUFamilyP), - // }, - // AccessKeys: &armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // SSLPort: to.Ptr[int32](15000), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // SSLPort: to.Ptr[int32](15001), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // SSLPort: to.Ptr[int32](15002), - // }}, - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheDelete.json -func ExampleClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginDelete(ctx, "rg1", "cache1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheGet.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "rg1", "cache1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceInfo = armredis.ResourceInfo{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(true), - // PublicNetworkAccess: to.Ptr(armredis.PublicNetworkAccessEnabled), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // }, - // RedisVersion: to.Ptr("3.2"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNamePremium), - // Capacity: to.Ptr[int32](3), - // Family: to.Ptr(armredis.SKUFamilyP), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // SSLPort: to.Ptr[int32](15000), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // SSLPort: to.Ptr[int32](15001), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // SSLPort: to.Ptr[int32](15002), - // }}, - // LinkedServers: []*armredis.LinkedServer{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/linkedServers/cache2"), - // }}, - // Port: to.Ptr[int32](6379), - // PrivateEndpointConnections: []*armredis.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/privateEndpointConnections/cachePec"), - // Properties: &armredis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/cachePe"), - // }, - // PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Please approve my connection"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheListByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListResult = armredis.ListResult{ - // Value: []*armredis.ResourceInfo{ - // { - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(true), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // }, - // RedisVersion: to.Ptr("3.2"), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNameStandard), - // Capacity: to.Ptr[int32](6), - // Family: to.Ptr(armredis.SKUFamilyC), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheList.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListResult = armredis.ListResult{ - // Value: []*armredis.ResourceInfo{ - // { - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/Redis"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armredis.Properties{ - // EnableNonSSLPort: to.Ptr(true), - // RedisConfiguration: &armredis.CommonPropertiesRedisConfiguration{ - // }, - // RedisVersion: to.Ptr("3.2"), - // ReplicasPerMaster: to.Ptr[int32](2), - // ReplicasPerPrimary: to.Ptr[int32](2), - // UpdateChannel: to.Ptr(armredis.UpdateChannelStable), - // SKU: &armredis.SKU{ - // Name: to.Ptr(armredis.SKUNameStandard), - // Capacity: to.Ptr[int32](6), - // Family: to.Ptr(armredis.SKUFamilyC), - // }, - // HostName: to.Ptr("cache1.redis.cache.windows.net"), - // Instances: []*armredis.InstanceDetails{ - // { - // IsMaster: to.Ptr(true), - // IsPrimary: to.Ptr(true), - // NonSSLPort: to.Ptr[int32](13000), - // SSLPort: to.Ptr[int32](15000), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13001), - // SSLPort: to.Ptr[int32](15001), - // }, - // { - // IsMaster: to.Ptr(false), - // IsPrimary: to.Ptr(false), - // NonSSLPort: to.Ptr[int32](13002), - // SSLPort: to.Ptr[int32](15002), - // }}, - // Port: to.Ptr[int32](6379), - // ProvisioningState: to.Ptr(armredis.ProvisioningStateSucceeded), - // SSLPort: to.Ptr[int32](6380), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheListKeys.json -func ExampleClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListKeys(ctx, "rg1", "cache1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheRegenerateKey.json -func ExampleClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().RegenerateKey(ctx, "rg1", "cache1", armredis.RegenerateKeyParameters{ - KeyType: to.Ptr(armredis.RedisKeyTypePrimary), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armredis.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheForceReboot.json -func ExampleClient_ForceReboot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ForceReboot(ctx, "rg1", "cache1", armredis.RebootParameters{ - Ports: []*int32{ - to.Ptr[int32](13000), - to.Ptr[int32](15001)}, - RebootType: to.Ptr(armredis.RebootTypeAllNodes), - ShardID: to.Ptr[int32](0), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ForceRebootResponse = armredis.ForceRebootResponse{ - // Message: to.Ptr("reboot operation enqueued"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheImport.json -func ExampleClient_BeginImportData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginImportData(ctx, "rg1", "cache1", armredis.ImportRDBParameters{ - Format: to.Ptr("RDB"), - Files: []*string{ - to.Ptr("http://fileuris.contoso.com/pathtofile1")}, - StorageSubscriptionID: to.Ptr("storageSubId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheExport.json -func ExampleClient_BeginExportData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginExportData(ctx, "rg1", "cache1", armredis.ExportRDBParameters{ - Format: to.Ptr("RDB"), - Container: to.Ptr("https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters"), - Prefix: to.Ptr("datadump1"), - StorageSubscriptionID: to.Ptr("storageSubId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheFlush.json -func ExampleClient_BeginFlushCache() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginFlushCache(ctx, "resource-group-name", "cache-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armredis.OperationStatusResult{ - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/redis/armredis/client_factory.go b/sdk/resourcemanager/redis/armredis/client_factory.go index 292b5d224983..431344581e0b 100644 --- a/sdk/resourcemanager/redis/armredis/client_factory.go +++ b/sdk/resourcemanager/redis/armredis/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,72 +26,91 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewAccessPolicyAssignmentClient creates a new instance of AccessPolicyAssignmentClient. func (c *ClientFactory) NewAccessPolicyAssignmentClient() *AccessPolicyAssignmentClient { - subClient, _ := NewAccessPolicyAssignmentClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AccessPolicyAssignmentClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewAccessPolicyClient creates a new instance of AccessPolicyClient. func (c *ClientFactory) NewAccessPolicyClient() *AccessPolicyClient { - subClient, _ := NewAccessPolicyClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AccessPolicyClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewAsyncOperationStatusClient creates a new instance of AsyncOperationStatusClient. func (c *ClientFactory) NewAsyncOperationStatusClient() *AsyncOperationStatusClient { - subClient, _ := NewAsyncOperationStatusClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AsyncOperationStatusClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewClient creates a new instance of Client. func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) - return subClient + return &Client{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFirewallRulesClient creates a new instance of FirewallRulesClient. func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { - subClient, _ := NewFirewallRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FirewallRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLinkedServerClient creates a new instance of LinkedServerClient. func (c *ClientFactory) NewLinkedServerClient() *LinkedServerClient { - subClient, _ := NewLinkedServerClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LinkedServerClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPatchSchedulesClient creates a new instance of PatchSchedulesClient. func (c *ClientFactory) NewPatchSchedulesClient() *PatchSchedulesClient { - subClient, _ := NewPatchSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PatchSchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/redis/armredis/constants.go b/sdk/resourcemanager/redis/armredis/constants.go index 4e6a15c880e1..39a921cfa240 100644 --- a/sdk/resourcemanager/redis/armredis/constants.go +++ b/sdk/resourcemanager/redis/armredis/constants.go @@ -10,7 +10,7 @@ package armredis const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis" - moduleVersion = "v3.1.0" + moduleVersion = "v3.2.0" ) // AccessPolicyAssignmentProvisioningState - Provisioning state of an access policy assignment set diff --git a/sdk/resourcemanager/redis/armredis/fake/time_rfc3339.go b/sdk/resourcemanager/redis/armredis/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/redis/armredis/fake/time_rfc3339.go +++ b/sdk/resourcemanager/redis/armredis/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/redis/armredis/firewallrules_client_example_test.go b/sdk/resourcemanager/redis/armredis/firewallrules_client_example_test.go deleted file mode 100644 index 69ebd31e2528..000000000000 --- a/sdk/resourcemanager/redis/armredis/firewallrules_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheFirewallRulesList.json -func ExampleFirewallRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armredis.FirewallRuleListResult{ - // Value: []*armredis.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Cache/Redis/firewallRules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/firewallRules/rule1"), - // Properties: &armredis.FirewallRuleProperties{ - // EndIP: to.Ptr("192.168.1.4"), - // StartIP: to.Ptr("192.168.1.1"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.Cache/Redis/firewallRules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/firewallRules/rule2"), - // Properties: &armredis.FirewallRuleProperties{ - // EndIP: to.Ptr("192.169.1.255"), - // StartIP: to.Ptr("192.169.1.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheFirewallRuleCreate.json -func ExampleFirewallRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().CreateOrUpdate(ctx, "rg1", "cache1", "rule1", armredis.FirewallRule{ - Properties: &armredis.FirewallRuleProperties{ - EndIP: to.Ptr("192.168.1.4"), - StartIP: to.Ptr("192.168.1.1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armredis.FirewallRule{ - // Name: to.Ptr("cache1/rule1"), - // Type: to.Ptr("Microsoft.Cache/Redis/firewallRules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/firewallRules/rule1"), - // Properties: &armredis.FirewallRuleProperties{ - // EndIP: to.Ptr("192.168.1.4"), - // StartIP: to.Ptr("192.168.1.1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheFirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "rg1", "cache1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armredis.FirewallRule{ - // Name: to.Ptr("cache1/rule1"), - // Type: to.Ptr("Microsoft.Cache/Redis/firewallRules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/firewallRules/rule1"), - // Properties: &armredis.FirewallRuleProperties{ - // EndIP: to.Ptr("192.168.1.4"), - // StartIP: to.Ptr("192.168.1.1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheFirewallRuleDelete.json -func ExampleFirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallRulesClient().Delete(ctx, "rg1", "cache1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/redis/armredis/go.mod b/sdk/resourcemanager/redis/armredis/go.mod index a5e29e182b09..2f620b060e9d 100644 --- a/sdk/resourcemanager/redis/armredis/go.mod +++ b/sdk/resourcemanager/redis/armredis/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect diff --git a/sdk/resourcemanager/redis/armredis/linkedserver_client_example_test.go b/sdk/resourcemanager/redis/armredis/linkedserver_client_example_test.go deleted file mode 100644 index 92499448fd80..000000000000 --- a/sdk/resourcemanager/redis/armredis/linkedserver_client_example_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheLinkedServer_Create.json -func ExampleLinkedServerClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkedServerClient().BeginCreate(ctx, "rg1", "cache1", "cache2", armredis.LinkedServerCreateParameters{ - Properties: &armredis.LinkedServerCreateProperties{ - LinkedRedisCacheID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2"), - LinkedRedisCacheLocation: to.Ptr("West US"), - ServerRole: to.Ptr(armredis.ReplicationRoleSecondary), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedServerWithProperties = armredis.LinkedServerWithProperties{ - // Name: to.Ptr("cache2"), - // Type: to.Ptr("Microsoft.Cache/Redis/linkedServers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/linkedServers/cache2"), - // Properties: &armredis.LinkedServerProperties{ - // GeoReplicatedPrimaryHostName: to.Ptr("cache2.geo.redis.cache.windows.net"), - // LinkedRedisCacheID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2"), - // LinkedRedisCacheLocation: to.Ptr("West US"), - // PrimaryHostName: to.Ptr("cache1.redis.cache.windows.net"), - // ServerRole: to.Ptr(armredis.ReplicationRoleSecondary), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheLinkedServer_Delete.json -func ExampleLinkedServerClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkedServerClient().BeginDelete(ctx, "rg1", "cache1", "cache2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheLinkedServer_Get.json -func ExampleLinkedServerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkedServerClient().Get(ctx, "rg1", "cache1", "cache2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedServerWithProperties = armredis.LinkedServerWithProperties{ - // Name: to.Ptr("cache2"), - // Type: to.Ptr("Microsoft.Cache/Redis/linkedServers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/linkedServers/cache2"), - // Properties: &armredis.LinkedServerProperties{ - // GeoReplicatedPrimaryHostName: to.Ptr("cache2.geo.redis.cache.windows.net"), - // LinkedRedisCacheID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2"), - // LinkedRedisCacheLocation: to.Ptr("West US"), - // PrimaryHostName: to.Ptr("cache1.redis.cache.windows.net"), - // ServerRole: to.Ptr(armredis.ReplicationRoleSecondary), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheLinkedServer_List.json -func ExampleLinkedServerClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkedServerClient().NewListPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkedServerWithPropertiesList = armredis.LinkedServerWithPropertiesList{ - // Value: []*armredis.LinkedServerWithProperties{ - // { - // Name: to.Ptr("cache2"), - // Type: to.Ptr("Microsoft.Cache/Redis/linkedServers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/linkedServers/cache2"), - // Properties: &armredis.LinkedServerProperties{ - // GeoReplicatedPrimaryHostName: to.Ptr("cache2.geo.redis.cache.windows.net"), - // LinkedRedisCacheID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2"), - // LinkedRedisCacheLocation: to.Ptr("West US"), - // PrimaryHostName: to.Ptr("cache1.redis.cache.windows.net"), - // ServerRole: to.Ptr(armredis.ReplicationRoleSecondary), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("cache3"), - // Type: to.Ptr("Microsoft.Cache/Redis/linkedServers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/linkedServers/cache3"), - // Properties: &armredis.LinkedServerProperties{ - // GeoReplicatedPrimaryHostName: to.Ptr("cache3.geo.redis.cache.windows.net"), - // LinkedRedisCacheID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache3"), - // LinkedRedisCacheLocation: to.Ptr("West US"), - // PrimaryHostName: to.Ptr("cache1.redis.cache.windows.net"), - // ServerRole: to.Ptr(armredis.ReplicationRoleSecondary), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/redis/armredis/models.go b/sdk/resourcemanager/redis/armredis/models.go index fa2bfd9265ba..7c292493d165 100644 --- a/sdk/resourcemanager/redis/armredis/models.go +++ b/sdk/resourcemanager/redis/armredis/models.go @@ -137,6 +137,9 @@ type CommonPropertiesRedisConfiguration struct { // Value in megabytes reserved for non-cache usage per shard e.g. failover. MaxmemoryReserved *string + // The keyspace events which should be monitored. + NotifyKeyspaceEvents *string + // Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default // value is SAS PreferredDataPersistenceAuthMethod *string diff --git a/sdk/resourcemanager/redis/armredis/models_serde.go b/sdk/resourcemanager/redis/armredis/models_serde.go index 177eaa2ed4a2..4ee653bef870 100644 --- a/sdk/resourcemanager/redis/armredis/models_serde.go +++ b/sdk/resourcemanager/redis/armredis/models_serde.go @@ -304,6 +304,7 @@ func (c CommonPropertiesRedisConfiguration) MarshalJSON() ([]byte, error) { populate(objectMap, "maxmemory-delta", c.MaxmemoryDelta) populate(objectMap, "maxmemory-policy", c.MaxmemoryPolicy) populate(objectMap, "maxmemory-reserved", c.MaxmemoryReserved) + populate(objectMap, "notify-keyspace-events", c.NotifyKeyspaceEvents) populate(objectMap, "preferred-data-archive-auth-method", c.PreferredDataArchiveAuthMethod) populate(objectMap, "preferred-data-persistence-auth-method", c.PreferredDataPersistenceAuthMethod) populate(objectMap, "rdb-backup-enabled", c.RdbBackupEnabled) @@ -359,6 +360,9 @@ func (c *CommonPropertiesRedisConfiguration) UnmarshalJSON(data []byte) error { case "maxmemory-reserved": err = unpopulate(val, "MaxmemoryReserved", &c.MaxmemoryReserved) delete(rawMsg, key) + case "notify-keyspace-events": + err = unpopulate(val, "NotifyKeyspaceEvents", &c.NotifyKeyspaceEvents) + delete(rawMsg, key) case "preferred-data-archive-auth-method": err = unpopulate(val, "PreferredDataArchiveAuthMethod", &c.PreferredDataArchiveAuthMethod) delete(rawMsg, key) @@ -2228,7 +2232,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/redis/armredis/operations_client_example_test.go b/sdk/resourcemanager/redis/armredis/operations_client_example_test.go deleted file mode 100644 index 579d8df950ef..000000000000 --- a/sdk/resourcemanager/redis/armredis/operations_client_example_test.go +++ /dev/null @@ -1,668 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armredis.OperationListResult{ - // Value: []*armredis.Operation{ - // { - // Name: to.Ptr("Microsoft.Cache/checknameavailability/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Checks if a name is available for use with a new Redis Cache"), - // Operation: to.Ptr("Check Cache Name Availability"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/register/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Registers the 'Microsoft.Cache' resource provider with a subscription"), - // Operation: to.Ptr("Register Resource Provider Microsoft.Cache"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/unregister/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Unregisters the 'Microsoft.Cache' resource provider with a subscription"), - // Operation: to.Ptr("Unregister Resource Provider Microsoft.Cache"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/operations/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Lists the operations that 'Microsoft.Cache' provider supports."), - // Operation: to.Ptr("List Provider Operations"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/locations/operationResults/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Gets the result of a long running operation for which the 'Location' header was previously returned to the client"), - // Operation: to.Ptr("Read operation results"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/locations/operationsStatus/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the status of a long running operation for which the 'AzureAsync' header was previously returned to the client"), - // Operation: to.Ptr("Read the status of a long running operation"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/locations/asyncOperations/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read an Async Operation's Status"), - // Operation: to.Ptr("Read asynchronous operation status"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/locations/checknameavailability/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Checks if a name is available for use with a new Redis Enterprise cache"), - // Operation: to.Ptr("Check Cache Name Availability in location"), - // Provider: to.Ptr("Microsoft Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Modify the Redis Cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Cache (read-write)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the Redis Cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Cache (read-only)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete the entire Redis Cache"), - // Operation: to.Ptr("Delete Redis Cache"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/listKeys/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the value of Redis Cache access keys in the management portal"), - // Operation: to.Ptr("View Redis Cache Access Keys"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/regenerateKey/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Change the value of Redis Cache access keys in the management portal"), - // Operation: to.Ptr("Regenerate Redis Cache Access Keys"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/import/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Import data of a specified format from multiple blobs into Redis"), - // Operation: to.Ptr("Import data into Redis from storage"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/export/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Export Redis data to prefixed storage blobs in specified format"), - // Operation: to.Ptr("Export Redis data to storage"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/forceReboot/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Force reboot a cache instance, potentially with data loss."), - // Operation: to.Ptr("Force reboot a cache instance, potentially with data loss."), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/stop/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Stop an Azure Cache for Redis, potentially with data loss."), - // Operation: to.Ptr("Stop an Azure Cache for Redis, potentially with data loss."), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/start/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Start an Azure Cache for Redis"), - // Operation: to.Ptr("Start an Azure Cache for Redis"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete the entire Redis Enterprise cache"), - // Operation: to.Ptr("Delete Redis Enterprise cache"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the Redis Enterprise cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache (read)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Modify the Redis Enterprise cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache (write)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Deletes a Redis Enterprise database and its contents"), - // Operation: to.Ptr("Delete Redis Enterprise database"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the Redis Enterprise cache database's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache database (read)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Modify the Redis Enterprise cache database's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache database (write)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/export/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Export data to storage blobs from a Redis Enterprise database "), - // Operation: to.Ptr("Export Redis Enterprise database"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/forceUnlink/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Forcibly unlink a georeplica Redis Enterprise database from its peers"), - // Operation: to.Ptr("Force unlink Redis Enterprise database georeplica"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/import/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Import data from storage blobs to a Redis Enterprise database"), - // Operation: to.Ptr("Import Redis Enterprise database"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/listKeys/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the value of Redis Enterprise database access keys in the management portal"), - // Operation: to.Ptr("View Redis Enterprise database access keys"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/regenerateKey/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Change the value of Redis Enterprise database access keys in the management portal"), - // Operation: to.Ptr("Regenerate Redis Enterprise database access keys"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache database"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/databases/operationResults/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the result of Redis Enterprise database operations in the management portal"), - // Operation: to.Ptr("View Redis Enterprise database operation results"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise database operation results"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/operationResults/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the result of Redis Enterprise operations in the management portal"), - // Operation: to.Ptr("View Redis Enterprise operation results"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise operation results"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/metricDefinitions/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for a Redis Cache"), - // Operation: to.Ptr("Read Redis Cache Metric Definitions"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("The available metrics for a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for a Redis Enterprise Cache"), - // Operation: to.Ptr("Read Redis Enterprise Metric Definitions"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("The available metrics for a Redis Enterprise Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/patchSchedules/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Gets the patching schedule of a Redis Cache"), - // Operation: to.Ptr("Get Redis Cache Patch Schedule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Patching schedule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/patchSchedules/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Modify the patching schedule of a Redis Cache"), - // Operation: to.Ptr("Change Redis Patching Schedule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Patching schedule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/patchSchedules/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete the patch schedule of a Redis Cache"), - // Operation: to.Ptr("Delete Redis Cache Patch Schedule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Patching schedule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/firewallRules/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Get the IP firewall rules of a Redis Cache"), - // Operation: to.Ptr("Get Redis Cache Firewall Rule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("IP firewall rule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/firewallRules/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Edit the IP firewall rules of a Redis Cache"), - // Operation: to.Ptr("Update Redis Cache Firewall Rule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("IP firewall rule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/firewallRules/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete IP firewall rules of a Redis Cache"), - // Operation: to.Ptr("Delete Redis Cache Firewall Rule"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("IP firewall rule of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/linkedServers/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Get Linked Servers associated with a redis cache."), - // Operation: to.Ptr("Get Redis Cache Linked Servers"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Linked Servers of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/linkedServers/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Add Linked Server to a Redis Cache"), - // Operation: to.Ptr("Add Redis Cache Linked Server"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Linked Servers of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/linkedServers/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete Linked Server from a Redis Cache"), - // Operation: to.Ptr("Delete Redis Cache Linked Server"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Linked Servers of a Redis Cache"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/eventGridFilters/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Get Redis Cache Event Grid Filter"), - // Operation: to.Ptr("Get Redis Cache Event Grid Filter"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache Event Grid Filter"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/eventGridFilters/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Update Redis Cache Event Grid Filters"), - // Operation: to.Ptr("Update Redis Cache Event Grid Filters"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache Event Grid Filter"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/eventGridFilters/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete Redis Cache Event Grid Filters"), - // Operation: to.Ptr("Delete Redis Cache Event Grid Filters"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Cache Event Grid Filter"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnectionProxies/validate/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Validate the private endpoint connection proxy"), - // Operation: to.Ptr("Validate private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnectionProxies/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Get the private endpoint connection proxy"), - // Operation: to.Ptr("Get private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnectionProxies/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Create the private endpoint connection proxy"), - // Operation: to.Ptr("Create private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnectionProxies/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete the private endpoint connection proxy"), - // Operation: to.Ptr("Delete private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnectionProxies/validate/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Validate the private endpoint connection proxy"), - // Operation: to.Ptr("Validate private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnectionProxies/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Get the private endpoint connection proxy"), - // Operation: to.Ptr("Get private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnectionProxies/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Create the private endpoint connection proxy"), - // Operation: to.Ptr("Create private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnectionProxies/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete the private endpoint connection proxy"), - // Operation: to.Ptr("Delete private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnectionProxies/operationResults/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("View the result of private endpoint connection operations in the management portal"), - // Operation: to.Ptr("Redis Enterprise cache private endpoint operation results (read)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise private endpoint connection proxies"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnections/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read a private endpoint connection"), - // Operation: to.Ptr("Read private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnections/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Write a private endpoint connection"), - // Operation: to.Ptr("Write private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateEndpointConnections/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete a private endpoint connection"), - // Operation: to.Ptr("Delete private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read a private endpoint connection"), - // Operation: to.Ptr("Read private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Write a private endpoint connection"), - // Operation: to.Ptr("Write private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete a private endpoint connection"), - // Operation: to.Ptr("Delete private endpoint connection"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache private endpoint connections"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/privateLinkResources/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read 'groupId' of redis subresource that a private link can be connected to"), - // Operation: to.Ptr("Read Private Linkable Resources"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private linkable resources"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/privateLinkResources/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read 'groupId' of redis subresource that a private link can be connected to"), - // Operation: to.Ptr("Read Private Linkable Resources"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache private link resources"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roles/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read roles on a Redis Cache"), - // Operation: to.Ptr("Read Redis Roles"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Roles"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roles/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Create or update role on a Redis Cache"), - // Operation: to.Ptr("Update Redis Roles"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Roles"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roles/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete role on a Redis Cache"), - // Operation: to.Ptr("Delete Redis Roles"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Roles"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roleAssignments/read"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Read role assignments on a Redis Cache"), - // Operation: to.Ptr("Read Redis Role Assignments"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Role Description"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roleAssignments/write"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Create or update role assignments on a Redis Cache"), - // Operation: to.Ptr("Update Redis Role Assignments"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Role Description"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/roleAssignments/delete"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Delete All Redis Role Assignments"), - // Operation: to.Ptr("Delete Redis Role Assignment"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis Role Description"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redis/PrivateEndpointConnectionsApproval/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Approve Private Endpoint Connections"), - // Operation: to.Ptr("Approve Private Endpoint Connections"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Azure Cache for Redis private linkable resources"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/PrivateEndpointConnectionsApproval/action"), - // Display: &armredis.OperationDisplay{ - // Description: to.Ptr("Approve Private Endpoint Connections"), - // Operation: to.Ptr("Approve Private Endpoint Connections"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache private link resources"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/redis/armredis/patchschedules_client_example_test.go b/sdk/resourcemanager/redis/armredis/patchschedules_client_example_test.go deleted file mode 100644 index 8f54f0bcca3e..000000000000 --- a/sdk/resourcemanager/redis/armredis/patchschedules_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCachePatchSchedulesList.json -func ExamplePatchSchedulesClient_NewListByRedisResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPatchSchedulesClient().NewListByRedisResourcePager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PatchScheduleListResult = armredis.PatchScheduleListResult{ - // Value: []*armredis.PatchSchedule{ - // { - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/Redis/PatchSchedules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/patchSchedules/default"), - // Location: to.Ptr("East US"), - // Properties: &armredis.ScheduleEntries{ - // ScheduleEntries: []*armredis.ScheduleEntry{ - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekMonday), - // MaintenanceWindow: to.Ptr("PT5H"), - // StartHourUTC: to.Ptr[int32](12), - // }, - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekTuesday), - // StartHourUTC: to.Ptr[int32](12), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json -func ExamplePatchSchedulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPatchSchedulesClient().CreateOrUpdate(ctx, "rg1", "cache1", armredis.DefaultNameDefault, armredis.PatchSchedule{ - Properties: &armredis.ScheduleEntries{ - ScheduleEntries: []*armredis.ScheduleEntry{ - { - DayOfWeek: to.Ptr(armredis.DayOfWeekMonday), - MaintenanceWindow: to.Ptr("PT5H"), - StartHourUTC: to.Ptr[int32](12), - }, - { - DayOfWeek: to.Ptr(armredis.DayOfWeekTuesday), - StartHourUTC: to.Ptr[int32](12), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PatchSchedule = armredis.PatchSchedule{ - // Name: to.Ptr("cachename1/default"), - // Type: to.Ptr("Microsoft.Cache/Redis/PatchSchedules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/patchSchedules/default"), - // Location: to.Ptr("East US"), - // Properties: &armredis.ScheduleEntries{ - // ScheduleEntries: []*armredis.ScheduleEntry{ - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekMonday), - // MaintenanceWindow: to.Ptr("PT5H"), - // StartHourUTC: to.Ptr[int32](12), - // }, - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekTuesday), - // StartHourUTC: to.Ptr[int32](12), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCachePatchSchedulesDelete.json -func ExamplePatchSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPatchSchedulesClient().Delete(ctx, "rg1", "cache1", armredis.DefaultNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCachePatchSchedulesGet.json -func ExamplePatchSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPatchSchedulesClient().Get(ctx, "rg1", "cache1", armredis.DefaultNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PatchSchedule = armredis.PatchSchedule{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/Redis/PatchSchedules"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/patchSchedules/default"), - // Location: to.Ptr("East US"), - // Properties: &armredis.ScheduleEntries{ - // ScheduleEntries: []*armredis.ScheduleEntry{ - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekMonday), - // MaintenanceWindow: to.Ptr("PT5H"), - // StartHourUTC: to.Ptr[int32](12), - // }, - // { - // DayOfWeek: to.Ptr(armredis.DayOfWeekTuesday), - // StartHourUTC: to.Ptr[int32](12), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/redis/armredis/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/redis/armredis/privateendpointconnections_client_example_test.go deleted file mode 100644 index ab10a6c101cd..000000000000 --- a/sdk/resourcemanager/redis/armredis/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("rgtest01", "cachetest01", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armredis.PrivateEndpointConnectionListResult{ - // Value: []*armredis.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/Redis/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Cache/Redis/cachetest01/privateEndpointConnections/pectest01"), - // Properties: &armredis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/Redis/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Cache/Redis/cachetest01/privateEndpointConnections/pectest01"), - // Properties: &armredis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheGetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rgtest01", "cachetest01", "pectest01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armredis.PrivateEndpointConnection{ - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/Redis/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Cache/Redis/cachetest01/privateEndpointConnections/pectest01"), - // Properties: &armredis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCachePutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginPut(ctx, "rgtest01", "cachetest01", "pectest01", armredis.PrivateEndpointConnection{ - Properties: &armredis.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armredis.PrivateEndpointConnection{ - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/Redis/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Cache/Redis/cachetest01/privateEndpointConnections/pectest01"), - // Properties: &armredis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgtest01/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheDeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "rgtest01", "cachetest01", "pectest01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/redis/armredis/privatelinkresources_client_example_test.go b/sdk/resourcemanager/redis/armredis/privatelinkresources_client_example_test.go deleted file mode 100644 index bb7f2bd2ef63..000000000000 --- a/sdk/resourcemanager/redis/armredis/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armredis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/redis/resource-manager/Microsoft.Cache/stable/2023-08-01/examples/RedisCacheListPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_NewListByRedisCachePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByRedisCachePager("rgtest01", "cacheTest01", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armredis.PrivateLinkResourceListResult{ - // Value: []*armredis.PrivateLinkResource{ - // { - // Name: to.Ptr("redisCache"), - // Type: to.Ptr("Microsoft.Cache/Redis/privateLinkResources"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgtest01/providers/Microsoft.Cache/Redis/cacheTest01/privateLinkResources/redisCache"), - // Properties: &armredis.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("redisCache"), - // RequiredMembers: []*string{ - // to.Ptr("redisCache")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.redis.cache.windows.net")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/redis/armredis/response_types.go b/sdk/resourcemanager/redis/armredis/responses.go similarity index 100% rename from sdk/resourcemanager/redis/armredis/response_types.go rename to sdk/resourcemanager/redis/armredis/responses.go diff --git a/sdk/resourcemanager/redis/armredis/time_rfc3339.go b/sdk/resourcemanager/redis/armredis/time_rfc3339.go index a32591921c90..5546cf9316dc 100644 --- a/sdk/resourcemanager/redis/armredis/time_rfc3339.go +++ b/sdk/resourcemanager/redis/armredis/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339