From 2ee1eeffffacb1605688a9db5672bdf4cb4d5523 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 21 Apr 2023 06:38:10 +0000 Subject: [PATCH] CodeGen from PR 23406 in Azure/azure-rest-api-specs Merge 036139db81d355316cd2346f3e0a5efd22f52c2e into ae5f241249f12e87e94e184ae5430518ac061a51 --- .../redis/armredis/CHANGELOG.md | 28 + .../redis/armredis/accesspolicy_client.go | 319 +++++++ .../armredis/accesspolicyassignment_client.go | 321 +++++++ .../armredis/asyncoperationstatus_client.go | 7 +- ...syncoperationstatus_client_example_test.go | 43 - .../redis/armredis/autorest.md | 6 +- sdk/resourcemanager/redis/armredis/client.go | 87 +- .../redis/armredis/client_example_test.go | 895 ------------------ .../redis/armredis/client_factory.go | 13 +- .../redis/armredis/constants.go | 66 +- .../redis/armredis/firewallrules_client.go | 27 +- .../firewallrules_client_example_test.go | 145 --- sdk/resourcemanager/redis/armredis/go.mod | 2 +- .../redis/armredis/linkedserver_client.go | 31 +- .../linkedserver_client_example_test.go | 170 ---- sdk/resourcemanager/redis/armredis/models.go | 128 +++ .../redis/armredis/models_serde.go | 241 +++++ .../redis/armredis/operations_client.go | 4 +- .../operations_client_example_test.go | 668 ------------- .../redis/armredis/patchschedules_client.go | 27 +- .../patchschedules_client_example_test.go | 171 ---- .../privateendpointconnections_client.go | 29 +- ...endpointconnections_client_example_test.go | 179 ---- .../armredis/privatelinkresources_client.go | 9 +- ...rivatelinkresources_client_example_test.go | 58 -- .../redis/armredis/response_types.go | 40 + 26 files changed, 1264 insertions(+), 2450 deletions(-) create mode 100644 sdk/resourcemanager/redis/armredis/accesspolicy_client.go create mode 100644 sdk/resourcemanager/redis/armredis/accesspolicyassignment_client.go delete mode 100644 sdk/resourcemanager/redis/armredis/asyncoperationstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/firewallrules_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/linkedserver_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/patchschedules_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/redis/armredis/privatelinkresources_client_example_test.go diff --git a/sdk/resourcemanager/redis/armredis/CHANGELOG.md b/sdk/resourcemanager/redis/armredis/CHANGELOG.md index 5ddeebc326e1..a9086a82d3a3 100644 --- a/sdk/resourcemanager/redis/armredis/CHANGELOG.md +++ b/sdk/resourcemanager/redis/armredis/CHANGELOG.md @@ -1,5 +1,33 @@ # Release History +## 2.3.0 (2023-04-21) +### Features Added + +- New enum type `AccessPolicyAssignmentProvisioningState` with values `AccessPolicyAssignmentProvisioningStateCanceled`, `AccessPolicyAssignmentProvisioningStateDeleted`, `AccessPolicyAssignmentProvisioningStateDeleting`, `AccessPolicyAssignmentProvisioningStateFailed`, `AccessPolicyAssignmentProvisioningStateSucceeded`, `AccessPolicyAssignmentProvisioningStateUpdating` +- New enum type `AccessPolicyProvisioningState` with values `AccessPolicyProvisioningStateCanceled`, `AccessPolicyProvisioningStateDeleted`, `AccessPolicyProvisioningStateDeleting`, `AccessPolicyProvisioningStateFailed`, `AccessPolicyProvisioningStateSucceeded`, `AccessPolicyProvisioningStateUpdating` +- New enum type `AccessPolicyType` with values `AccessPolicyTypeBuiltIn`, `AccessPolicyTypeCustom` +- New function `NewAccessPolicyAssignmentClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AccessPolicyAssignmentClient, error)` +- New function `*AccessPolicyAssignmentClient.BeginCreateUpdate(context.Context, string, string, string, CacheAccessPolicyAssignmentSet, *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyAssignmentClientCreateUpdateResponse], error)` +- New function `*AccessPolicyAssignmentClient.BeginDelete(context.Context, string, string, string, *AccessPolicyAssignmentClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyAssignmentClientDeleteResponse], error)` +- New function `*AccessPolicyAssignmentClient.Get(context.Context, string, string, string, *AccessPolicyAssignmentClientGetOptions) (AccessPolicyAssignmentClientGetResponse, error)` +- New function `*AccessPolicyAssignmentClient.NewListPager(string, string, *AccessPolicyAssignmentClientListOptions) *runtime.Pager[AccessPolicyAssignmentClientListResponse]` +- New function `NewAccessPolicyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AccessPolicyClient, error)` +- New function `*AccessPolicyClient.BeginCreateUpdate(context.Context, string, string, string, CacheAccessPolicy, *AccessPolicyClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyClientCreateUpdateResponse], error)` +- New function `*AccessPolicyClient.BeginDelete(context.Context, string, string, string, *AccessPolicyClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyClientDeleteResponse], error)` +- New function `*AccessPolicyClient.Get(context.Context, string, string, string, *AccessPolicyClientGetOptions) (AccessPolicyClientGetResponse, error)` +- New function `*AccessPolicyClient.NewListPager(string, string, *AccessPolicyClientListOptions) *runtime.Pager[AccessPolicyClientListResponse]` +- New function `*ClientFactory.NewAccessPolicyAssignmentClient() *AccessPolicyAssignmentClient` +- New function `*ClientFactory.NewAccessPolicyClient() *AccessPolicyClient` +- New struct `CacheAccessPolicy` +- New struct `CacheAccessPolicyAssignment` +- New struct `CacheAccessPolicyAssignmentList` +- New struct `CacheAccessPolicyAssignmentSet` +- New struct `CacheAccessPolicyAssignmentSetProperties` +- New struct `CacheAccessPolicyList` +- New struct `CacheAccessPolicyProperties` +- New field `AADEnabled` in struct `CommonPropertiesRedisConfiguration` + + ## 2.2.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/redis/armredis/accesspolicy_client.go b/sdk/resourcemanager/redis/armredis/accesspolicy_client.go new file mode 100644 index 000000000000..0264ef7c15c2 --- /dev/null +++ b/sdk/resourcemanager/redis/armredis/accesspolicy_client.go @@ -0,0 +1,319 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AccessPolicyClient contains the methods for the AccessPolicy group. +// Don't use this type directly, use NewAccessPolicyClient() instead. +type AccessPolicyClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAccessPolicyClient creates a new instance of AccessPolicyClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAccessPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccessPolicyClient, error) { + cl, err := arm.NewClient(moduleName+".AccessPolicyClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AccessPolicyClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateUpdate - Adds an access policy to the redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the access policy that is being added to the Redis cache. +// - parameters - Parameters supplied to the Create Update Access Policy operation. +// - options - AccessPolicyClientBeginCreateUpdateOptions contains the optional parameters for the AccessPolicyClient.BeginCreateUpdate +// method. +func (client *AccessPolicyClient) BeginCreateUpdate(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicy, options *AccessPolicyClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyClientCreateUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdate(ctx, resourceGroupName, cacheName, accessPolicyName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[AccessPolicyClientCreateUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[AccessPolicyClientCreateUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateUpdate - Adds an access policy to the redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccessPolicyClient) createUpdate(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicy, options *AccessPolicyClientBeginCreateUpdateOptions) (*http.Response, error) { + req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateCreateRequest creates the CreateUpdate request. +func (client *AccessPolicyClient) createUpdateCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicy, options *AccessPolicyClientBeginCreateUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the access policy from a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the access policy that is being deleted from the Redis cache. +// - options - AccessPolicyClientBeginDeleteOptions contains the optional parameters for the AccessPolicyClient.BeginDelete +// method. +func (client *AccessPolicyClient) BeginDelete(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessPolicyClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessPolicyClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the access policy from a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccessPolicyClient) deleteOperation(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AccessPolicyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the detailed information about an access policy of a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the access policy that is being deleted from the Redis cache. +// - options - AccessPolicyClientGetOptions contains the optional parameters for the AccessPolicyClient.Get method. +func (client *AccessPolicyClient) Get(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyClientGetOptions) (AccessPolicyClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return AccessPolicyClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccessPolicyClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccessPolicyClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AccessPolicyClient) getCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AccessPolicyClient) getHandleResponse(resp *http.Response) (AccessPolicyClientGetResponse, error) { + result := AccessPolicyClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CacheAccessPolicy); err != nil { + return AccessPolicyClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the list of access policies associated with this redis cache +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - options - AccessPolicyClientListOptions contains the optional parameters for the AccessPolicyClient.NewListPager method. +func (client *AccessPolicyClient) NewListPager(resourceGroupName string, cacheName string, options *AccessPolicyClientListOptions) *runtime.Pager[AccessPolicyClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AccessPolicyClientListResponse]{ + More: func(page AccessPolicyClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccessPolicyClientListResponse) (AccessPolicyClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, cacheName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AccessPolicyClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccessPolicyClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccessPolicyClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AccessPolicyClient) listCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, options *AccessPolicyClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AccessPolicyClient) listHandleResponse(resp *http.Response) (AccessPolicyClientListResponse, error) { + result := AccessPolicyClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CacheAccessPolicyList); err != nil { + return AccessPolicyClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client.go b/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client.go new file mode 100644 index 000000000000..9d04f3810ba9 --- /dev/null +++ b/sdk/resourcemanager/redis/armredis/accesspolicyassignment_client.go @@ -0,0 +1,321 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AccessPolicyAssignmentClient contains the methods for the AccessPolicyAssignment group. +// Don't use this type directly, use NewAccessPolicyAssignmentClient() instead. +type AccessPolicyAssignmentClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAccessPolicyAssignmentClient creates a new instance of AccessPolicyAssignmentClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAccessPolicyAssignmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccessPolicyAssignmentClient, error) { + cl, err := arm.NewClient(moduleName+".AccessPolicyAssignmentClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AccessPolicyAssignmentClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateUpdate - Adds the access policy assignment to the specified users +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the access policy to assign. +// - parameters - Parameters supplied to the Create Update Access Policy Assignment operation. +// - options - AccessPolicyAssignmentClientBeginCreateUpdateOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginCreateUpdate +// method. +func (client *AccessPolicyAssignmentClient) BeginCreateUpdate(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicyAssignmentSet, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyAssignmentClientCreateUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdate(ctx, resourceGroupName, cacheName, accessPolicyName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[AccessPolicyAssignmentClientCreateUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[AccessPolicyAssignmentClientCreateUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateUpdate - Adds the access policy assignment to the specified users +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccessPolicyAssignmentClient) createUpdate(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicyAssignmentSet, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*http.Response, error) { + req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateCreateRequest creates the CreateUpdate request. +func (client *AccessPolicyAssignmentClient) createUpdateCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, parameters CacheAccessPolicyAssignmentSet, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the access policy assignment from a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the access policy being unassigned. +// - options - AccessPolicyAssignmentClientBeginDeleteOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginDelete +// method. +func (client *AccessPolicyAssignmentClient) BeginDelete(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyAssignmentClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessPolicyAssignmentClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessPolicyAssignmentClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the access policy assignment from a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccessPolicyAssignmentClient) deleteOperation(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AccessPolicyAssignmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the list of assignments for an access policy of a redis cache +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - accessPolicyName - The name of the assigned access policy. +// - options - AccessPolicyAssignmentClientGetOptions contains the optional parameters for the AccessPolicyAssignmentClient.Get +// method. +func (client *AccessPolicyAssignmentClient) Get(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyAssignmentClientGetOptions) (AccessPolicyAssignmentClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, cacheName, accessPolicyName, options) + if err != nil { + return AccessPolicyAssignmentClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccessPolicyAssignmentClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccessPolicyAssignmentClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AccessPolicyAssignmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, accessPolicyName string, options *AccessPolicyAssignmentClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if accessPolicyName == "" { + return nil, errors.New("parameter accessPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessPolicyName}", url.PathEscape(accessPolicyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AccessPolicyAssignmentClient) getHandleResponse(resp *http.Response) (AccessPolicyAssignmentClientGetResponse, error) { + result := AccessPolicyAssignmentClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CacheAccessPolicyAssignmentSet); err != nil { + return AccessPolicyAssignmentClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the list of access policy assignments associated with this redis cache +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - cacheName - The name of the Redis cache. +// - options - AccessPolicyAssignmentClientListOptions contains the optional parameters for the AccessPolicyAssignmentClient.NewListPager +// method. +func (client *AccessPolicyAssignmentClient) NewListPager(resourceGroupName string, cacheName string, options *AccessPolicyAssignmentClientListOptions) *runtime.Pager[AccessPolicyAssignmentClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AccessPolicyAssignmentClientListResponse]{ + More: func(page AccessPolicyAssignmentClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccessPolicyAssignmentClientListResponse) (AccessPolicyAssignmentClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, cacheName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AccessPolicyAssignmentClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccessPolicyAssignmentClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccessPolicyAssignmentClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AccessPolicyAssignmentClient) listCreateRequest(ctx context.Context, resourceGroupName string, cacheName string, options *AccessPolicyAssignmentClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cacheName == "" { + return nil, errors.New("parameter cacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cacheName}", url.PathEscape(cacheName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AccessPolicyAssignmentClient) listHandleResponse(resp *http.Response) (AccessPolicyAssignmentClientListResponse, error) { + result := AccessPolicyAssignmentClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CacheAccessPolicyAssignmentList); err != nil { + return AccessPolicyAssignmentClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client.go b/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client.go index 2c2f89c0fe68..b7e96b8ce4de 100644 --- a/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client.go +++ b/sdk/resourcemanager/redis/armredis/asyncoperationstatus_client.go @@ -29,8 +29,7 @@ type AsyncOperationStatusClient struct { } // NewAsyncOperationStatusClient creates a new instance of AsyncOperationStatusClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAsyncOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AsyncOperationStatusClient, error) { @@ -48,7 +47,7 @@ func NewAsyncOperationStatusClient(subscriptionID string, credential azcore.Toke // Get - For checking the ongoing status of an operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 // - location - The location at which operation was triggered // - operationID - The ID of asynchronous operation // - options - AsyncOperationStatusClientGetOptions contains the optional parameters for the AsyncOperationStatusClient.Get @@ -88,7 +87,7 @@ func (client *AsyncOperationStatusClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 f2fed4e56b92..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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 db808813f5cd..6065249820ff 100644 --- a/sdk/resourcemanager/redis/armredis/autorest.md +++ b/sdk/resourcemanager/redis/armredis/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/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: 2.2.1 +module-version: 2.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/redis/armredis/client.go b/sdk/resourcemanager/redis/armredis/client.go index 647ae2cbc57a..8d853daee243 100644 --- a/sdk/resourcemanager/redis/armredis/client.go +++ b/sdk/resourcemanager/redis/armredis/client.go @@ -30,8 +30,7 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { @@ -49,7 +48,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckNameAvailability - Checks that the redis cache name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 // - parameters - Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis' // - options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. func (client *Client) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityParameters, options *ClientCheckNameAvailabilityOptions) (ClientCheckNameAvailabilityResponse, error) { @@ -79,7 +78,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, pa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -88,8 +87,8 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, pa // BeginCreate - Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Parameters supplied to the Create Redis operation. // - options - ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method. @@ -108,7 +107,7 @@ func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, // Create - Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *Client) create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters, options *ClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -144,7 +143,7 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -153,8 +152,8 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName // BeginDelete - Deletes a Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, name string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error) { @@ -172,7 +171,7 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, // Delete - Deletes a Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *ClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) if err != nil { @@ -208,7 +207,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,8 +216,8 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // BeginExportData - Export data from the redis cache to blobs in a container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Parameters for Redis export operation. // - options - ClientBeginExportDataOptions contains the optional parameters for the Client.BeginExportData method. @@ -237,7 +236,7 @@ func (client *Client) BeginExportData(ctx context.Context, resourceGroupName str // ExportData - Export data from the redis cache to blobs in a container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *Client) exportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters, options *ClientBeginExportDataOptions) (*http.Response, error) { req, err := client.exportDataCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -273,7 +272,7 @@ func (client *Client) exportDataCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -283,8 +282,8 @@ func (client *Client) exportDataCreateRequest(ctx context.Context, resourceGroup // be potential data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Specifies which Redis node(s) to reboot. // - options - ClientForceRebootOptions contains the optional parameters for the Client.ForceReboot method. @@ -323,7 +322,7 @@ func (client *Client) forceRebootCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -341,8 +340,8 @@ func (client *Client) forceRebootHandleResponse(resp *http.Response) (ClientForc // Get - Gets a Redis cache (resource description). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, name string, options *ClientGetOptions) (ClientGetResponse, error) { @@ -380,7 +379,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,8 +397,8 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // BeginImportData - Import data into Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Parameters for Redis import operation. // - options - ClientBeginImportDataOptions contains the optional parameters for the Client.BeginImportData method. @@ -418,7 +417,7 @@ func (client *Client) BeginImportData(ctx context.Context, resourceGroupName str // ImportData - Import data into Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *Client) importData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters, options *ClientBeginImportDataOptions) (*http.Response, error) { req, err := client.importDataCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -454,7 +453,7 @@ func (client *Client) importDataCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -462,8 +461,8 @@ func (client *Client) importDataCreateRequest(ctx context.Context, resourceGroup // NewListByResourceGroupPager - Lists all Redis caches in a resource group. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse] { @@ -510,7 +509,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -527,7 +526,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // NewListBySubscriptionPager - Gets all Redis caches in the specified subscription. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 // - options - ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListBySubscriptionResponse]{ @@ -569,7 +568,7 @@ func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -587,8 +586,8 @@ func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (Cli // ListKeys - Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - options - ClientListKeysOptions contains the optional parameters for the Client.ListKeys method. func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, name string, options *ClientListKeysOptions) (ClientListKeysResponse, error) { @@ -626,7 +625,7 @@ func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -643,8 +642,8 @@ func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKey // NewListUpgradeNotificationsPager - Gets any upgrade notifications for a Redis cache. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - history - how many minutes in past to look for upgrade notifications // - options - ClientListUpgradeNotificationsOptions contains the optional parameters for the Client.NewListUpgradeNotificationsPager @@ -697,7 +696,7 @@ func (client *Client) listUpgradeNotificationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") reqQP.Set("history", strconv.FormatFloat(history, 'f', -1, 64)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -716,8 +715,8 @@ func (client *Client) listUpgradeNotificationsHandleResponse(resp *http.Response // RegenerateKey - Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Specifies which key to regenerate. // - options - ClientRegenerateKeyOptions contains the optional parameters for the Client.RegenerateKey method. @@ -756,7 +755,7 @@ func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -774,8 +773,8 @@ func (client *Client) regenerateKeyHandleResponse(resp *http.Response) (ClientRe // BeginUpdate - Update an existing Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - parameters - Parameters supplied to the Update Redis operation. // - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. @@ -794,7 +793,7 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Update an existing Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *Client) update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -830,7 +829,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) 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 e0d2a1d8946f..000000000000 --- a/sdk/resourcemanager/redis/armredis/client_example_test.go +++ /dev/null @@ -1,895 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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.52Z"); return t}()), - // UpsellNotification: map[string]*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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), - // 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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")}, - }, 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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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"), - }, 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) - } -} diff --git a/sdk/resourcemanager/redis/armredis/client_factory.go b/sdk/resourcemanager/redis/armredis/client_factory.go index b76960054417..1a483eb25bb9 100644 --- a/sdk/resourcemanager/redis/armredis/client_factory.go +++ b/sdk/resourcemanager/redis/armredis/client_factory.go @@ -24,8 +24,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - 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) { @@ -78,3 +77,13 @@ func (c *ClientFactory) NewAsyncOperationStatusClient() *AsyncOperationStatusCli subClient, _ := NewAsyncOperationStatusClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewAccessPolicyClient() *AccessPolicyClient { + subClient, _ := NewAccessPolicyClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAccessPolicyAssignmentClient() *AccessPolicyAssignmentClient { + subClient, _ := NewAccessPolicyAssignmentClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/redis/armredis/constants.go b/sdk/resourcemanager/redis/armredis/constants.go index 4e9957162fc4..eee409ad011b 100644 --- a/sdk/resourcemanager/redis/armredis/constants.go +++ b/sdk/resourcemanager/redis/armredis/constants.go @@ -11,9 +11,73 @@ package armredis const ( moduleName = "armredis" - moduleVersion = "v2.2.1" + moduleVersion = "v2.3.0" ) +// AccessPolicyAssignmentProvisioningState - Provisioning state of an access policy assignment set +type AccessPolicyAssignmentProvisioningState string + +const ( + AccessPolicyAssignmentProvisioningStateCanceled AccessPolicyAssignmentProvisioningState = "Canceled" + AccessPolicyAssignmentProvisioningStateDeleted AccessPolicyAssignmentProvisioningState = "Deleted" + AccessPolicyAssignmentProvisioningStateDeleting AccessPolicyAssignmentProvisioningState = "Deleting" + AccessPolicyAssignmentProvisioningStateFailed AccessPolicyAssignmentProvisioningState = "Failed" + AccessPolicyAssignmentProvisioningStateSucceeded AccessPolicyAssignmentProvisioningState = "Succeeded" + AccessPolicyAssignmentProvisioningStateUpdating AccessPolicyAssignmentProvisioningState = "Updating" +) + +// PossibleAccessPolicyAssignmentProvisioningStateValues returns the possible values for the AccessPolicyAssignmentProvisioningState const type. +func PossibleAccessPolicyAssignmentProvisioningStateValues() []AccessPolicyAssignmentProvisioningState { + return []AccessPolicyAssignmentProvisioningState{ + AccessPolicyAssignmentProvisioningStateCanceled, + AccessPolicyAssignmentProvisioningStateDeleted, + AccessPolicyAssignmentProvisioningStateDeleting, + AccessPolicyAssignmentProvisioningStateFailed, + AccessPolicyAssignmentProvisioningStateSucceeded, + AccessPolicyAssignmentProvisioningStateUpdating, + } +} + +// AccessPolicyProvisioningState - Provisioning state of access policy +type AccessPolicyProvisioningState string + +const ( + AccessPolicyProvisioningStateCanceled AccessPolicyProvisioningState = "Canceled" + AccessPolicyProvisioningStateDeleted AccessPolicyProvisioningState = "Deleted" + AccessPolicyProvisioningStateDeleting AccessPolicyProvisioningState = "Deleting" + AccessPolicyProvisioningStateFailed AccessPolicyProvisioningState = "Failed" + AccessPolicyProvisioningStateSucceeded AccessPolicyProvisioningState = "Succeeded" + AccessPolicyProvisioningStateUpdating AccessPolicyProvisioningState = "Updating" +) + +// PossibleAccessPolicyProvisioningStateValues returns the possible values for the AccessPolicyProvisioningState const type. +func PossibleAccessPolicyProvisioningStateValues() []AccessPolicyProvisioningState { + return []AccessPolicyProvisioningState{ + AccessPolicyProvisioningStateCanceled, + AccessPolicyProvisioningStateDeleted, + AccessPolicyProvisioningStateDeleting, + AccessPolicyProvisioningStateFailed, + AccessPolicyProvisioningStateSucceeded, + AccessPolicyProvisioningStateUpdating, + } +} + +// AccessPolicyType - Built-In or Custom access policy +type AccessPolicyType string + +const ( + AccessPolicyTypeBuiltIn AccessPolicyType = "BuiltIn" + AccessPolicyTypeCustom AccessPolicyType = "Custom" +) + +// PossibleAccessPolicyTypeValues returns the possible values for the AccessPolicyType const type. +func PossibleAccessPolicyTypeValues() []AccessPolicyType { + return []AccessPolicyType{ + AccessPolicyTypeBuiltIn, + AccessPolicyTypeCustom, + } +} + // DayOfWeek - Day of the week when a cache can be patched. type DayOfWeek string diff --git a/sdk/resourcemanager/redis/armredis/firewallrules_client.go b/sdk/resourcemanager/redis/armredis/firewallrules_client.go index 8d9dd37ed02a..4df78fc9ae66 100644 --- a/sdk/resourcemanager/redis/armredis/firewallrules_client.go +++ b/sdk/resourcemanager/redis/armredis/firewallrules_client.go @@ -29,8 +29,7 @@ type FirewallRulesClient struct { } // NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error) { @@ -48,8 +47,8 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Create or update a redis cache firewall rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - ruleName - The name of the firewall rule. // - parameters - Parameters supplied to the create or update redis firewall rule operation. @@ -94,7 +93,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -112,8 +111,8 @@ func (client *FirewallRulesClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a single firewall rule in a specified redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - ruleName - The name of the firewall rule. // - options - FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. @@ -156,7 +155,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -165,8 +164,8 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets a single firewall rule in a specified redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - ruleName - The name of the firewall rule. // - options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. @@ -209,7 +208,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,8 +225,8 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListPager - Gets all firewall rules in the specified redis cache. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - options - FirewallRulesClientListOptions contains the optional parameters for the FirewallRulesClient.NewListPager method. func (client *FirewallRulesClient) NewListPager(resourceGroupName string, cacheName string, options *FirewallRulesClientListOptions) *runtime.Pager[FirewallRulesClientListResponse] { @@ -278,7 +277,7 @@ func (client *FirewallRulesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 89bc4e2abf96..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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 24513afec877..251226508dbb 100644 --- a/sdk/resourcemanager/redis/armredis/go.mod +++ b/sdk/resourcemanager/redis/armredis/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/redis/armredis/linkedserver_client.go b/sdk/resourcemanager/redis/armredis/linkedserver_client.go index c5e4c5accde0..fd449165905c 100644 --- a/sdk/resourcemanager/redis/armredis/linkedserver_client.go +++ b/sdk/resourcemanager/redis/armredis/linkedserver_client.go @@ -29,8 +29,7 @@ type LinkedServerClient struct { } // NewLinkedServerClient creates a new instance of LinkedServerClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewLinkedServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LinkedServerClient, error) { @@ -48,8 +47,8 @@ func NewLinkedServerClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Adds a linked server to the Redis cache (requires Premium SKU). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - linkedServerName - The name of the linked server that is being added to the Redis cache. // - parameters - Parameters supplied to the Create Linked server operation. @@ -70,7 +69,7 @@ func (client *LinkedServerClient) BeginCreate(ctx context.Context, resourceGroup // Create - Adds a linked server to the Redis cache (requires Premium SKU). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *LinkedServerClient) create(ctx context.Context, resourceGroupName string, name string, linkedServerName string, parameters LinkedServerCreateParameters, options *LinkedServerClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, name, linkedServerName, parameters, options) if err != nil { @@ -110,7 +109,7 @@ func (client *LinkedServerClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,8 +118,8 @@ func (client *LinkedServerClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes the linked server from a redis cache (requires Premium SKU). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the redis cache. // - linkedServerName - The name of the linked server that is being added to the Redis cache. // - options - LinkedServerClientBeginDeleteOptions contains the optional parameters for the LinkedServerClient.BeginDelete @@ -140,7 +139,7 @@ func (client *LinkedServerClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the linked server from a redis cache (requires Premium SKU). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *LinkedServerClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, linkedServerName string, options *LinkedServerClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, linkedServerName, options) if err != nil { @@ -180,7 +179,7 @@ func (client *LinkedServerClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,8 +188,8 @@ func (client *LinkedServerClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the detailed information about a linked server of a redis cache (requires Premium SKU). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the redis cache. // - linkedServerName - The name of the linked server. // - options - LinkedServerClientGetOptions contains the optional parameters for the LinkedServerClient.Get method. @@ -233,7 +232,7 @@ func (client *LinkedServerClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,8 +249,8 @@ func (client *LinkedServerClient) getHandleResponse(resp *http.Response) (Linked // NewListPager - Gets the list of linked servers associated with this redis cache (requires Premium SKU). // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the redis cache. // - options - LinkedServerClientListOptions contains the optional parameters for the LinkedServerClient.NewListPager method. func (client *LinkedServerClient) NewListPager(resourceGroupName string, name string, options *LinkedServerClientListOptions) *runtime.Pager[LinkedServerClientListResponse] { @@ -302,7 +301,7 @@ func (client *LinkedServerClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 6e81aa396dd3..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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 317c2b7cb9bf..cfa36047c2ce 100644 --- a/sdk/resourcemanager/redis/armredis/models.go +++ b/sdk/resourcemanager/redis/armredis/models.go @@ -20,11 +20,136 @@ type AccessKeys struct { SecondaryKey *string } +// AccessPolicyAssignmentClientBeginCreateUpdateOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginCreateUpdate +// method. +type AccessPolicyAssignmentClientBeginCreateUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessPolicyAssignmentClientBeginDeleteOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginDelete +// method. +type AccessPolicyAssignmentClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessPolicyAssignmentClientGetOptions contains the optional parameters for the AccessPolicyAssignmentClient.Get method. +type AccessPolicyAssignmentClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccessPolicyAssignmentClientListOptions contains the optional parameters for the AccessPolicyAssignmentClient.NewListPager +// method. +type AccessPolicyAssignmentClientListOptions struct { + // placeholder for future optional parameters +} + +// AccessPolicyClientBeginCreateUpdateOptions contains the optional parameters for the AccessPolicyClient.BeginCreateUpdate +// method. +type AccessPolicyClientBeginCreateUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessPolicyClientBeginDeleteOptions contains the optional parameters for the AccessPolicyClient.BeginDelete method. +type AccessPolicyClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessPolicyClientGetOptions contains the optional parameters for the AccessPolicyClient.Get method. +type AccessPolicyClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccessPolicyClientListOptions contains the optional parameters for the AccessPolicyClient.NewListPager method. +type AccessPolicyClientListOptions struct { + // placeholder for future optional parameters +} + // AsyncOperationStatusClientGetOptions contains the optional parameters for the AsyncOperationStatusClient.Get method. type AsyncOperationStatusClientGetOptions struct { // placeholder for future optional parameters } +// CacheAccessPolicy - Response to get/put access policy. +type CacheAccessPolicy struct { + // Properties of an access policy. + Properties *CacheAccessPolicyProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CacheAccessPolicyAssignment - Properties for an access policy assignment +type CacheAccessPolicyAssignment struct { + // REQUIRED; Object Id to assign access policy to + ObjectID *string + + // REQUIRED; User friendly name for object id. Also represents username for token based authentication + ObjectIDAlias *string +} + +// CacheAccessPolicyAssignmentList - List of access policies assignments (with properties) of a Redis cache. +type CacheAccessPolicyAssignmentList struct { + // List of access policies assignments (with properties) of a Redis cache. + Value []*CacheAccessPolicyAssignmentSet + + // READ-ONLY; Link for next set. + NextLink *string +} + +// CacheAccessPolicyAssignmentSet - Response to an operation on access policy assignment +type CacheAccessPolicyAssignmentSet struct { + // Properties of an access policy assignment + Properties *CacheAccessPolicyAssignmentSetProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CacheAccessPolicyAssignmentSetProperties - Properties of an access policy assignment set +type CacheAccessPolicyAssignmentSetProperties struct { + Assignments []*CacheAccessPolicyAssignment + + // READ-ONLY; Provisioning state of an access policy assignment set + ProvisioningState *AccessPolicyAssignmentProvisioningState +} + +// CacheAccessPolicyList - List of access policies (with properties) of a Redis cache. +type CacheAccessPolicyList struct { + // List of access policies (with properties) of a Redis cache. + Value []*CacheAccessPolicy + + // READ-ONLY; Link for next set. + NextLink *string +} + +// CacheAccessPolicyProperties - All properties of an access policy. +type CacheAccessPolicyProperties struct { + // REQUIRED; Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites + Permissions *string + + // READ-ONLY; Provisioning state of access policy + ProvisioningState *AccessPolicyProvisioningState + + // READ-ONLY; Built-In or Custom access policy + Type *AccessPolicyType +} + // CheckNameAvailabilityParameters - Parameters body to pass for resource name availability check. type CheckNameAvailabilityParameters struct { // REQUIRED; Resource name. @@ -109,6 +234,9 @@ type ClientRegenerateKeyOptions struct { // rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value // etc. type CommonPropertiesRedisConfiguration struct { + // Specifies whether AAD based authentication has been enabled or disabled for the cache + AADEnabled *string + // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any diff --git a/sdk/resourcemanager/redis/armredis/models_serde.go b/sdk/resourcemanager/redis/armredis/models_serde.go index b7649c3ea6e4..fdd2bb0322b0 100644 --- a/sdk/resourcemanager/redis/armredis/models_serde.go +++ b/sdk/resourcemanager/redis/armredis/models_serde.go @@ -47,6 +47,243 @@ func (a *AccessKeys) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicy. +func (c CacheAccessPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicy. +func (c *CacheAccessPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyAssignment. +func (c CacheAccessPolicyAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectId", c.ObjectID) + populate(objectMap, "objectIdAlias", c.ObjectIDAlias) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyAssignment. +func (c *CacheAccessPolicyAssignment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectId": + err = unpopulate(val, "ObjectID", &c.ObjectID) + delete(rawMsg, key) + case "objectIdAlias": + err = unpopulate(val, "ObjectIDAlias", &c.ObjectIDAlias) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyAssignmentList. +func (c CacheAccessPolicyAssignmentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyAssignmentList. +func (c *CacheAccessPolicyAssignmentList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyAssignmentSet. +func (c CacheAccessPolicyAssignmentSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyAssignmentSet. +func (c *CacheAccessPolicyAssignmentSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyAssignmentSetProperties. +func (c CacheAccessPolicyAssignmentSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignments", c.Assignments) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyAssignmentSetProperties. +func (c *CacheAccessPolicyAssignmentSetProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assignments": + err = unpopulate(val, "Assignments", &c.Assignments) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyList. +func (c CacheAccessPolicyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyList. +func (c *CacheAccessPolicyList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheAccessPolicyProperties. +func (c CacheAccessPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "permissions", c.Permissions) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheAccessPolicyProperties. +func (c *CacheAccessPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "permissions": + err = unpopulate(val, "Permissions", &c.Permissions) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityParameters. func (c CheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -81,6 +318,7 @@ func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommonPropertiesRedisConfiguration. func (c CommonPropertiesRedisConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "aad-enabled", c.AADEnabled) populate(objectMap, "aof-backup-enabled", c.AofBackupEnabled) populate(objectMap, "aof-storage-connection-string-0", c.AofStorageConnectionString0) populate(objectMap, "aof-storage-connection-string-1", c.AofStorageConnectionString1) @@ -114,6 +352,9 @@ func (c *CommonPropertiesRedisConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "aad-enabled": + err = unpopulate(val, "AADEnabled", &c.AADEnabled) + delete(rawMsg, key) case "aof-backup-enabled": err = unpopulate(val, "AofBackupEnabled", &c.AofBackupEnabled) delete(rawMsg, key) diff --git a/sdk/resourcemanager/redis/armredis/operations_client.go b/sdk/resourcemanager/redis/armredis/operations_client.go index aa540529550d..620b740b37a4 100644 --- a/sdk/resourcemanager/redis/armredis/operations_client.go +++ b/sdk/resourcemanager/redis/armredis/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.Cache provider. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 8a9f7286e66a..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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.go b/sdk/resourcemanager/redis/armredis/patchschedules_client.go index ba0c7c2e13cf..059055f3307a 100644 --- a/sdk/resourcemanager/redis/armredis/patchschedules_client.go +++ b/sdk/resourcemanager/redis/armredis/patchschedules_client.go @@ -29,8 +29,7 @@ type PatchSchedulesClient struct { } // NewPatchSchedulesClient creates a new instance of PatchSchedulesClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPatchSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PatchSchedulesClient, error) { @@ -48,8 +47,8 @@ func NewPatchSchedulesClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or replace the patching schedule for Redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Redis cache. // - defaultParam - Default string modeled as parameter for auto generation to work correctly. // - parameters - Parameters to set the patching schedule for Redis cache. @@ -94,7 +93,7 @@ func (client *PatchSchedulesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -112,8 +111,8 @@ func (client *PatchSchedulesClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes the patching schedule of a redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the redis cache. // - defaultParam - Default string modeled as parameter for auto generation to work correctly. // - options - PatchSchedulesClientDeleteOptions contains the optional parameters for the PatchSchedulesClient.Delete method. @@ -156,7 +155,7 @@ func (client *PatchSchedulesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -165,8 +164,8 @@ func (client *PatchSchedulesClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the patching schedule of a redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the redis cache. // - defaultParam - Default string modeled as parameter for auto generation to work correctly. // - options - PatchSchedulesClientGetOptions contains the optional parameters for the PatchSchedulesClient.Get method. @@ -209,7 +208,7 @@ func (client *PatchSchedulesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,8 +225,8 @@ func (client *PatchSchedulesClient) getHandleResponse(resp *http.Response) (Patc // NewListByRedisResourcePager - Gets all patch schedules in the specified redis cache (there is only one). // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - options - PatchSchedulesClientListByRedisResourceOptions contains the optional parameters for the PatchSchedulesClient.NewListByRedisResourcePager // method. @@ -279,7 +278,7 @@ func (client *PatchSchedulesClient) listByRedisResourceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 2e916085d581..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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.go b/sdk/resourcemanager/redis/armredis/privateendpointconnections_client.go index 69de99cc948b..c77a9a397a82 100644 --- a/sdk/resourcemanager/redis/armredis/privateendpointconnections_client.go +++ b/sdk/resourcemanager/redis/armredis/privateendpointconnections_client.go @@ -29,8 +29,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -48,8 +47,8 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Delete - Deletes the specified private endpoint connection associated with the redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete @@ -93,7 +92,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,8 +101,8 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -147,7 +146,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,8 +163,8 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all the private endpoint connections associated with the redis cache. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. @@ -211,7 +210,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,8 +228,8 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // BeginPut - Update the state of specified private endpoint connection associated with the redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - properties - The private endpoint connection properties. @@ -251,7 +250,7 @@ func (client *PrivateEndpointConnectionsClient) BeginPut(ctx context.Context, re // Put - Update the state of specified private endpoint connection associated with the redis cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-01 +// Generated from API version 2023-05-01 func (client *PrivateEndpointConnectionsClient) put(ctx context.Context, resourceGroupName string, cacheName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginPutOptions) (*http.Response, error) { req, err := client.putCreateRequest(ctx, resourceGroupName, cacheName, privateEndpointConnectionName, properties, options) if err != nil { @@ -291,7 +290,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) 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 8ceb7f07fb3a..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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.go b/sdk/resourcemanager/redis/armredis/privatelinkresources_client.go index 6a0ce96008bd..9e0aa38ac79e 100644 --- a/sdk/resourcemanager/redis/armredis/privatelinkresources_client.go +++ b/sdk/resourcemanager/redis/armredis/privatelinkresources_client.go @@ -29,8 +29,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -47,8 +46,8 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListByRedisCachePager - Gets the private link resources that need to be created for a redis cache. // -// Generated from API version 2022-06-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - cacheName - The name of the Redis cache. // - options - PrivateLinkResourcesClientListByRedisCacheOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByRedisCachePager // method. @@ -94,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listByRedisCacheCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 de5334b5e945..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/065033d1c4087a2b009e71c0b3f0666718354ebd/specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-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/response_types.go index 44ada908327f..8bc93c2954ef 100644 --- a/sdk/resourcemanager/redis/armredis/response_types.go +++ b/sdk/resourcemanager/redis/armredis/response_types.go @@ -9,6 +9,46 @@ package armredis +// AccessPolicyAssignmentClientCreateUpdateResponse contains the response from method AccessPolicyAssignmentClient.BeginCreateUpdate. +type AccessPolicyAssignmentClientCreateUpdateResponse struct { + CacheAccessPolicyAssignmentSet +} + +// AccessPolicyAssignmentClientDeleteResponse contains the response from method AccessPolicyAssignmentClient.BeginDelete. +type AccessPolicyAssignmentClientDeleteResponse struct { + CacheAccessPolicyAssignmentSet +} + +// AccessPolicyAssignmentClientGetResponse contains the response from method AccessPolicyAssignmentClient.Get. +type AccessPolicyAssignmentClientGetResponse struct { + CacheAccessPolicyAssignmentSet +} + +// AccessPolicyAssignmentClientListResponse contains the response from method AccessPolicyAssignmentClient.NewListPager. +type AccessPolicyAssignmentClientListResponse struct { + CacheAccessPolicyAssignmentList +} + +// AccessPolicyClientCreateUpdateResponse contains the response from method AccessPolicyClient.BeginCreateUpdate. +type AccessPolicyClientCreateUpdateResponse struct { + CacheAccessPolicy +} + +// AccessPolicyClientDeleteResponse contains the response from method AccessPolicyClient.BeginDelete. +type AccessPolicyClientDeleteResponse struct { + CacheAccessPolicy +} + +// AccessPolicyClientGetResponse contains the response from method AccessPolicyClient.Get. +type AccessPolicyClientGetResponse struct { + CacheAccessPolicy +} + +// AccessPolicyClientListResponse contains the response from method AccessPolicyClient.NewListPager. +type AccessPolicyClientListResponse struct { + CacheAccessPolicyList +} + // AsyncOperationStatusClientGetResponse contains the response from method AsyncOperationStatusClient.Get. type AsyncOperationStatusClientGetResponse struct { OperationStatus