[Release] sdk/resourcemanager/redisenterprise/armredisenterprise/2.1.0-beta.2 (#23440)
* [Release] sdk/resourcemanager/redisenterprise/armredisenterprise/2.1.0-beta.2 generation from spec commit: 8a287afb3721dee0d88f11502ec123470bc52a28 * update recording --------- Co-authored-by: ReleaseHelper <ReleaseHelper> Co-authored-by: fz <v-fending@microsoft.com>
This commit is contained in:
Родитель
10304eb057
Коммит
3fd8754d42
|
@ -1,5 +1,32 @@
|
|||
# Release History
|
||||
|
||||
## 2.1.0-beta.2 (2024-09-27)
|
||||
### Features Added
|
||||
|
||||
- New value `SKUNameBalancedB0`, `SKUNameBalancedB1`, `SKUNameBalancedB10`, `SKUNameBalancedB100`, `SKUNameBalancedB1000`, `SKUNameBalancedB150`, `SKUNameBalancedB20`, `SKUNameBalancedB250`, `SKUNameBalancedB3`, `SKUNameBalancedB350`, `SKUNameBalancedB5`, `SKUNameBalancedB50`, `SKUNameBalancedB500`, `SKUNameBalancedB700`, `SKUNameComputeOptimizedX10`, `SKUNameComputeOptimizedX100`, `SKUNameComputeOptimizedX150`, `SKUNameComputeOptimizedX20`, `SKUNameComputeOptimizedX250`, `SKUNameComputeOptimizedX3`, `SKUNameComputeOptimizedX350`, `SKUNameComputeOptimizedX5`, `SKUNameComputeOptimizedX50`, `SKUNameComputeOptimizedX500`, `SKUNameComputeOptimizedX700`, `SKUNameEnterpriseE1`, `SKUNameEnterpriseE200`, `SKUNameEnterpriseE400`, `SKUNameFlashOptimizedA1000`, `SKUNameFlashOptimizedA1500`, `SKUNameFlashOptimizedA2000`, `SKUNameFlashOptimizedA250`, `SKUNameFlashOptimizedA4500`, `SKUNameFlashOptimizedA500`, `SKUNameFlashOptimizedA700`, `SKUNameMemoryOptimizedM10`, `SKUNameMemoryOptimizedM100`, `SKUNameMemoryOptimizedM1000`, `SKUNameMemoryOptimizedM150`, `SKUNameMemoryOptimizedM1500`, `SKUNameMemoryOptimizedM20`, `SKUNameMemoryOptimizedM2000`, `SKUNameMemoryOptimizedM250`, `SKUNameMemoryOptimizedM350`, `SKUNameMemoryOptimizedM50`, `SKUNameMemoryOptimizedM500`, `SKUNameMemoryOptimizedM700` added to enum type `SKUName`
|
||||
- New enum type `AccessKeysAuthentication` with values `AccessKeysAuthenticationDisabled`, `AccessKeysAuthenticationEnabled`
|
||||
- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser`
|
||||
- New enum type `HighAvailability` with values `HighAvailabilityDisabled`, `HighAvailabilityEnabled`
|
||||
- New enum type `RedundancyMode` with values `RedundancyModeLR`, `RedundancyModeNone`, `RedundancyModeZR`
|
||||
- New function `NewAccessPolicyAssignmentClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AccessPolicyAssignmentClient, error)`
|
||||
- New function `*AccessPolicyAssignmentClient.BeginCreateUpdate(context.Context, string, string, string, string, AccessPolicyAssignment, *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyAssignmentClientCreateUpdateResponse], error)`
|
||||
- New function `*AccessPolicyAssignmentClient.BeginDelete(context.Context, string, string, string, string, *AccessPolicyAssignmentClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyAssignmentClientDeleteResponse], error)`
|
||||
- New function `*AccessPolicyAssignmentClient.Get(context.Context, string, string, string, string, *AccessPolicyAssignmentClientGetOptions) (AccessPolicyAssignmentClientGetResponse, error)`
|
||||
- New function `*AccessPolicyAssignmentClient.NewListPager(string, string, string, *AccessPolicyAssignmentClientListOptions) *runtime.Pager[AccessPolicyAssignmentClientListResponse]`
|
||||
- New function `*ClientFactory.NewAccessPolicyAssignmentClient() *AccessPolicyAssignmentClient`
|
||||
- New struct `AccessPolicyAssignment`
|
||||
- New struct `AccessPolicyAssignmentList`
|
||||
- New struct `AccessPolicyAssignmentProperties`
|
||||
- New struct `AccessPolicyAssignmentPropertiesUser`
|
||||
- New struct `ProxyResourceAutoGenerated`
|
||||
- New struct `ResourceAutoGenerated`
|
||||
- New struct `SystemData`
|
||||
- New field `HighAvailability`, `RedundancyMode` in struct `ClusterProperties`
|
||||
- New field `SystemData` in struct `Database`
|
||||
- New field `AccessKeysAuthentication` in struct `DatabaseProperties`
|
||||
- New field `SystemData` in struct `ProxyResource`
|
||||
|
||||
|
||||
## 2.1.0-beta.1 (2024-05-24)
|
||||
### Features Added
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ clientFactory, err := armredisenterprise.NewClientFactory(<subscription ID>, cre
|
|||
A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.
|
||||
|
||||
```go
|
||||
client := clientFactory.NewClient()
|
||||
client := clientFactory.NewAccessPolicyAssignmentClient()
|
||||
```
|
||||
|
||||
## Fakes
|
||||
|
|
|
@ -0,0 +1,367 @@
|
|||
//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. DO NOT EDIT.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
package armredisenterprise
|
||||
|
||||
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, moduleVersion, credential, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client := &AccessPolicyAssignmentClient{
|
||||
subscriptionID: subscriptionID,
|
||||
internal: cl,
|
||||
}
|
||||
return client, nil
|
||||
}
|
||||
|
||||
// BeginCreateUpdate - Creates/Updates a particular access policy assignment for a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
// - accessPolicyAssignmentName - The name of the Redis Enterprise database access policy assignment.
|
||||
// - parameters - Parameters supplied to the create access policy assignment for database.
|
||||
// - options - AccessPolicyAssignmentClientBeginCreateUpdateOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginCreateUpdate
|
||||
// method.
|
||||
func (client *AccessPolicyAssignmentClient) BeginCreateUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, parameters AccessPolicyAssignment, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*runtime.Poller[AccessPolicyAssignmentClientCreateUpdateResponse], error) {
|
||||
if options == nil || options.ResumeToken == "" {
|
||||
resp, err := client.createUpdate(ctx, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, parameters, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessPolicyAssignmentClientCreateUpdateResponse]{
|
||||
FinalStateVia: runtime.FinalStateViaOriginalURI,
|
||||
Tracer: client.internal.Tracer(),
|
||||
})
|
||||
return poller, err
|
||||
} else {
|
||||
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccessPolicyAssignmentClientCreateUpdateResponse]{
|
||||
Tracer: client.internal.Tracer(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// CreateUpdate - Creates/Updates a particular access policy assignment for a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *AccessPolicyAssignmentClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, parameters AccessPolicyAssignment, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "AccessPolicyAssignmentClient.BeginCreateUpdate"
|
||||
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
|
||||
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
|
||||
defer func() { endSpan(err) }()
|
||||
req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, parameters, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
httpResp, err := client.internal.Pipeline().Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
|
||||
err = runtime.NewResponseError(httpResp)
|
||||
return nil, err
|
||||
}
|
||||
return httpResp, nil
|
||||
}
|
||||
|
||||
// createUpdateCreateRequest creates the CreateUpdate request.
|
||||
func (client *AccessPolicyAssignmentClient) createUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, parameters AccessPolicyAssignment, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*policy.Request, error) {
|
||||
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"
|
||||
if client.subscriptionID == "" {
|
||||
return nil, errors.New("parameter client.subscriptionID cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
|
||||
if resourceGroupName == "" {
|
||||
return nil, errors.New("parameter resourceGroupName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
|
||||
if clusterName == "" {
|
||||
return nil, errors.New("parameter clusterName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
|
||||
if databaseName == "" {
|
||||
return nil, errors.New("parameter databaseName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
|
||||
if accessPolicyAssignmentName == "" {
|
||||
return nil, errors.New("parameter accessPolicyAssignmentName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{accessPolicyAssignmentName}", url.PathEscape(accessPolicyAssignmentName))
|
||||
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", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// BeginDelete - Deletes a single access policy assignment.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
// - accessPolicyAssignmentName - The name of the Redis Enterprise database access policy assignment.
|
||||
// - options - AccessPolicyAssignmentClientBeginDeleteOptions contains the optional parameters for the AccessPolicyAssignmentClient.BeginDelete
|
||||
// method.
|
||||
func (client *AccessPolicyAssignmentClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*runtime.Poller[AccessPolicyAssignmentClientDeleteResponse], error) {
|
||||
if options == nil || options.ResumeToken == "" {
|
||||
resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessPolicyAssignmentClientDeleteResponse]{
|
||||
FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
|
||||
Tracer: client.internal.Tracer(),
|
||||
})
|
||||
return poller, err
|
||||
} else {
|
||||
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccessPolicyAssignmentClientDeleteResponse]{
|
||||
Tracer: client.internal.Tracer(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Delete - Deletes a single access policy assignment.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *AccessPolicyAssignmentClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "AccessPolicyAssignmentClient.BeginDelete"
|
||||
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
|
||||
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
|
||||
defer func() { endSpan(err) }()
|
||||
req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
httpResp, err := client.internal.Pipeline().Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
|
||||
err = runtime.NewResponseError(httpResp)
|
||||
return nil, err
|
||||
}
|
||||
return httpResp, nil
|
||||
}
|
||||
|
||||
// deleteCreateRequest creates the Delete request.
|
||||
func (client *AccessPolicyAssignmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*policy.Request, error) {
|
||||
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"
|
||||
if client.subscriptionID == "" {
|
||||
return nil, errors.New("parameter client.subscriptionID cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
|
||||
if resourceGroupName == "" {
|
||||
return nil, errors.New("parameter resourceGroupName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
|
||||
if clusterName == "" {
|
||||
return nil, errors.New("parameter clusterName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
|
||||
if databaseName == "" {
|
||||
return nil, errors.New("parameter databaseName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
|
||||
if accessPolicyAssignmentName == "" {
|
||||
return nil, errors.New("parameter accessPolicyAssignmentName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{accessPolicyAssignmentName}", url.PathEscape(accessPolicyAssignmentName))
|
||||
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", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// Get - Gets information about access policy assignment for database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
// - accessPolicyAssignmentName - The name of the Redis Enterprise database access policy assignment.
|
||||
// - options - AccessPolicyAssignmentClientGetOptions contains the optional parameters for the AccessPolicyAssignmentClient.Get
|
||||
// method.
|
||||
func (client *AccessPolicyAssignmentClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientGetOptions) (AccessPolicyAssignmentClientGetResponse, error) {
|
||||
var err error
|
||||
const operationName = "AccessPolicyAssignmentClient.Get"
|
||||
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
|
||||
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
|
||||
defer func() { endSpan(err) }()
|
||||
req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, options)
|
||||
if err != nil {
|
||||
return AccessPolicyAssignmentClientGetResponse{}, err
|
||||
}
|
||||
httpResp, err := client.internal.Pipeline().Do(req)
|
||||
if err != nil {
|
||||
return AccessPolicyAssignmentClientGetResponse{}, err
|
||||
}
|
||||
if !runtime.HasStatusCode(httpResp, http.StatusOK) {
|
||||
err = runtime.NewResponseError(httpResp)
|
||||
return AccessPolicyAssignmentClientGetResponse{}, err
|
||||
}
|
||||
resp, err := client.getHandleResponse(httpResp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// getCreateRequest creates the Get request.
|
||||
func (client *AccessPolicyAssignmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientGetOptions) (*policy.Request, error) {
|
||||
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"
|
||||
if client.subscriptionID == "" {
|
||||
return nil, errors.New("parameter client.subscriptionID cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
|
||||
if resourceGroupName == "" {
|
||||
return nil, errors.New("parameter resourceGroupName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
|
||||
if clusterName == "" {
|
||||
return nil, errors.New("parameter clusterName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
|
||||
if databaseName == "" {
|
||||
return nil, errors.New("parameter databaseName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
|
||||
if accessPolicyAssignmentName == "" {
|
||||
return nil, errors.New("parameter accessPolicyAssignmentName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{accessPolicyAssignmentName}", url.PathEscape(accessPolicyAssignmentName))
|
||||
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", "2024-09-01-preview")
|
||||
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.AccessPolicyAssignment); err != nil {
|
||||
return AccessPolicyAssignmentClientGetResponse{}, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// NewListPager - Gets all access policy assignments..
|
||||
//
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
// - options - AccessPolicyAssignmentClientListOptions contains the optional parameters for the AccessPolicyAssignmentClient.NewListPager
|
||||
// method.
|
||||
func (client *AccessPolicyAssignmentClient) NewListPager(resourceGroupName string, clusterName string, databaseName 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) {
|
||||
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccessPolicyAssignmentClient.NewListPager")
|
||||
nextLink := ""
|
||||
if page != nil {
|
||||
nextLink = *page.NextLink
|
||||
}
|
||||
resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
|
||||
return client.listCreateRequest(ctx, resourceGroupName, clusterName, databaseName, options)
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return AccessPolicyAssignmentClientListResponse{}, err
|
||||
}
|
||||
return client.listHandleResponse(resp)
|
||||
},
|
||||
Tracer: client.internal.Tracer(),
|
||||
})
|
||||
}
|
||||
|
||||
// listCreateRequest creates the List request.
|
||||
func (client *AccessPolicyAssignmentClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *AccessPolicyAssignmentClientListOptions) (*policy.Request, error) {
|
||||
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments"
|
||||
if client.subscriptionID == "" {
|
||||
return nil, errors.New("parameter client.subscriptionID cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
|
||||
if resourceGroupName == "" {
|
||||
return nil, errors.New("parameter resourceGroupName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
|
||||
if clusterName == "" {
|
||||
return nil, errors.New("parameter clusterName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
|
||||
if databaseName == "" {
|
||||
return nil, errors.New("parameter databaseName cannot be empty")
|
||||
}
|
||||
urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName))
|
||||
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", "2024-09-01-preview")
|
||||
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.AccessPolicyAssignmentList); err != nil {
|
||||
return AccessPolicyAssignmentClientListResponse{}, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
//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 armredisenterprise_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/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json
|
||||
func ExampleAccessPolicyAssignmentClient_BeginCreateUpdate() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to obtain a credential: %v", err)
|
||||
}
|
||||
ctx := context.Background()
|
||||
clientFactory, err := armredisenterprise.NewClientFactory("<subscription-id>", cred, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create client: %v", err)
|
||||
}
|
||||
poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginCreateUpdate(ctx, "rg1", "cache1", "default", "defaultTestEntraApp1", armredisenterprise.AccessPolicyAssignment{
|
||||
Properties: &armredisenterprise.AccessPolicyAssignmentProperties{
|
||||
AccessPolicyName: to.Ptr("default"),
|
||||
User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{
|
||||
ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"),
|
||||
},
|
||||
},
|
||||
}, 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.AccessPolicyAssignment = armredisenterprise.AccessPolicyAssignment{
|
||||
// Name: to.Ptr("defaultTestEntraApp1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/accessPolicyAssignments"),
|
||||
// ID: to.Ptr("subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroupsrg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default/accessPolicyAssignments/default-TestEntraApp1"),
|
||||
// Properties: &armredisenterprise.AccessPolicyAssignmentProperties{
|
||||
// AccessPolicyName: to.Ptr("default"),
|
||||
// ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded),
|
||||
// User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{
|
||||
// ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"),
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseAccessPolicyAssignmentGet.json
|
||||
func ExampleAccessPolicyAssignmentClient_Get() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to obtain a credential: %v", err)
|
||||
}
|
||||
ctx := context.Background()
|
||||
clientFactory, err := armredisenterprise.NewClientFactory("<subscription-id>", cred, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create client: %v", err)
|
||||
}
|
||||
res, err := clientFactory.NewAccessPolicyAssignmentClient().Get(ctx, "rg1", "cache1", "default", "accessPolicyAssignmentName1", nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to finish the request: %v", err)
|
||||
}
|
||||
// You could use response here. We use blank identifier for just demo purposes.
|
||||
_ = res
|
||||
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
|
||||
// res.AccessPolicyAssignment = armredisenterprise.AccessPolicyAssignment{
|
||||
// Name: to.Ptr("accessPolicyAssignmentName1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"),
|
||||
// Properties: &armredisenterprise.AccessPolicyAssignmentProperties{
|
||||
// AccessPolicyName: to.Ptr("default"),
|
||||
// ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded),
|
||||
// User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{
|
||||
// ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"),
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseAccessPolicyAssignmentDelete.json
|
||||
func ExampleAccessPolicyAssignmentClient_BeginDelete() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to obtain a credential: %v", err)
|
||||
}
|
||||
ctx := context.Background()
|
||||
clientFactory, err := armredisenterprise.NewClientFactory("<subscription-id>", cred, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create client: %v", err)
|
||||
}
|
||||
poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginDelete(ctx, "rg1", "cache1", "default", "defaultTestEntraApp1", 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/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseAccessPolicyAssignmentsList.json
|
||||
func ExampleAccessPolicyAssignmentClient_NewListPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to obtain a credential: %v", err)
|
||||
}
|
||||
ctx := context.Background()
|
||||
clientFactory, err := armredisenterprise.NewClientFactory("<subscription-id>", cred, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create client: %v", err)
|
||||
}
|
||||
pager := clientFactory.NewAccessPolicyAssignmentClient().NewListPager("rg1", "cache1", "default", 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.AccessPolicyAssignmentList = armredisenterprise.AccessPolicyAssignmentList{
|
||||
// Value: []*armredisenterprise.AccessPolicyAssignment{
|
||||
// {
|
||||
// Name: to.Ptr("accessPolicyAssignmentName1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"),
|
||||
// Properties: &armredisenterprise.AccessPolicyAssignmentProperties{
|
||||
// AccessPolicyName: to.Ptr("default"),
|
||||
// ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded),
|
||||
// User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{
|
||||
// ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// Name: to.Ptr("accessPolicyAssignmentName2"),
|
||||
// Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName2"),
|
||||
// Properties: &armredisenterprise.AccessPolicyAssignmentProperties{
|
||||
// AccessPolicyName: to.Ptr("default"),
|
||||
// ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded),
|
||||
// User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{
|
||||
// ObjectID: to.Ptr("7497c918-11ad-41e7-1b0f-7c518a87d0b0"),
|
||||
// },
|
||||
// },
|
||||
// }},
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -2,5 +2,5 @@
|
|||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "go",
|
||||
"TagPrefix": "go/resourcemanager/redisenterprise/armredisenterprise",
|
||||
"Tag": "go/resourcemanager/redisenterprise/armredisenterprise_3df7c6e096"
|
||||
"Tag": "go/resourcemanager/redisenterprise/armredisenterprise_9b58056883"
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
``` yaml
|
||||
azure-arm: true
|
||||
require:
|
||||
- https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/readme.md
|
||||
- https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/readme.go.md
|
||||
- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/readme.md
|
||||
- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/readme.go.md
|
||||
license-header: MICROSOFT_MIT_NO_VERSION
|
||||
module-version: 2.1.0-beta.1
|
||||
tag: package-preview-2024-03
|
||||
module-version: 2.1.0-beta.2
|
||||
tag: package-preview-2024-09
|
||||
```
|
|
@ -46,10 +46,10 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options
|
|||
// BeginCreate - Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - parameters - Parameters supplied to the Create RedisEnterprise operation.
|
||||
// - parameters - Parameters supplied to the Create Redis Enterprise operation.
|
||||
// - options - ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method.
|
||||
func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClientBeginCreateOptions) (*runtime.Poller[ClientCreateResponse], error) {
|
||||
if options == nil || options.ResumeToken == "" {
|
||||
|
@ -72,7 +72,7 @@ func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string,
|
|||
// Create - Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *Client) create(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClientBeginCreateOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "Client.BeginCreate"
|
||||
|
@ -114,7 +114,7 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -123,10 +123,10 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName
|
|||
return req, nil
|
||||
}
|
||||
|
||||
// BeginDelete - Deletes a RedisEnterprise cache cluster.
|
||||
// BeginDelete - Deletes a Redis Enterprise cache cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.
|
||||
|
@ -148,10 +148,10 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string,
|
|||
}
|
||||
}
|
||||
|
||||
// Delete - Deletes a RedisEnterprise cache cluster.
|
||||
// Delete - Deletes a Redis Enterprise cache cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClientBeginDeleteOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "Client.BeginDelete"
|
||||
|
@ -193,16 +193,16 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// Get - Gets information about a RedisEnterprise cluster
|
||||
// Get - Gets information about a Redis Enterprise cluster
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - options - ClientGetOptions contains the optional parameters for the Client.Get method.
|
||||
|
@ -248,7 +248,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -263,9 +263,9 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse,
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// NewListPager - Gets all RedisEnterprise clusters in the specified subscription.
|
||||
// NewListPager - Lists all Redis Enterprise clusters in the specified subscription.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - options - ClientListOptions contains the optional parameters for the Client.NewListPager method.
|
||||
func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse] {
|
||||
return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{
|
||||
|
@ -302,7 +302,7 @@ func (client *Client) listCreateRequest(ctx context.Context, options *ClientList
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -317,9 +317,9 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// NewListByResourceGroupPager - Lists all RedisEnterprise clusters in a resource group.
|
||||
// NewListByResourceGroupPager - Lists all Redis Enterprise clusters in a resource group.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager
|
||||
// method.
|
||||
|
@ -362,7 +362,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -377,13 +377,13 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// BeginUpdate - Updates an existing RedisEnterprise cluster
|
||||
// BeginUpdate - Updates an existing Redis Enterprise cluster
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - parameters - Parameters supplied to the Update RedisEnterprise operation.
|
||||
// - parameters - Parameters supplied to the Update Redis Enterprise operation.
|
||||
// - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method.
|
||||
func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) {
|
||||
if options == nil || options.ResumeToken == "" {
|
||||
|
@ -403,10 +403,10 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string,
|
|||
}
|
||||
}
|
||||
|
||||
// Update - Updates an existing RedisEnterprise cluster
|
||||
// Update - Updates an existing Redis Enterprise cluster
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *Client) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, options *ClientBeginUpdateOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "Client.BeginUpdate"
|
||||
|
@ -448,7 +448,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseCreate.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseCreate.json
|
||||
func ExampleClient_BeginCreate() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -74,7 +74,7 @@ func ExampleClient_BeginCreate() {
|
|||
// res.Cluster = armredisenterprise.Cluster{
|
||||
// Name: to.Ptr("cache1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// Location: to.Ptr("West US"),
|
||||
// Tags: map[string]*string{
|
||||
// "tag1": to.Ptr("value1"),
|
||||
|
@ -106,7 +106,7 @@ func ExampleClient_BeginCreate() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseUpdate.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseUpdate.json
|
||||
func ExampleClient_BeginUpdate() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -142,7 +142,7 @@ func ExampleClient_BeginUpdate() {
|
|||
// res.Cluster = armredisenterprise.Cluster{
|
||||
// Name: to.Ptr("cache1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// Location: to.Ptr("West US"),
|
||||
// Tags: map[string]*string{
|
||||
// "tag1": to.Ptr("value1"),
|
||||
|
@ -170,7 +170,7 @@ func ExampleClient_BeginUpdate() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDelete.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDelete.json
|
||||
func ExampleClient_BeginDelete() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -191,7 +191,7 @@ func ExampleClient_BeginDelete() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseGet.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGet.json
|
||||
func ExampleClient_Get() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -212,7 +212,7 @@ func ExampleClient_Get() {
|
|||
// res.Cluster = armredisenterprise.Cluster{
|
||||
// Name: to.Ptr("cache1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// Location: to.Ptr("West US"),
|
||||
// Tags: map[string]*string{
|
||||
// },
|
||||
|
@ -221,10 +221,10 @@ func ExampleClient_Get() {
|
|||
// MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2),
|
||||
// PrivateEndpointConnections: []*armredisenterprise.PrivateEndpointConnection{
|
||||
// {
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/cachePec"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/cachePec"),
|
||||
// Properties: &armredisenterprise.PrivateEndpointConnectionProperties{
|
||||
// PrivateEndpoint: &armredisenterprise.PrivateEndpoint{
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/cachePe"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/cachePe"),
|
||||
// },
|
||||
// PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{
|
||||
// Description: to.Ptr("Please approve my connection"),
|
||||
|
@ -248,7 +248,7 @@ func ExampleClient_Get() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseListByResourceGroup.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListByResourceGroup.json
|
||||
func ExampleClient_NewListByResourceGroupPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -275,7 +275,7 @@ func ExampleClient_NewListByResourceGroupPager() {
|
|||
// {
|
||||
// Name: to.Ptr("cache1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// Location: to.Ptr("West US"),
|
||||
// Tags: map[string]*string{
|
||||
// },
|
||||
|
@ -299,7 +299,7 @@ func ExampleClient_NewListByResourceGroupPager() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseList.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseList.json
|
||||
func ExampleClient_NewListPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -326,7 +326,7 @@ func ExampleClient_NewListPager() {
|
|||
// {
|
||||
// Name: to.Ptr("cache1"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"),
|
||||
// Location: to.Ptr("West US"),
|
||||
// Tags: map[string]*string{
|
||||
// },
|
||||
|
|
|
@ -36,6 +36,14 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential,
|
|||
}, nil
|
||||
}
|
||||
|
||||
// NewAccessPolicyAssignmentClient creates a new instance of AccessPolicyAssignmentClient.
|
||||
func (c *ClientFactory) NewAccessPolicyAssignmentClient() *AccessPolicyAssignmentClient {
|
||||
return &AccessPolicyAssignmentClient{
|
||||
subscriptionID: c.subscriptionID,
|
||||
internal: c.internal,
|
||||
}
|
||||
}
|
||||
|
||||
// NewClient creates a new instance of Client.
|
||||
func (c *ClientFactory) NewClient() *Client {
|
||||
return &Client{
|
||||
|
|
|
@ -10,7 +10,7 @@ package armredisenterprise
|
|||
|
||||
const (
|
||||
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise"
|
||||
moduleVersion = "v2.1.0-beta.1"
|
||||
moduleVersion = "v2.1.0-beta.2"
|
||||
)
|
||||
|
||||
// AccessKeyType - Which access key to regenerate.
|
||||
|
@ -29,6 +29,23 @@ func PossibleAccessKeyTypeValues() []AccessKeyType {
|
|||
}
|
||||
}
|
||||
|
||||
// AccessKeysAuthentication - This property can be Enabled/Disabled to allow or deny access with the current access keys.
|
||||
// Can be updated even after database is created.
|
||||
type AccessKeysAuthentication string
|
||||
|
||||
const (
|
||||
AccessKeysAuthenticationDisabled AccessKeysAuthentication = "Disabled"
|
||||
AccessKeysAuthenticationEnabled AccessKeysAuthentication = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleAccessKeysAuthenticationValues returns the possible values for the AccessKeysAuthentication const type.
|
||||
func PossibleAccessKeysAuthenticationValues() []AccessKeysAuthentication {
|
||||
return []AccessKeysAuthentication{
|
||||
AccessKeysAuthenticationDisabled,
|
||||
AccessKeysAuthenticationEnabled,
|
||||
}
|
||||
}
|
||||
|
||||
// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
|
||||
type ActionType string
|
||||
|
||||
|
@ -43,7 +60,8 @@ func PossibleActionTypeValues() []ActionType {
|
|||
}
|
||||
}
|
||||
|
||||
// AofFrequency - Sets the frequency at which data is written to disk.
|
||||
// AofFrequency - Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that
|
||||
// the 'always' setting is deprecated, because of its performance impact.
|
||||
type AofFrequency string
|
||||
|
||||
const (
|
||||
|
@ -59,12 +77,17 @@ func PossibleAofFrequencyValues() []AofFrequency {
|
|||
}
|
||||
}
|
||||
|
||||
// ClusteringPolicy - Clustering policy - default is OSSCluster. Specified at create time.
|
||||
// ClusteringPolicy - Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be
|
||||
// changed without deleting the database.
|
||||
type ClusteringPolicy string
|
||||
|
||||
const (
|
||||
// ClusteringPolicyEnterpriseCluster - Enterprise clustering policy uses only the classic redis protocol, which does not support
|
||||
// redis cluster commands.
|
||||
ClusteringPolicyEnterpriseCluster ClusteringPolicy = "EnterpriseCluster"
|
||||
ClusteringPolicyOSSCluster ClusteringPolicy = "OSSCluster"
|
||||
// ClusteringPolicyOSSCluster - OSS clustering policy follows the redis cluster specification, and requires all clients to
|
||||
// support redis clustering.
|
||||
ClusteringPolicyOSSCluster ClusteringPolicy = "OSSCluster"
|
||||
)
|
||||
|
||||
// PossibleClusteringPolicyValues returns the possible values for the ClusteringPolicy const type.
|
||||
|
@ -91,6 +114,26 @@ func PossibleCmkIdentityTypeValues() []CmkIdentityType {
|
|||
}
|
||||
}
|
||||
|
||||
// CreatedByType - The type of identity that created the resource.
|
||||
type CreatedByType string
|
||||
|
||||
const (
|
||||
CreatedByTypeApplication CreatedByType = "Application"
|
||||
CreatedByTypeKey CreatedByType = "Key"
|
||||
CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
|
||||
CreatedByTypeUser CreatedByType = "User"
|
||||
)
|
||||
|
||||
// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
|
||||
func PossibleCreatedByTypeValues() []CreatedByType {
|
||||
return []CreatedByType{
|
||||
CreatedByTypeApplication,
|
||||
CreatedByTypeKey,
|
||||
CreatedByTypeManagedIdentity,
|
||||
CreatedByTypeUser,
|
||||
}
|
||||
}
|
||||
|
||||
// DeferUpgradeSetting - Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade
|
||||
type DeferUpgradeSetting string
|
||||
|
||||
|
@ -135,6 +178,23 @@ func PossibleEvictionPolicyValues() []EvictionPolicy {
|
|||
}
|
||||
}
|
||||
|
||||
// HighAvailability - Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the
|
||||
// availability SLA, and increases the risk of data loss.
|
||||
type HighAvailability string
|
||||
|
||||
const (
|
||||
HighAvailabilityDisabled HighAvailability = "Disabled"
|
||||
HighAvailabilityEnabled HighAvailability = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleHighAvailabilityValues returns the possible values for the HighAvailability const type.
|
||||
func PossibleHighAvailabilityValues() []HighAvailability {
|
||||
return []HighAvailability{
|
||||
HighAvailabilityDisabled,
|
||||
HighAvailabilityEnabled,
|
||||
}
|
||||
}
|
||||
|
||||
// LinkState - State of the link between the database resources.
|
||||
type LinkState string
|
||||
|
||||
|
@ -292,6 +352,27 @@ func PossibleRdbFrequencyValues() []RdbFrequency {
|
|||
}
|
||||
}
|
||||
|
||||
// RedundancyMode - Explains the current redundancy strategy of the cluster, which affects the expected SLA.
|
||||
type RedundancyMode string
|
||||
|
||||
const (
|
||||
// RedundancyModeLR - Local redundancy with high availability.
|
||||
RedundancyModeLR RedundancyMode = "LR"
|
||||
// RedundancyModeNone - No redundancy. Availability loss will occur.
|
||||
RedundancyModeNone RedundancyMode = "None"
|
||||
// RedundancyModeZR - Zone redundant. Higher availability.
|
||||
RedundancyModeZR RedundancyMode = "ZR"
|
||||
)
|
||||
|
||||
// PossibleRedundancyModeValues returns the possible values for the RedundancyMode const type.
|
||||
func PossibleRedundancyModeValues() []RedundancyMode {
|
||||
return []RedundancyMode{
|
||||
RedundancyModeLR,
|
||||
RedundancyModeNone,
|
||||
RedundancyModeZR,
|
||||
}
|
||||
}
|
||||
|
||||
// ResourceState - Current resource status
|
||||
type ResourceState string
|
||||
|
||||
|
@ -332,35 +413,133 @@ func PossibleResourceStateValues() []ResourceState {
|
|||
}
|
||||
}
|
||||
|
||||
// SKUName - The type of RedisEnterprise cluster to deploy. Possible values: (EnterpriseE10, EnterpriseFlashF300 etc.)
|
||||
// SKUName - The level of Redis Enterprise cluster to deploy. Possible values: ('BalancedB5', 'MemoryOptimizedM10', 'ComputeOptimized_X5',
|
||||
// etc.). For more information on SKUs see the latest pricing documentation.
|
||||
// Note that additional SKUs may become supported in the future.
|
||||
type SKUName string
|
||||
|
||||
const (
|
||||
SKUNameBalancedB0 SKUName = "Balanced_B0"
|
||||
SKUNameBalancedB1 SKUName = "Balanced_B1"
|
||||
SKUNameBalancedB10 SKUName = "Balanced_B10"
|
||||
SKUNameBalancedB100 SKUName = "Balanced_B100"
|
||||
SKUNameBalancedB1000 SKUName = "Balanced_B1000"
|
||||
SKUNameBalancedB150 SKUName = "Balanced_B150"
|
||||
SKUNameBalancedB20 SKUName = "Balanced_B20"
|
||||
SKUNameBalancedB250 SKUName = "Balanced_B250"
|
||||
SKUNameBalancedB3 SKUName = "Balanced_B3"
|
||||
SKUNameBalancedB350 SKUName = "Balanced_B350"
|
||||
SKUNameBalancedB5 SKUName = "Balanced_B5"
|
||||
SKUNameBalancedB50 SKUName = "Balanced_B50"
|
||||
SKUNameBalancedB500 SKUName = "Balanced_B500"
|
||||
SKUNameBalancedB700 SKUName = "Balanced_B700"
|
||||
SKUNameComputeOptimizedX10 SKUName = "ComputeOptimized_X10"
|
||||
SKUNameComputeOptimizedX100 SKUName = "ComputeOptimized_X100"
|
||||
SKUNameComputeOptimizedX150 SKUName = "ComputeOptimized_X150"
|
||||
SKUNameComputeOptimizedX20 SKUName = "ComputeOptimized_X20"
|
||||
SKUNameComputeOptimizedX250 SKUName = "ComputeOptimized_X250"
|
||||
SKUNameComputeOptimizedX3 SKUName = "ComputeOptimized_X3"
|
||||
SKUNameComputeOptimizedX350 SKUName = "ComputeOptimized_X350"
|
||||
SKUNameComputeOptimizedX5 SKUName = "ComputeOptimized_X5"
|
||||
SKUNameComputeOptimizedX50 SKUName = "ComputeOptimized_X50"
|
||||
SKUNameComputeOptimizedX500 SKUName = "ComputeOptimized_X500"
|
||||
SKUNameComputeOptimizedX700 SKUName = "ComputeOptimized_X700"
|
||||
SKUNameEnterpriseE1 SKUName = "Enterprise_E1"
|
||||
SKUNameEnterpriseE10 SKUName = "Enterprise_E10"
|
||||
SKUNameEnterpriseE100 SKUName = "Enterprise_E100"
|
||||
SKUNameEnterpriseE20 SKUName = "Enterprise_E20"
|
||||
SKUNameEnterpriseE200 SKUName = "Enterprise_E200"
|
||||
SKUNameEnterpriseE400 SKUName = "Enterprise_E400"
|
||||
SKUNameEnterpriseE5 SKUName = "Enterprise_E5"
|
||||
SKUNameEnterpriseE50 SKUName = "Enterprise_E50"
|
||||
SKUNameEnterpriseFlashF1500 SKUName = "EnterpriseFlash_F1500"
|
||||
SKUNameEnterpriseFlashF300 SKUName = "EnterpriseFlash_F300"
|
||||
SKUNameEnterpriseFlashF700 SKUName = "EnterpriseFlash_F700"
|
||||
SKUNameFlashOptimizedA1000 SKUName = "FlashOptimized_A1000"
|
||||
SKUNameFlashOptimizedA1500 SKUName = "FlashOptimized_A1500"
|
||||
SKUNameFlashOptimizedA2000 SKUName = "FlashOptimized_A2000"
|
||||
SKUNameFlashOptimizedA250 SKUName = "FlashOptimized_A250"
|
||||
SKUNameFlashOptimizedA4500 SKUName = "FlashOptimized_A4500"
|
||||
SKUNameFlashOptimizedA500 SKUName = "FlashOptimized_A500"
|
||||
SKUNameFlashOptimizedA700 SKUName = "FlashOptimized_A700"
|
||||
SKUNameMemoryOptimizedM10 SKUName = "MemoryOptimized_M10"
|
||||
SKUNameMemoryOptimizedM100 SKUName = "MemoryOptimized_M100"
|
||||
SKUNameMemoryOptimizedM1000 SKUName = "MemoryOptimized_M1000"
|
||||
SKUNameMemoryOptimizedM150 SKUName = "MemoryOptimized_M150"
|
||||
SKUNameMemoryOptimizedM1500 SKUName = "MemoryOptimized_M1500"
|
||||
SKUNameMemoryOptimizedM20 SKUName = "MemoryOptimized_M20"
|
||||
SKUNameMemoryOptimizedM2000 SKUName = "MemoryOptimized_M2000"
|
||||
SKUNameMemoryOptimizedM250 SKUName = "MemoryOptimized_M250"
|
||||
SKUNameMemoryOptimizedM350 SKUName = "MemoryOptimized_M350"
|
||||
SKUNameMemoryOptimizedM50 SKUName = "MemoryOptimized_M50"
|
||||
SKUNameMemoryOptimizedM500 SKUName = "MemoryOptimized_M500"
|
||||
SKUNameMemoryOptimizedM700 SKUName = "MemoryOptimized_M700"
|
||||
)
|
||||
|
||||
// PossibleSKUNameValues returns the possible values for the SKUName const type.
|
||||
func PossibleSKUNameValues() []SKUName {
|
||||
return []SKUName{
|
||||
SKUNameBalancedB0,
|
||||
SKUNameBalancedB1,
|
||||
SKUNameBalancedB10,
|
||||
SKUNameBalancedB100,
|
||||
SKUNameBalancedB1000,
|
||||
SKUNameBalancedB150,
|
||||
SKUNameBalancedB20,
|
||||
SKUNameBalancedB250,
|
||||
SKUNameBalancedB3,
|
||||
SKUNameBalancedB350,
|
||||
SKUNameBalancedB5,
|
||||
SKUNameBalancedB50,
|
||||
SKUNameBalancedB500,
|
||||
SKUNameBalancedB700,
|
||||
SKUNameComputeOptimizedX10,
|
||||
SKUNameComputeOptimizedX100,
|
||||
SKUNameComputeOptimizedX150,
|
||||
SKUNameComputeOptimizedX20,
|
||||
SKUNameComputeOptimizedX250,
|
||||
SKUNameComputeOptimizedX3,
|
||||
SKUNameComputeOptimizedX350,
|
||||
SKUNameComputeOptimizedX5,
|
||||
SKUNameComputeOptimizedX50,
|
||||
SKUNameComputeOptimizedX500,
|
||||
SKUNameComputeOptimizedX700,
|
||||
SKUNameEnterpriseE1,
|
||||
SKUNameEnterpriseE10,
|
||||
SKUNameEnterpriseE100,
|
||||
SKUNameEnterpriseE20,
|
||||
SKUNameEnterpriseE200,
|
||||
SKUNameEnterpriseE400,
|
||||
SKUNameEnterpriseE5,
|
||||
SKUNameEnterpriseE50,
|
||||
SKUNameEnterpriseFlashF1500,
|
||||
SKUNameEnterpriseFlashF300,
|
||||
SKUNameEnterpriseFlashF700,
|
||||
SKUNameFlashOptimizedA1000,
|
||||
SKUNameFlashOptimizedA1500,
|
||||
SKUNameFlashOptimizedA2000,
|
||||
SKUNameFlashOptimizedA250,
|
||||
SKUNameFlashOptimizedA4500,
|
||||
SKUNameFlashOptimizedA500,
|
||||
SKUNameFlashOptimizedA700,
|
||||
SKUNameMemoryOptimizedM10,
|
||||
SKUNameMemoryOptimizedM100,
|
||||
SKUNameMemoryOptimizedM1000,
|
||||
SKUNameMemoryOptimizedM150,
|
||||
SKUNameMemoryOptimizedM1500,
|
||||
SKUNameMemoryOptimizedM20,
|
||||
SKUNameMemoryOptimizedM2000,
|
||||
SKUNameMemoryOptimizedM250,
|
||||
SKUNameMemoryOptimizedM350,
|
||||
SKUNameMemoryOptimizedM50,
|
||||
SKUNameMemoryOptimizedM500,
|
||||
SKUNameMemoryOptimizedM700,
|
||||
}
|
||||
}
|
||||
|
||||
// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2'
|
||||
// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future.
|
||||
// Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are
|
||||
// mentioned only for the sake of consistency with old API versions.
|
||||
type TLSVersion string
|
||||
|
||||
const (
|
||||
|
|
|
@ -46,7 +46,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential
|
|||
// BeginCreate - Creates a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -73,7 +73,7 @@ func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupNam
|
|||
// Create - Creates a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) create(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginCreate"
|
||||
|
@ -119,7 +119,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -131,7 +131,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource
|
|||
// BeginDelete - Deletes a single database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -157,7 +157,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam
|
|||
// Delete - Deletes a single database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginDelete"
|
||||
|
@ -203,7 +203,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -212,7 +212,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource
|
|||
// BeginExport - Exports a database file from target database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -239,7 +239,7 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam
|
|||
// Export - Exports a database file from target database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ExportClusterParameters, options *DatabasesClientBeginExportOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginExport"
|
||||
|
@ -285,7 +285,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -297,7 +297,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource
|
|||
// BeginFlush - Flushes all the keys in this database and also from its linked databases.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -324,7 +324,7 @@ func (client *DatabasesClient) BeginFlush(ctx context.Context, resourceGroupName
|
|||
// Flush - Flushes all the keys in this database and also from its linked databases.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) flush(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters FlushParameters, options *DatabasesClientBeginFlushOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginFlush"
|
||||
|
@ -370,7 +370,7 @@ func (client *DatabasesClient) flushCreateRequest(ctx context.Context, resourceG
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -384,7 +384,7 @@ func (client *DatabasesClient) flushCreateRequest(ctx context.Context, resourceG
|
|||
// temporarily be unavailable while rejoining the replication group.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -414,7 +414,7 @@ func (client *DatabasesClient) BeginForceLinkToReplicationGroup(ctx context.Cont
|
|||
// temporarily be unavailable while rejoining the replication group.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) forceLinkToReplicationGroup(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceLinkParameters, options *DatabasesClientBeginForceLinkToReplicationGroupOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginForceLinkToReplicationGroup"
|
||||
|
@ -460,7 +460,7 @@ func (client *DatabasesClient) forceLinkToReplicationGroupCreateRequest(ctx cont
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -472,7 +472,7 @@ func (client *DatabasesClient) forceLinkToReplicationGroupCreateRequest(ctx cont
|
|||
// BeginForceUnlink - Forcibly removes the link to the specified database resource.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -500,7 +500,7 @@ func (client *DatabasesClient) BeginForceUnlink(ctx context.Context, resourceGro
|
|||
// ForceUnlink - Forcibly removes the link to the specified database resource.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) forceUnlink(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceUnlinkParameters, options *DatabasesClientBeginForceUnlinkOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginForceUnlink"
|
||||
|
@ -546,7 +546,7 @@ func (client *DatabasesClient) forceUnlinkCreateRequest(ctx context.Context, res
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -555,10 +555,10 @@ func (client *DatabasesClient) forceUnlinkCreateRequest(ctx context.Context, res
|
|||
return req, nil
|
||||
}
|
||||
|
||||
// Get - Gets information about a database in a RedisEnterprise cluster.
|
||||
// Get - Gets information about a database in a Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -609,7 +609,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -627,7 +627,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases
|
|||
// BeginImport - Imports database files to target database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -654,7 +654,7 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam
|
|||
// Import - Imports database files to target database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ImportClusterParameters, options *DatabasesClientBeginImportOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginImport"
|
||||
|
@ -700,7 +700,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -709,9 +709,9 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource
|
|||
return req, nil
|
||||
}
|
||||
|
||||
// NewListByClusterPager - Gets all databases in the specified RedisEnterprise cluster.
|
||||
// NewListByClusterPager - Gets all databases in the specified Redis Enterprise cluster.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - options - DatabasesClientListByClusterOptions contains the optional parameters for the DatabasesClient.NewListByClusterPager
|
||||
|
@ -759,7 +759,7 @@ func (client *DatabasesClient) listByClusterCreateRequest(ctx context.Context, r
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -774,10 +774,10 @@ func (client *DatabasesClient) listByClusterHandleResponse(resp *http.Response)
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// ListKeys - Retrieves the access keys for the RedisEnterprise database.
|
||||
// ListKeys - Retrieves the access keys for the Redis Enterprise database.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -828,7 +828,7 @@ func (client *DatabasesClient) listKeysCreateRequest(ctx context.Context, resour
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -843,10 +843,10 @@ func (client *DatabasesClient) listKeysHandleResponse(resp *http.Response) (Data
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// BeginRegenerateKey - Regenerates the RedisEnterprise database's access keys.
|
||||
// BeginRegenerateKey - Regenerates the Redis Enterprise database's access keys.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -871,10 +871,10 @@ func (client *DatabasesClient) BeginRegenerateKey(ctx context.Context, resourceG
|
|||
}
|
||||
}
|
||||
|
||||
// RegenerateKey - Regenerates the RedisEnterprise database's access keys.
|
||||
// RegenerateKey - Regenerates the Redis Enterprise database's access keys.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) regenerateKey(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters RegenerateKeyParameters, options *DatabasesClientBeginRegenerateKeyOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginRegenerateKey"
|
||||
|
@ -920,7 +920,7 @@ func (client *DatabasesClient) regenerateKeyCreateRequest(ctx context.Context, r
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -932,7 +932,7 @@ func (client *DatabasesClient) regenerateKeyCreateRequest(ctx context.Context, r
|
|||
// BeginUpdate - Updates a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -959,7 +959,7 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam
|
|||
// Update - Updates a database
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginUpdate"
|
||||
|
@ -1005,7 +1005,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
|
||||
|
@ -1017,7 +1017,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource
|
|||
// BeginUpgradeDBRedisVersion - Upgrades the database Redis version to the latest available.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - databaseName - The name of the Redis Enterprise database.
|
||||
|
@ -1044,7 +1044,7 @@ func (client *DatabasesClient) BeginUpgradeDBRedisVersion(ctx context.Context, r
|
|||
// UpgradeDBRedisVersion - Upgrades the database Redis version to the latest available.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *DatabasesClient) upgradeDBRedisVersion(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginUpgradeDBRedisVersionOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "DatabasesClient.BeginUpgradeDBRedisVersion"
|
||||
|
@ -1090,7 +1090,7 @@ func (client *DatabasesClient) upgradeDBRedisVersionCreateRequest(ctx context.Co
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesListByCluster.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesListByCluster.json
|
||||
func ExampleDatabasesClient_NewListByClusterPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -45,7 +45,7 @@ func ExampleDatabasesClient_NewListByClusterPager() {
|
|||
// {
|
||||
// Name: to.Ptr("cache1/default"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// Properties: &armredisenterprise.DatabaseProperties{
|
||||
// ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
// ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster),
|
||||
|
@ -71,7 +71,7 @@ func ExampleDatabasesClient_NewListByClusterPager() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesCreate.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesCreate.json
|
||||
func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -84,10 +84,11 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() {
|
|||
}
|
||||
poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "rg1", "cache1", "default", armredisenterprise.Database{
|
||||
Properties: &armredisenterprise.DatabaseProperties{
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU),
|
||||
AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU),
|
||||
Modules: []*armredisenterprise.Module{
|
||||
{
|
||||
Name: to.Ptr("RedisBloom"),
|
||||
|
@ -120,8 +121,9 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() {
|
|||
// res.Database = armredisenterprise.Database{
|
||||
// Name: to.Ptr("cache1/default"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// Properties: &armredisenterprise.DatabaseProperties{
|
||||
// AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
// ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
// ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
// DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
|
@ -154,7 +156,7 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json
|
||||
func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActiveGeoReplication() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -167,17 +169,18 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActive
|
|||
}
|
||||
poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "rg1", "cache1", "default", armredisenterprise.Database{
|
||||
Properties: &armredisenterprise.DatabaseProperties{
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction),
|
||||
AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction),
|
||||
GeoReplication: &armredisenterprise.DatabasePropertiesGeoReplication{
|
||||
GroupNickname: to.Ptr("groupName"),
|
||||
LinkedDatabases: []*armredisenterprise.LinkedDatabase{
|
||||
{
|
||||
ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
},
|
||||
{
|
||||
ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"),
|
||||
ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"),
|
||||
}},
|
||||
},
|
||||
Port: to.Ptr[int32](10000),
|
||||
|
@ -196,8 +199,9 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActive
|
|||
// res.Database = armredisenterprise.Database{
|
||||
// Name: to.Ptr("cache1/default"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"),
|
||||
// ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// Properties: &armredisenterprise.DatabaseProperties{
|
||||
// AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
// ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
// ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster),
|
||||
// DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
|
@ -206,11 +210,11 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActive
|
|||
// GroupNickname: to.Ptr("groupName"),
|
||||
// LinkedDatabases: []*armredisenterprise.LinkedDatabase{
|
||||
// {
|
||||
// ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// State: to.Ptr(armredisenterprise.LinkStateLinking),
|
||||
// },
|
||||
// {
|
||||
// ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"),
|
||||
// State: to.Ptr(armredisenterprise.LinkStateLinking),
|
||||
// }},
|
||||
// },
|
||||
|
@ -222,7 +226,7 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActive
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesUpdate.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesUpdate.json
|
||||
func ExampleDatabasesClient_BeginUpdate() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -235,8 +239,9 @@ func ExampleDatabasesClient_BeginUpdate() {
|
|||
}
|
||||
poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "rg1", "cache1", "default", armredisenterprise.DatabaseUpdate{
|
||||
Properties: &armredisenterprise.DatabaseProperties{
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU),
|
||||
AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU),
|
||||
Persistence: &armredisenterprise.Persistence{
|
||||
RdbEnabled: to.Ptr(true),
|
||||
RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH),
|
||||
|
@ -256,8 +261,9 @@ func ExampleDatabasesClient_BeginUpdate() {
|
|||
// res.Database = armredisenterprise.Database{
|
||||
// Name: to.Ptr("cache1/default"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// Properties: &armredisenterprise.DatabaseProperties{
|
||||
// AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
// ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
// ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster),
|
||||
// DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
|
@ -280,7 +286,7 @@ func ExampleDatabasesClient_BeginUpdate() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesGet.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesGet.json
|
||||
func ExampleDatabasesClient_Get() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -301,8 +307,9 @@ func ExampleDatabasesClient_Get() {
|
|||
// res.Database = armredisenterprise.Database{
|
||||
// Name: to.Ptr("cache1/default"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"),
|
||||
// Properties: &armredisenterprise.DatabaseProperties{
|
||||
// AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled),
|
||||
// ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted),
|
||||
// ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster),
|
||||
// DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred),
|
||||
|
@ -325,7 +332,7 @@ func ExampleDatabasesClient_Get() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesDelete.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesDelete.json
|
||||
func ExampleDatabasesClient_BeginDelete() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -346,7 +353,7 @@ func ExampleDatabasesClient_BeginDelete() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesListKeys.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesListKeys.json
|
||||
func ExampleDatabasesClient_ListKeys() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -370,7 +377,7 @@ func ExampleDatabasesClient_ListKeys() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesRegenerateKey.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesRegenerateKey.json
|
||||
func ExampleDatabasesClient_BeginRegenerateKey() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -400,7 +407,7 @@ func ExampleDatabasesClient_BeginRegenerateKey() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesImport.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesImport.json
|
||||
func ExampleDatabasesClient_BeginImport() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -425,7 +432,7 @@ func ExampleDatabasesClient_BeginImport() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesExport.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesExport.json
|
||||
func ExampleDatabasesClient_BeginExport() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -448,7 +455,7 @@ func ExampleDatabasesClient_BeginExport() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesForceUnlink.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesForceUnlink.json
|
||||
func ExampleDatabasesClient_BeginForceUnlink() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -461,7 +468,7 @@ func ExampleDatabasesClient_BeginForceUnlink() {
|
|||
}
|
||||
poller, err := clientFactory.NewDatabasesClient().BeginForceUnlink(ctx, "rg1", "cache1", "default", armredisenterprise.ForceUnlinkParameters{
|
||||
IDs: []*string{
|
||||
to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")},
|
||||
to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")},
|
||||
}, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to finish the request: %v", err)
|
||||
|
@ -472,7 +479,7 @@ func ExampleDatabasesClient_BeginForceUnlink() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesForceLink.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesForceLink.json
|
||||
func ExampleDatabasesClient_BeginForceLinkToReplicationGroup() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -502,7 +509,7 @@ func ExampleDatabasesClient_BeginForceLinkToReplicationGroup() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesFlush.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesFlush.json
|
||||
func ExampleDatabasesClient_BeginFlush() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -515,7 +522,7 @@ func ExampleDatabasesClient_BeginFlush() {
|
|||
}
|
||||
poller, err := clientFactory.NewDatabasesClient().BeginFlush(ctx, "rg1", "cache1", "default", armredisenterprise.FlushParameters{
|
||||
IDs: []*string{
|
||||
to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")},
|
||||
to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")},
|
||||
}, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to finish the request: %v", err)
|
||||
|
@ -526,7 +533,7 @@ func ExampleDatabasesClient_BeginFlush() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json
|
||||
func ExampleDatabasesClient_BeginUpgradeDBRedisVersion() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
|
|
@ -0,0 +1,288 @@
|
|||
//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. DO NOT EDIT.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
// AccessPolicyAssignmentServer is a fake server for instances of the armredisenterprise.AccessPolicyAssignmentClient type.
|
||||
type AccessPolicyAssignmentServer struct {
|
||||
// BeginCreateUpdate is the fake for method AccessPolicyAssignmentClient.BeginCreateUpdate
|
||||
// HTTP status codes to indicate success: http.StatusOK, http.StatusCreated
|
||||
BeginCreateUpdate func(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, parameters armredisenterprise.AccessPolicyAssignment, options *armredisenterprise.AccessPolicyAssignmentClientBeginCreateUpdateOptions) (resp azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientCreateUpdateResponse], errResp azfake.ErrorResponder)
|
||||
|
||||
// BeginDelete is the fake for method AccessPolicyAssignmentClient.BeginDelete
|
||||
// HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent
|
||||
BeginDelete func(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *armredisenterprise.AccessPolicyAssignmentClientBeginDeleteOptions) (resp azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientDeleteResponse], errResp azfake.ErrorResponder)
|
||||
|
||||
// Get is the fake for method AccessPolicyAssignmentClient.Get
|
||||
// HTTP status codes to indicate success: http.StatusOK
|
||||
Get func(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *armredisenterprise.AccessPolicyAssignmentClientGetOptions) (resp azfake.Responder[armredisenterprise.AccessPolicyAssignmentClientGetResponse], errResp azfake.ErrorResponder)
|
||||
|
||||
// NewListPager is the fake for method AccessPolicyAssignmentClient.NewListPager
|
||||
// HTTP status codes to indicate success: http.StatusOK
|
||||
NewListPager func(resourceGroupName string, clusterName string, databaseName string, options *armredisenterprise.AccessPolicyAssignmentClientListOptions) (resp azfake.PagerResponder[armredisenterprise.AccessPolicyAssignmentClientListResponse])
|
||||
}
|
||||
|
||||
// NewAccessPolicyAssignmentServerTransport creates a new instance of AccessPolicyAssignmentServerTransport with the provided implementation.
|
||||
// The returned AccessPolicyAssignmentServerTransport instance is connected to an instance of armredisenterprise.AccessPolicyAssignmentClient via the
|
||||
// azcore.ClientOptions.Transporter field in the client's constructor parameters.
|
||||
func NewAccessPolicyAssignmentServerTransport(srv *AccessPolicyAssignmentServer) *AccessPolicyAssignmentServerTransport {
|
||||
return &AccessPolicyAssignmentServerTransport{
|
||||
srv: srv,
|
||||
beginCreateUpdate: newTracker[azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientCreateUpdateResponse]](),
|
||||
beginDelete: newTracker[azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientDeleteResponse]](),
|
||||
newListPager: newTracker[azfake.PagerResponder[armredisenterprise.AccessPolicyAssignmentClientListResponse]](),
|
||||
}
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentServerTransport connects instances of armredisenterprise.AccessPolicyAssignmentClient to instances of AccessPolicyAssignmentServer.
|
||||
// Don't use this type directly, use NewAccessPolicyAssignmentServerTransport instead.
|
||||
type AccessPolicyAssignmentServerTransport struct {
|
||||
srv *AccessPolicyAssignmentServer
|
||||
beginCreateUpdate *tracker[azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientCreateUpdateResponse]]
|
||||
beginDelete *tracker[azfake.PollerResponder[armredisenterprise.AccessPolicyAssignmentClientDeleteResponse]]
|
||||
newListPager *tracker[azfake.PagerResponder[armredisenterprise.AccessPolicyAssignmentClientListResponse]]
|
||||
}
|
||||
|
||||
// Do implements the policy.Transporter interface for AccessPolicyAssignmentServerTransport.
|
||||
func (a *AccessPolicyAssignmentServerTransport) Do(req *http.Request) (*http.Response, error) {
|
||||
rawMethod := req.Context().Value(runtime.CtxAPINameKey{})
|
||||
method, ok := rawMethod.(string)
|
||||
if !ok {
|
||||
return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")}
|
||||
}
|
||||
|
||||
var resp *http.Response
|
||||
var err error
|
||||
|
||||
switch method {
|
||||
case "AccessPolicyAssignmentClient.BeginCreateUpdate":
|
||||
resp, err = a.dispatchBeginCreateUpdate(req)
|
||||
case "AccessPolicyAssignmentClient.BeginDelete":
|
||||
resp, err = a.dispatchBeginDelete(req)
|
||||
case "AccessPolicyAssignmentClient.Get":
|
||||
resp, err = a.dispatchGet(req)
|
||||
case "AccessPolicyAssignmentClient.NewListPager":
|
||||
resp, err = a.dispatchNewListPager(req)
|
||||
default:
|
||||
err = fmt.Errorf("unhandled API %s", method)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (a *AccessPolicyAssignmentServerTransport) dispatchBeginCreateUpdate(req *http.Request) (*http.Response, error) {
|
||||
if a.srv.BeginCreateUpdate == nil {
|
||||
return nil, &nonRetriableError{errors.New("fake for method BeginCreateUpdate not implemented")}
|
||||
}
|
||||
beginCreateUpdate := a.beginCreateUpdate.get(req)
|
||||
if beginCreateUpdate == nil {
|
||||
const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P<clusterName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P<databaseName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessPolicyAssignments/(?P<accessPolicyAssignmentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
|
||||
regex := regexp.MustCompile(regexStr)
|
||||
matches := regex.FindStringSubmatch(req.URL.EscapedPath())
|
||||
if matches == nil || len(matches) < 5 {
|
||||
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
|
||||
}
|
||||
body, err := server.UnmarshalRequestAsJSON[armredisenterprise.AccessPolicyAssignment](req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
accessPolicyAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessPolicyAssignmentName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
respr, errRespr := a.srv.BeginCreateUpdate(req.Context(), resourceGroupNameParam, clusterNameParam, databaseNameParam, accessPolicyAssignmentNameParam, body, nil)
|
||||
if respErr := server.GetError(errRespr, req); respErr != nil {
|
||||
return nil, respErr
|
||||
}
|
||||
beginCreateUpdate = &respr
|
||||
a.beginCreateUpdate.add(req, beginCreateUpdate)
|
||||
}
|
||||
|
||||
resp, err := server.PollerResponderNext(beginCreateUpdate, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) {
|
||||
a.beginCreateUpdate.remove(req)
|
||||
return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)}
|
||||
}
|
||||
if !server.PollerResponderMore(beginCreateUpdate) {
|
||||
a.beginCreateUpdate.remove(req)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (a *AccessPolicyAssignmentServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) {
|
||||
if a.srv.BeginDelete == nil {
|
||||
return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")}
|
||||
}
|
||||
beginDelete := a.beginDelete.get(req)
|
||||
if beginDelete == nil {
|
||||
const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P<clusterName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P<databaseName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessPolicyAssignments/(?P<accessPolicyAssignmentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
|
||||
regex := regexp.MustCompile(regexStr)
|
||||
matches := regex.FindStringSubmatch(req.URL.EscapedPath())
|
||||
if matches == nil || len(matches) < 5 {
|
||||
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
|
||||
}
|
||||
resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
accessPolicyAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessPolicyAssignmentName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, clusterNameParam, databaseNameParam, accessPolicyAssignmentNameParam, nil)
|
||||
if respErr := server.GetError(errRespr, req); respErr != nil {
|
||||
return nil, respErr
|
||||
}
|
||||
beginDelete = &respr
|
||||
a.beginDelete.add(req, beginDelete)
|
||||
}
|
||||
|
||||
resp, err := server.PollerResponderNext(beginDelete, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) {
|
||||
a.beginDelete.remove(req)
|
||||
return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)}
|
||||
}
|
||||
if !server.PollerResponderMore(beginDelete) {
|
||||
a.beginDelete.remove(req)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (a *AccessPolicyAssignmentServerTransport) dispatchGet(req *http.Request) (*http.Response, error) {
|
||||
if a.srv.Get == nil {
|
||||
return nil, &nonRetriableError{errors.New("fake for method Get not implemented")}
|
||||
}
|
||||
const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P<clusterName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P<databaseName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessPolicyAssignments/(?P<accessPolicyAssignmentName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)`
|
||||
regex := regexp.MustCompile(regexStr)
|
||||
matches := regex.FindStringSubmatch(req.URL.EscapedPath())
|
||||
if matches == nil || len(matches) < 5 {
|
||||
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
|
||||
}
|
||||
resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
accessPolicyAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessPolicyAssignmentName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, clusterNameParam, databaseNameParam, accessPolicyAssignmentNameParam, nil)
|
||||
if respErr := server.GetError(errRespr, req); respErr != nil {
|
||||
return nil, respErr
|
||||
}
|
||||
respContent := server.GetResponseContent(respr)
|
||||
if !contains([]int{http.StatusOK}, respContent.HTTPStatus) {
|
||||
return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)}
|
||||
}
|
||||
resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AccessPolicyAssignment, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (a *AccessPolicyAssignmentServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) {
|
||||
if a.srv.NewListPager == nil {
|
||||
return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")}
|
||||
}
|
||||
newListPager := a.newListPager.get(req)
|
||||
if newListPager == nil {
|
||||
const regexStr = `/subscriptions/(?P<subscriptionId>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P<resourceGroupName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P<clusterName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P<databaseName>[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessPolicyAssignments`
|
||||
regex := regexp.MustCompile(regexStr)
|
||||
matches := regex.FindStringSubmatch(req.URL.EscapedPath())
|
||||
if matches == nil || len(matches) < 4 {
|
||||
return nil, fmt.Errorf("failed to parse path %s", req.URL.Path)
|
||||
}
|
||||
resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp := a.srv.NewListPager(resourceGroupNameParam, clusterNameParam, databaseNameParam, nil)
|
||||
newListPager = &resp
|
||||
a.newListPager.add(req, newListPager)
|
||||
server.PagerResponderInjectNextLinks(newListPager, req, func(page *armredisenterprise.AccessPolicyAssignmentClientListResponse, createLink func() string) {
|
||||
page.NextLink = to.Ptr(createLink())
|
||||
})
|
||||
}
|
||||
resp, err := server.PagerResponderNext(newListPager, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !contains([]int{http.StatusOK}, resp.StatusCode) {
|
||||
a.newListPager.remove(req)
|
||||
return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)}
|
||||
}
|
||||
if !server.PagerResponderMore(newListPager) {
|
||||
a.newListPager.remove(req)
|
||||
}
|
||||
return resp, nil
|
||||
}
|
|
@ -19,6 +19,7 @@ import (
|
|||
|
||||
// ServerFactory is a fake server for instances of the armredisenterprise.ClientFactory type.
|
||||
type ServerFactory struct {
|
||||
AccessPolicyAssignmentServer AccessPolicyAssignmentServer
|
||||
Server Server
|
||||
DatabasesServer DatabasesServer
|
||||
OperationsServer OperationsServer
|
||||
|
@ -41,6 +42,7 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport {
|
|||
type ServerFactoryTransport struct {
|
||||
srv *ServerFactory
|
||||
trMu sync.Mutex
|
||||
trAccessPolicyAssignmentServer *AccessPolicyAssignmentServerTransport
|
||||
trServer *ServerTransport
|
||||
trDatabasesServer *DatabasesServerTransport
|
||||
trOperationsServer *OperationsServerTransport
|
||||
|
@ -62,6 +64,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) {
|
|||
var err error
|
||||
|
||||
switch client {
|
||||
case "AccessPolicyAssignmentClient":
|
||||
initServer(s, &s.trAccessPolicyAssignmentServer, func() *AccessPolicyAssignmentServerTransport {
|
||||
return NewAccessPolicyAssignmentServerTransport(&s.srv.AccessPolicyAssignmentServer)
|
||||
})
|
||||
resp, err = s.trAccessPolicyAssignmentServer.Do(req)
|
||||
case "Client":
|
||||
initServer(s, &s.trServer, func() *ServerTransport { return NewServerTransport(&s.srv.Server) })
|
||||
resp, err = s.trServer.Do(req)
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
//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. DO NOT EDIT.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
|
||||
var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
|
||||
|
||||
const (
|
||||
utcDateTime = "2006-01-02T15:04:05.999999999"
|
||||
utcDateTimeJSON = `"` + utcDateTime + `"`
|
||||
utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
|
||||
utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
|
||||
dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
|
||||
dateTimeJSON = `"` + time.RFC3339Nano + `"`
|
||||
dateTimeJSONNoT = `"` + dateTimeNoT + `"`
|
||||
)
|
||||
|
||||
type dateTimeRFC3339 time.Time
|
||||
|
||||
func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
|
||||
tt := time.Time(t)
|
||||
return tt.MarshalJSON()
|
||||
}
|
||||
|
||||
func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
|
||||
tt := time.Time(t)
|
||||
return tt.MarshalText()
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
|
||||
tzOffset := tzOffsetRegex.Match(data)
|
||||
hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
|
||||
var layout string
|
||||
if tzOffset && hasT {
|
||||
layout = dateTimeJSON
|
||||
} else if tzOffset {
|
||||
layout = dateTimeJSONNoT
|
||||
} else if hasT {
|
||||
layout = utcDateTimeJSON
|
||||
} else {
|
||||
layout = utcDateTimeJSONNoT
|
||||
}
|
||||
return t.Parse(layout, string(data))
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
|
||||
tzOffset := tzOffsetRegex.Match(data)
|
||||
hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
|
||||
var layout string
|
||||
if tzOffset && hasT {
|
||||
layout = time.RFC3339Nano
|
||||
} else if tzOffset {
|
||||
layout = dateTimeNoT
|
||||
} else if hasT {
|
||||
layout = utcDateTime
|
||||
} else {
|
||||
layout = utcDateTimeNoT
|
||||
}
|
||||
return t.Parse(layout, string(data))
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) Parse(layout, value string) error {
|
||||
p, err := time.Parse(layout, strings.ToUpper(value))
|
||||
*t = dateTimeRFC3339(p)
|
||||
return err
|
||||
}
|
||||
|
||||
func (t dateTimeRFC3339) String() string {
|
||||
return time.Time(t).Format(time.RFC3339Nano)
|
||||
}
|
||||
|
||||
func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
|
||||
if t == nil {
|
||||
return
|
||||
} else if azcore.IsNullValue(t) {
|
||||
m[k] = nil
|
||||
return
|
||||
} else if reflect.ValueOf(t).IsNil() {
|
||||
return
|
||||
}
|
||||
m[k] = (*dateTimeRFC3339)(t)
|
||||
}
|
||||
|
||||
func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
|
||||
if data == nil || string(data) == "null" {
|
||||
return nil
|
||||
}
|
||||
var aux dateTimeRFC3339
|
||||
if err := json.Unmarshal(data, &aux); err != nil {
|
||||
return fmt.Errorf("struct field %s: %v", fn, err)
|
||||
}
|
||||
*t = (*time.Time)(&aux)
|
||||
return nil
|
||||
}
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
package armredisenterprise
|
||||
|
||||
import "time"
|
||||
|
||||
// AccessKeys - The secret access keys used for authenticating connections to redis
|
||||
type AccessKeys struct {
|
||||
// READ-ONLY; The current primary key that clients can use to authenticate
|
||||
|
@ -17,7 +19,49 @@ type AccessKeys struct {
|
|||
SecondaryKey *string
|
||||
}
|
||||
|
||||
// Cluster - Describes the RedisEnterprise cluster
|
||||
// AccessPolicyAssignment - Describes the access policy assignment of Redis Enterprise database
|
||||
type AccessPolicyAssignment struct {
|
||||
// Properties of the access policy assignment.
|
||||
Properties *AccessPolicyAssignmentProperties
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentList - The response of a list-all operation.
|
||||
type AccessPolicyAssignmentList struct {
|
||||
// List of access policy assignments.
|
||||
Value []*AccessPolicyAssignment
|
||||
|
||||
// READ-ONLY; The URI to fetch the next page of results.
|
||||
NextLink *string
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentProperties - Properties of Redis Enterprise database access policy assignment.
|
||||
type AccessPolicyAssignmentProperties struct {
|
||||
// REQUIRED; Name of access policy under specific access policy assignment. Only "default" policy is supported for now.
|
||||
AccessPolicyName *string
|
||||
|
||||
// REQUIRED; The user associated with the access policy.
|
||||
User *AccessPolicyAssignmentPropertiesUser
|
||||
|
||||
// READ-ONLY; Current provisioning status of the access policy assignment.
|
||||
ProvisioningState *ProvisioningState
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentPropertiesUser - The user associated with the access policy.
|
||||
type AccessPolicyAssignmentPropertiesUser struct {
|
||||
// The object ID of the user.
|
||||
ObjectID *string
|
||||
}
|
||||
|
||||
// Cluster - Describes the Redis Enterprise cluster
|
||||
type Cluster struct {
|
||||
// REQUIRED; The geo-location where the resource lives
|
||||
Location *string
|
||||
|
@ -56,18 +100,24 @@ type ClusterList struct {
|
|||
NextLink *string
|
||||
}
|
||||
|
||||
// ClusterProperties - Properties of RedisEnterprise clusters, as opposed to general resource properties like location, tags
|
||||
// ClusterProperties - Properties of Redis Enterprise clusters, as opposed to general resource properties like location, tags
|
||||
type ClusterProperties struct {
|
||||
// Encryption-at-rest configuration for the cluster.
|
||||
Encryption *ClusterPropertiesEncryption
|
||||
|
||||
// The minimum TLS version for the cluster to support, e.g. '1.2'
|
||||
// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA,
|
||||
// and increases the risk of data loss.
|
||||
HighAvailability *HighAvailability
|
||||
|
||||
// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS
|
||||
// 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are
|
||||
// mentioned only for the sake of consistency with old API versions.
|
||||
MinimumTLSVersion *TLSVersion
|
||||
|
||||
// READ-ONLY; DNS name of the cluster endpoint
|
||||
HostName *string
|
||||
|
||||
// READ-ONLY; List of private endpoint connections associated with the specified RedisEnterprise cluster
|
||||
// READ-ONLY; List of private endpoint connections associated with the specified Redis Enterprise cluster
|
||||
PrivateEndpointConnections []*PrivateEndpointConnection
|
||||
|
||||
// READ-ONLY; Current provisioning status of the cluster
|
||||
|
@ -76,6 +126,9 @@ type ClusterProperties struct {
|
|||
// READ-ONLY; Version of redis the cluster supports, e.g. '6'
|
||||
RedisVersion *string
|
||||
|
||||
// READ-ONLY; Explains the current redundancy strategy of the cluster, which affects the expected SLA.
|
||||
RedundancyMode *RedundancyMode
|
||||
|
||||
// READ-ONLY; Current resource status of the cluster
|
||||
ResourceState *ResourceState
|
||||
}
|
||||
|
@ -107,7 +160,7 @@ type ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity struct {
|
|||
UserAssignedIdentityResourceID *string
|
||||
}
|
||||
|
||||
// ClusterUpdate - A partial update to the RedisEnterprise cluster
|
||||
// ClusterUpdate - A partial update to the Redis Enterprise cluster
|
||||
type ClusterUpdate struct {
|
||||
// The identity of the resource.
|
||||
Identity *ManagedServiceIdentity
|
||||
|
@ -122,7 +175,7 @@ type ClusterUpdate struct {
|
|||
Tags map[string]*string
|
||||
}
|
||||
|
||||
// Database - Describes a database on the RedisEnterprise cluster
|
||||
// Database - Describes a database on the Redis Enterprise cluster
|
||||
type Database struct {
|
||||
// Other properties of the database.
|
||||
Properties *DatabaseProperties
|
||||
|
@ -133,6 +186,9 @@ type Database struct {
|
|||
// READ-ONLY; The name of the resource
|
||||
Name *string
|
||||
|
||||
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
||||
SystemData *SystemData
|
||||
|
||||
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string
|
||||
}
|
||||
|
@ -146,13 +202,18 @@ type DatabaseList struct {
|
|||
NextLink *string
|
||||
}
|
||||
|
||||
// DatabaseProperties - Properties of RedisEnterprise databases, as opposed to general resource properties like location,
|
||||
// DatabaseProperties - Properties of Redis Enterprise databases, as opposed to general resource properties like location,
|
||||
// tags
|
||||
type DatabaseProperties struct {
|
||||
// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database
|
||||
// is created.
|
||||
AccessKeysAuthentication *AccessKeysAuthentication
|
||||
|
||||
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted.
|
||||
ClientProtocol *Protocol
|
||||
|
||||
// Clustering policy - default is OSSCluster. Specified at create time.
|
||||
// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting
|
||||
// the database.
|
||||
ClusteringPolicy *ClusteringPolicy
|
||||
|
||||
// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade
|
||||
|
@ -192,7 +253,7 @@ type DatabasePropertiesGeoReplication struct {
|
|||
LinkedDatabases []*LinkedDatabase
|
||||
}
|
||||
|
||||
// DatabaseUpdate - A partial update to the RedisEnterprise database
|
||||
// DatabaseUpdate - A partial update to the Redis Enterprise database
|
||||
type DatabaseUpdate struct {
|
||||
// Properties of the database.
|
||||
Properties *DatabaseProperties
|
||||
|
@ -256,7 +317,7 @@ type ForceLinkParameters struct {
|
|||
LinkedDatabases []*LinkedDatabase
|
||||
}
|
||||
|
||||
// ForceUnlinkParameters - Parameters for a Redis Enterprise Active Geo Replication Force Unlink operation.
|
||||
// ForceUnlinkParameters - Parameters for a redis enterprise active geo-replication force unlink operation.
|
||||
type ForceUnlinkParameters struct {
|
||||
// REQUIRED; The resource IDs of the database resources to be unlinked.
|
||||
IDs []*string
|
||||
|
@ -379,15 +440,16 @@ type OperationStatus struct {
|
|||
Status *string
|
||||
}
|
||||
|
||||
// Persistence-related configuration for the RedisEnterprise database
|
||||
// Persistence-related configuration for the Redis Enterprise database
|
||||
type Persistence struct {
|
||||
// Sets whether AOF is enabled.
|
||||
// Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled.
|
||||
AofEnabled *bool
|
||||
|
||||
// Sets the frequency at which data is written to disk.
|
||||
// Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting
|
||||
// is deprecated, because of its performance impact.
|
||||
AofFrequency *AofFrequency
|
||||
|
||||
// Sets whether RDB is enabled.
|
||||
// Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled.
|
||||
RdbEnabled *bool
|
||||
|
||||
// Sets the frequency at which a snapshot of the database is created.
|
||||
|
@ -488,6 +550,22 @@ type ProxyResource struct {
|
|||
// READ-ONLY; The name of the resource
|
||||
Name *string
|
||||
|
||||
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
||||
SystemData *SystemData
|
||||
|
||||
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string
|
||||
}
|
||||
|
||||
// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have
|
||||
// tags and a location
|
||||
type ProxyResourceAutoGenerated struct {
|
||||
// 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
|
||||
}
|
||||
|
@ -510,16 +588,54 @@ type Resource struct {
|
|||
Type *string
|
||||
}
|
||||
|
||||
// SKU parameters supplied to the create RedisEnterprise operation.
|
||||
// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources
|
||||
type ResourceAutoGenerated struct {
|
||||
// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
||||
SystemData *SystemData
|
||||
|
||||
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string
|
||||
}
|
||||
|
||||
// SKU parameters supplied to the create Redis Enterprise cluster operation.
|
||||
type SKU struct {
|
||||
// REQUIRED; The type of RedisEnterprise cluster to deploy. Possible values: (EnterpriseE10, EnterpriseFlashF300 etc.)
|
||||
// REQUIRED; The level of Redis Enterprise cluster to deploy. Possible values: ('BalancedB5', 'MemoryOptimizedM10', 'ComputeOptimized_X5',
|
||||
// etc.). For more information on SKUs see the latest pricing documentation.
|
||||
// Note that additional SKUs may become supported in the future.
|
||||
Name *SKUName
|
||||
|
||||
// The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are (2, 4, 6, …) for Enterprise
|
||||
// SKUs and (3, 9, 15, …) for Flash SKUs.
|
||||
// This property is only used with Enterprise and EnterpriseFlash SKUs. Determines the size of the cluster. Valid values are
|
||||
// (2, 4, 6, …) for Enterprise SKUs and (3, 9, 15, …) for EnterpriseFlash SKUs.
|
||||
Capacity *int32
|
||||
}
|
||||
|
||||
// SystemData - Metadata pertaining to creation and last modification of the resource.
|
||||
type SystemData struct {
|
||||
// The timestamp of resource creation (UTC).
|
||||
CreatedAt *time.Time
|
||||
|
||||
// The identity that created the resource.
|
||||
CreatedBy *string
|
||||
|
||||
// The type of identity that created the resource.
|
||||
CreatedByType *CreatedByType
|
||||
|
||||
// The timestamp of resource last modification (UTC)
|
||||
LastModifiedAt *time.Time
|
||||
|
||||
// The identity that last modified the resource.
|
||||
LastModifiedBy *string
|
||||
|
||||
// The type of identity that last modified the resource.
|
||||
LastModifiedByType *CreatedByType
|
||||
}
|
||||
|
||||
// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags'
|
||||
// and a 'location'
|
||||
type TrackedResource struct {
|
||||
|
|
|
@ -46,6 +46,138 @@ func (a *AccessKeys) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type AccessPolicyAssignment.
|
||||
func (a AccessPolicyAssignment) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "id", a.ID)
|
||||
populate(objectMap, "name", a.Name)
|
||||
populate(objectMap, "properties", a.Properties)
|
||||
populate(objectMap, "type", a.Type)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyAssignment.
|
||||
func (a *AccessPolicyAssignment) 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", a, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "id":
|
||||
err = unpopulate(val, "ID", &a.ID)
|
||||
delete(rawMsg, key)
|
||||
case "name":
|
||||
err = unpopulate(val, "Name", &a.Name)
|
||||
delete(rawMsg, key)
|
||||
case "properties":
|
||||
err = unpopulate(val, "Properties", &a.Properties)
|
||||
delete(rawMsg, key)
|
||||
case "type":
|
||||
err = unpopulate(val, "Type", &a.Type)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", a, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type AccessPolicyAssignmentList.
|
||||
func (a AccessPolicyAssignmentList) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "nextLink", a.NextLink)
|
||||
populate(objectMap, "value", a.Value)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyAssignmentList.
|
||||
func (a *AccessPolicyAssignmentList) 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", a, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "nextLink":
|
||||
err = unpopulate(val, "NextLink", &a.NextLink)
|
||||
delete(rawMsg, key)
|
||||
case "value":
|
||||
err = unpopulate(val, "Value", &a.Value)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", a, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type AccessPolicyAssignmentProperties.
|
||||
func (a AccessPolicyAssignmentProperties) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "accessPolicyName", a.AccessPolicyName)
|
||||
populate(objectMap, "provisioningState", a.ProvisioningState)
|
||||
populate(objectMap, "user", a.User)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyAssignmentProperties.
|
||||
func (a *AccessPolicyAssignmentProperties) 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", a, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "accessPolicyName":
|
||||
err = unpopulate(val, "AccessPolicyName", &a.AccessPolicyName)
|
||||
delete(rawMsg, key)
|
||||
case "provisioningState":
|
||||
err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
|
||||
delete(rawMsg, key)
|
||||
case "user":
|
||||
err = unpopulate(val, "User", &a.User)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", a, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type AccessPolicyAssignmentPropertiesUser.
|
||||
func (a AccessPolicyAssignmentPropertiesUser) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "objectId", a.ObjectID)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyAssignmentPropertiesUser.
|
||||
func (a *AccessPolicyAssignmentPropertiesUser) 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", a, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "objectId":
|
||||
err = unpopulate(val, "ObjectID", &a.ObjectID)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", a, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type Cluster.
|
||||
func (c Cluster) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
|
@ -140,11 +272,13 @@ func (c *ClusterList) UnmarshalJSON(data []byte) error {
|
|||
func (c ClusterProperties) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "encryption", c.Encryption)
|
||||
populate(objectMap, "highAvailability", c.HighAvailability)
|
||||
populate(objectMap, "hostName", c.HostName)
|
||||
populate(objectMap, "minimumTlsVersion", c.MinimumTLSVersion)
|
||||
populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections)
|
||||
populate(objectMap, "provisioningState", c.ProvisioningState)
|
||||
populate(objectMap, "redisVersion", c.RedisVersion)
|
||||
populate(objectMap, "redundancyMode", c.RedundancyMode)
|
||||
populate(objectMap, "resourceState", c.ResourceState)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
@ -161,6 +295,9 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error {
|
|||
case "encryption":
|
||||
err = unpopulate(val, "Encryption", &c.Encryption)
|
||||
delete(rawMsg, key)
|
||||
case "highAvailability":
|
||||
err = unpopulate(val, "HighAvailability", &c.HighAvailability)
|
||||
delete(rawMsg, key)
|
||||
case "hostName":
|
||||
err = unpopulate(val, "HostName", &c.HostName)
|
||||
delete(rawMsg, key)
|
||||
|
@ -176,6 +313,9 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error {
|
|||
case "redisVersion":
|
||||
err = unpopulate(val, "RedisVersion", &c.RedisVersion)
|
||||
delete(rawMsg, key)
|
||||
case "redundancyMode":
|
||||
err = unpopulate(val, "RedundancyMode", &c.RedundancyMode)
|
||||
delete(rawMsg, key)
|
||||
case "resourceState":
|
||||
err = unpopulate(val, "ResourceState", &c.ResourceState)
|
||||
delete(rawMsg, key)
|
||||
|
@ -321,6 +461,7 @@ func (d Database) MarshalJSON() ([]byte, error) {
|
|||
populate(objectMap, "id", d.ID)
|
||||
populate(objectMap, "name", d.Name)
|
||||
populate(objectMap, "properties", d.Properties)
|
||||
populate(objectMap, "systemData", d.SystemData)
|
||||
populate(objectMap, "type", d.Type)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
@ -343,6 +484,9 @@ func (d *Database) UnmarshalJSON(data []byte) error {
|
|||
case "properties":
|
||||
err = unpopulate(val, "Properties", &d.Properties)
|
||||
delete(rawMsg, key)
|
||||
case "systemData":
|
||||
err = unpopulate(val, "SystemData", &d.SystemData)
|
||||
delete(rawMsg, key)
|
||||
case "type":
|
||||
err = unpopulate(val, "Type", &d.Type)
|
||||
delete(rawMsg, key)
|
||||
|
@ -388,6 +532,7 @@ func (d *DatabaseList) UnmarshalJSON(data []byte) error {
|
|||
// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties.
|
||||
func (d DatabaseProperties) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "accessKeysAuthentication", d.AccessKeysAuthentication)
|
||||
populate(objectMap, "clientProtocol", d.ClientProtocol)
|
||||
populate(objectMap, "clusteringPolicy", d.ClusteringPolicy)
|
||||
populate(objectMap, "deferUpgrade", d.DeferUpgrade)
|
||||
|
@ -411,6 +556,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error {
|
|||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "accessKeysAuthentication":
|
||||
err = unpopulate(val, "AccessKeysAuthentication", &d.AccessKeysAuthentication)
|
||||
delete(rawMsg, key)
|
||||
case "clientProtocol":
|
||||
err = unpopulate(val, "ClientProtocol", &d.ClientProtocol)
|
||||
delete(rawMsg, key)
|
||||
|
@ -1323,12 +1471,51 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) {
|
|||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "id", p.ID)
|
||||
populate(objectMap, "name", p.Name)
|
||||
populate(objectMap, "systemData", p.SystemData)
|
||||
populate(objectMap, "type", p.Type)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
|
||||
func (p *ProxyResource) 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", p, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "id":
|
||||
err = unpopulate(val, "ID", &p.ID)
|
||||
delete(rawMsg, key)
|
||||
case "name":
|
||||
err = unpopulate(val, "Name", &p.Name)
|
||||
delete(rawMsg, key)
|
||||
case "systemData":
|
||||
err = unpopulate(val, "SystemData", &p.SystemData)
|
||||
delete(rawMsg, key)
|
||||
case "type":
|
||||
err = unpopulate(val, "Type", &p.Type)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", p, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated.
|
||||
func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "id", p.ID)
|
||||
populate(objectMap, "name", p.Name)
|
||||
populate(objectMap, "type", p.Type)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated.
|
||||
func (p *ProxyResourceAutoGenerated) 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", p, err)
|
||||
|
@ -1415,6 +1602,45 @@ func (r *Resource) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated.
|
||||
func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populate(objectMap, "id", r.ID)
|
||||
populate(objectMap, "name", r.Name)
|
||||
populate(objectMap, "systemData", r.SystemData)
|
||||
populate(objectMap, "type", r.Type)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated.
|
||||
func (r *ResourceAutoGenerated) 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", r, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "id":
|
||||
err = unpopulate(val, "ID", &r.ID)
|
||||
delete(rawMsg, key)
|
||||
case "name":
|
||||
err = unpopulate(val, "Name", &r.Name)
|
||||
delete(rawMsg, key)
|
||||
case "systemData":
|
||||
err = unpopulate(val, "SystemData", &r.SystemData)
|
||||
delete(rawMsg, key)
|
||||
case "type":
|
||||
err = unpopulate(val, "Type", &r.Type)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", r, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type SKU.
|
||||
func (s SKU) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
|
@ -1446,6 +1672,53 @@ func (s *SKU) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type SystemData.
|
||||
func (s SystemData) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
|
||||
populate(objectMap, "createdBy", s.CreatedBy)
|
||||
populate(objectMap, "createdByType", s.CreatedByType)
|
||||
populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
|
||||
populate(objectMap, "lastModifiedBy", s.LastModifiedBy)
|
||||
populate(objectMap, "lastModifiedByType", s.LastModifiedByType)
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
|
||||
func (s *SystemData) 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", s, err)
|
||||
}
|
||||
for key, val := range rawMsg {
|
||||
var err error
|
||||
switch key {
|
||||
case "createdAt":
|
||||
err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
|
||||
delete(rawMsg, key)
|
||||
case "createdBy":
|
||||
err = unpopulate(val, "CreatedBy", &s.CreatedBy)
|
||||
delete(rawMsg, key)
|
||||
case "createdByType":
|
||||
err = unpopulate(val, "CreatedByType", &s.CreatedByType)
|
||||
delete(rawMsg, key)
|
||||
case "lastModifiedAt":
|
||||
err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
|
||||
delete(rawMsg, key)
|
||||
case "lastModifiedBy":
|
||||
err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy)
|
||||
delete(rawMsg, key)
|
||||
case "lastModifiedByType":
|
||||
err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType)
|
||||
delete(rawMsg, key)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("unmarshalling type %T: %v", s, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface for type TrackedResource.
|
||||
func (t TrackedResource) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]any)
|
||||
|
|
|
@ -39,7 +39,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 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - 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]{
|
||||
|
@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options *
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/OperationsList.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/OperationsList.json
|
||||
func ExampleOperationsClient_NewListPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
|
|
@ -46,7 +46,7 @@ func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCre
|
|||
// Get - Gets the status of operation.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - location - The name of Azure region.
|
||||
// - operationID - The ID of an ongoing async operation.
|
||||
// - options - OperationsStatusClientGetOptions contains the optional parameters for the OperationsStatusClient.Get method.
|
||||
|
@ -92,7 +92,7 @@ func (client *OperationsStatusClient) getCreateRequest(ctx context.Context, loca
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/OperationsStatusGet.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/OperationsStatusGet.json
|
||||
func ExampleOperationsStatusClient_Get() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -38,7 +38,7 @@ func ExampleOperationsStatusClient_Get() {
|
|||
// res.OperationStatus = armredisenterprise.OperationStatus{
|
||||
// Name: to.Ptr("testoperationid"),
|
||||
// EndTime: to.Ptr("2017-01-01T16:13:13.933Z"),
|
||||
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Cache/locations/westus/operationsStatus/testoperationid"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/providers/Microsoft.Cache/locations/westus/operationsStatus/testoperationid"),
|
||||
// StartTime: to.Ptr("2017-01-01T13:13:13.933Z"),
|
||||
// Status: to.Ptr("Succeeded"),
|
||||
// }
|
||||
|
|
|
@ -8,6 +8,31 @@
|
|||
|
||||
package armredisenterprise
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method.
|
||||
type ClientBeginCreateOptions struct {
|
||||
// Resumes the LRO from the provided token.
|
||||
|
|
|
@ -43,10 +43,10 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor
|
|||
return client, nil
|
||||
}
|
||||
|
||||
// BeginDelete - Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
|
||||
// BeginDelete - Deletes the specified private endpoint connection associated with the Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
|
||||
|
@ -70,10 +70,10 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context,
|
|||
}
|
||||
}
|
||||
|
||||
// Delete - Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
|
||||
// Delete - Deletes the specified private endpoint connection associated with the Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "PrivateEndpointConnectionsClient.BeginDelete"
|
||||
|
@ -119,16 +119,16 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// Get - Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
|
||||
// Get - Gets the specified private endpoint connection associated with the Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
|
||||
|
@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -195,9 +195,9 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// NewListPager - Lists all the private endpoint connections associated with the RedisEnterprise cluster.
|
||||
// NewListPager - Lists all the private endpoint connections associated with the Redis Enterprise cluster.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager
|
||||
|
@ -246,7 +246,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
@ -261,10 +261,10 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// BeginPut - Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
|
||||
// BeginPut - Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
|
||||
|
@ -288,10 +288,10 @@ func (client *PrivateEndpointConnectionsClient) BeginPut(ctx context.Context, re
|
|||
}
|
||||
}
|
||||
|
||||
// Put - Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
|
||||
// Put - Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
func (client *PrivateEndpointConnectionsClient) put(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginPutOptions) (*http.Response, error) {
|
||||
var err error
|
||||
const operationName = "PrivateEndpointConnectionsClient.BeginPut"
|
||||
|
@ -337,7 +337,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
if err := runtime.MarshalAsJSON(req, properties); err != nil {
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseListPrivateEndpointConnections.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListPrivateEndpointConnections.json
|
||||
func ExamplePrivateEndpointConnectionsClient_NewListPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -45,10 +45,10 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() {
|
|||
// {
|
||||
// Name: to.Ptr("pectest01"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// Properties: &armredisenterprise.PrivateEndpointConnectionProperties{
|
||||
// PrivateEndpoint: &armredisenterprise.PrivateEndpoint{
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// },
|
||||
// PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{
|
||||
// Description: to.Ptr("Auto-Approved"),
|
||||
|
@ -61,10 +61,10 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() {
|
|||
// {
|
||||
// Name: to.Ptr("pectest01"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// Properties: &armredisenterprise.PrivateEndpointConnectionProperties{
|
||||
// PrivateEndpoint: &armredisenterprise.PrivateEndpoint{
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// },
|
||||
// PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{
|
||||
// Description: to.Ptr("Auto-Approved"),
|
||||
|
@ -78,7 +78,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json
|
||||
func ExamplePrivateEndpointConnectionsClient_Get() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -99,10 +99,10 @@ func ExamplePrivateEndpointConnectionsClient_Get() {
|
|||
// res.PrivateEndpointConnection = armredisenterprise.PrivateEndpointConnection{
|
||||
// Name: to.Ptr("pectest01"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"),
|
||||
// Properties: &armredisenterprise.PrivateEndpointConnectionProperties{
|
||||
// PrivateEndpoint: &armredisenterprise.PrivateEndpoint{
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"),
|
||||
// },
|
||||
// PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{
|
||||
// Description: to.Ptr("Auto-Approved"),
|
||||
|
@ -114,7 +114,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() {
|
|||
// }
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json
|
||||
func ExamplePrivateEndpointConnectionsClient_BeginPut() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -142,7 +142,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginPut() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseDeletePrivateEndpointConnection.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDeletePrivateEndpointConnection.json
|
||||
func ExamplePrivateEndpointConnectionsClient_BeginDelete() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
|
|
@ -43,9 +43,9 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke
|
|||
return client, nil
|
||||
}
|
||||
|
||||
// NewListByClusterPager - Gets the private link resources that need to be created for a RedisEnterprise cluster.
|
||||
// NewListByClusterPager - Gets the private link resources that need to be created for a Redis Enterprise cluster.
|
||||
//
|
||||
// Generated from API version 2024-03-01-preview
|
||||
// Generated from API version 2024-09-01-preview
|
||||
// - resourceGroupName - The name of the resource group. The name is case insensitive.
|
||||
// - clusterName - The name of the Redis Enterprise cluster.
|
||||
// - options - PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByClusterPager
|
||||
|
@ -94,7 +94,7 @@ func (client *PrivateLinkResourcesClient) listByClusterCreateRequest(ctx context
|
|||
return nil, err
|
||||
}
|
||||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("api-version", "2024-03-01-preview")
|
||||
reqQP.Set("api-version", "2024-09-01-preview")
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/json"}
|
||||
return req, nil
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v2"
|
||||
)
|
||||
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a8698bb86e66e2d29ce5e8987b6aaa8fc7f7f04b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-03-01-preview/examples/RedisEnterpriseListPrivateLinkResources.json
|
||||
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListPrivateLinkResources.json
|
||||
func ExamplePrivateLinkResourcesClient_NewListByClusterPager() {
|
||||
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||
if err != nil {
|
||||
|
@ -44,7 +44,7 @@ func ExamplePrivateLinkResourcesClient_NewListByClusterPager() {
|
|||
// {
|
||||
// Name: to.Ptr("redisEnterpriseCache"),
|
||||
// Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateLinkResources"),
|
||||
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateLinkResources/redisEnterpriseCache"),
|
||||
// ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateLinkResources/redisEnterpriseCache"),
|
||||
// Properties: &armredisenterprise.PrivateLinkResourceProperties{
|
||||
// GroupID: to.Ptr("redisEnterpriseCache"),
|
||||
// RequiredMembers: []*string{
|
||||
|
|
|
@ -8,9 +8,32 @@
|
|||
|
||||
package armredisenterprise
|
||||
|
||||
// AccessPolicyAssignmentClientCreateUpdateResponse contains the response from method AccessPolicyAssignmentClient.BeginCreateUpdate.
|
||||
type AccessPolicyAssignmentClientCreateUpdateResponse struct {
|
||||
// Describes the access policy assignment of Redis Enterprise database
|
||||
AccessPolicyAssignment
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentClientDeleteResponse contains the response from method AccessPolicyAssignmentClient.BeginDelete.
|
||||
type AccessPolicyAssignmentClientDeleteResponse struct {
|
||||
// placeholder for future response values
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentClientGetResponse contains the response from method AccessPolicyAssignmentClient.Get.
|
||||
type AccessPolicyAssignmentClientGetResponse struct {
|
||||
// Describes the access policy assignment of Redis Enterprise database
|
||||
AccessPolicyAssignment
|
||||
}
|
||||
|
||||
// AccessPolicyAssignmentClientListResponse contains the response from method AccessPolicyAssignmentClient.NewListPager.
|
||||
type AccessPolicyAssignmentClientListResponse struct {
|
||||
// The response of a list-all operation.
|
||||
AccessPolicyAssignmentList
|
||||
}
|
||||
|
||||
// ClientCreateResponse contains the response from method Client.BeginCreate.
|
||||
type ClientCreateResponse struct {
|
||||
// Describes the RedisEnterprise cluster
|
||||
// Describes the Redis Enterprise cluster
|
||||
Cluster
|
||||
}
|
||||
|
||||
|
@ -21,7 +44,7 @@ type ClientDeleteResponse struct {
|
|||
|
||||
// ClientGetResponse contains the response from method Client.Get.
|
||||
type ClientGetResponse struct {
|
||||
// Describes the RedisEnterprise cluster
|
||||
// Describes the Redis Enterprise cluster
|
||||
Cluster
|
||||
}
|
||||
|
||||
|
@ -39,13 +62,13 @@ type ClientListResponse struct {
|
|||
|
||||
// ClientUpdateResponse contains the response from method Client.BeginUpdate.
|
||||
type ClientUpdateResponse struct {
|
||||
// Describes the RedisEnterprise cluster
|
||||
// Describes the Redis Enterprise cluster
|
||||
Cluster
|
||||
}
|
||||
|
||||
// DatabasesClientCreateResponse contains the response from method DatabasesClient.BeginCreate.
|
||||
type DatabasesClientCreateResponse struct {
|
||||
// Describes a database on the RedisEnterprise cluster
|
||||
// Describes a database on the Redis Enterprise cluster
|
||||
Database
|
||||
}
|
||||
|
||||
|
@ -76,7 +99,7 @@ type DatabasesClientForceUnlinkResponse struct {
|
|||
|
||||
// DatabasesClientGetResponse contains the response from method DatabasesClient.Get.
|
||||
type DatabasesClientGetResponse struct {
|
||||
// Describes a database on the RedisEnterprise cluster
|
||||
// Describes a database on the Redis Enterprise cluster
|
||||
Database
|
||||
}
|
||||
|
||||
|
@ -105,7 +128,7 @@ type DatabasesClientRegenerateKeyResponse struct {
|
|||
|
||||
// DatabasesClientUpdateResponse contains the response from method DatabasesClient.BeginUpdate.
|
||||
type DatabasesClientUpdateResponse struct {
|
||||
// Describes a database on the RedisEnterprise cluster
|
||||
// Describes a database on the Redis Enterprise cluster
|
||||
Database
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
//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. DO NOT EDIT.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
package armredisenterprise
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
|
||||
var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
|
||||
|
||||
const (
|
||||
utcDateTime = "2006-01-02T15:04:05.999999999"
|
||||
utcDateTimeJSON = `"` + utcDateTime + `"`
|
||||
utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
|
||||
utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
|
||||
dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
|
||||
dateTimeJSON = `"` + time.RFC3339Nano + `"`
|
||||
dateTimeJSONNoT = `"` + dateTimeNoT + `"`
|
||||
)
|
||||
|
||||
type dateTimeRFC3339 time.Time
|
||||
|
||||
func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
|
||||
tt := time.Time(t)
|
||||
return tt.MarshalJSON()
|
||||
}
|
||||
|
||||
func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
|
||||
tt := time.Time(t)
|
||||
return tt.MarshalText()
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
|
||||
tzOffset := tzOffsetRegex.Match(data)
|
||||
hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
|
||||
var layout string
|
||||
if tzOffset && hasT {
|
||||
layout = dateTimeJSON
|
||||
} else if tzOffset {
|
||||
layout = dateTimeJSONNoT
|
||||
} else if hasT {
|
||||
layout = utcDateTimeJSON
|
||||
} else {
|
||||
layout = utcDateTimeJSONNoT
|
||||
}
|
||||
return t.Parse(layout, string(data))
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
|
||||
tzOffset := tzOffsetRegex.Match(data)
|
||||
hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
|
||||
var layout string
|
||||
if tzOffset && hasT {
|
||||
layout = time.RFC3339Nano
|
||||
} else if tzOffset {
|
||||
layout = dateTimeNoT
|
||||
} else if hasT {
|
||||
layout = utcDateTime
|
||||
} else {
|
||||
layout = utcDateTimeNoT
|
||||
}
|
||||
return t.Parse(layout, string(data))
|
||||
}
|
||||
|
||||
func (t *dateTimeRFC3339) Parse(layout, value string) error {
|
||||
p, err := time.Parse(layout, strings.ToUpper(value))
|
||||
*t = dateTimeRFC3339(p)
|
||||
return err
|
||||
}
|
||||
|
||||
func (t dateTimeRFC3339) String() string {
|
||||
return time.Time(t).Format(time.RFC3339Nano)
|
||||
}
|
||||
|
||||
func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
|
||||
if t == nil {
|
||||
return
|
||||
} else if azcore.IsNullValue(t) {
|
||||
m[k] = nil
|
||||
return
|
||||
} else if reflect.ValueOf(t).IsNil() {
|
||||
return
|
||||
}
|
||||
m[k] = (*dateTimeRFC3339)(t)
|
||||
}
|
||||
|
||||
func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
|
||||
if data == nil || string(data) == "null" {
|
||||
return nil
|
||||
}
|
||||
var aux dateTimeRFC3339
|
||||
if err := json.Unmarshal(data, &aux); err != nil {
|
||||
return fmt.Errorf("struct field %s: %v", fn, err)
|
||||
}
|
||||
*t = (*time.Time)(&aux)
|
||||
return nil
|
||||
}
|
Загрузка…
Ссылка в новой задаче