diff --git a/sdk/resourcemanager/elasticsan/armelasticsan/CHANGELOG.md b/sdk/resourcemanager/elasticsan/armelasticsan/CHANGELOG.md new file mode 100644 index 000000000000..3c5709f8bbeb --- /dev/null +++ b/sdk/resourcemanager/elasticsan/armelasticsan/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 0.1.0 (2022-10-21) + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/LICENSE.txt b/sdk/resourcemanager/elasticsan/armelasticsan/LICENSE.txt similarity index 100% rename from sdk/resourcemanager/elasticsans/armelasticsans/LICENSE.txt rename to sdk/resourcemanager/elasticsan/armelasticsan/LICENSE.txt diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/README.md b/sdk/resourcemanager/elasticsan/armelasticsan/README.md similarity index 64% rename from sdk/resourcemanager/elasticsans/armelasticsans/README.md rename to sdk/resourcemanager/elasticsan/armelasticsan/README.md index 346cc34b3915..ad982695ff8a 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/README.md +++ b/sdk/resourcemanager/elasticsan/armelasticsan/README.md @@ -1,31 +1,31 @@ -# Azure Elasticsans Module for Go +# Azure Elasticsan Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan) -The `armelasticsans` module provides operations for working with Azure Elasticsans. +The `armelasticsan` module provides operations for working with Azure Elasticsan. -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/elasticsans/armelasticsans) +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/elasticsan/armelasticsan) # Getting started ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.19 or above +- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) ## Install the package This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. -Install the Azure Elasticsans module: +Install the Azure Elasticsan module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan ``` ## Authorization -When creating a client, you will need to provide a credential for authenticating with Azure Elasticsans. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. +When creating a client, you will need to provide a credential for authenticating with Azure Elasticsan. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. ```go cred, err := azidentity.NewDefaultAzureCredential(nil) @@ -35,10 +35,10 @@ For more information on authentication, please see the documentation for `aziden ## Clients -Azure Elasticsans modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. +Azure Elasticsan modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. ```go -client, err := armelasticsans.NewSKUsClient(, cred, nil) +client, err := armelasticsan.NewVolumesClient(, cred, nil) ``` You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). @@ -49,13 +49,13 @@ options := arm.ClientOptions{ Cloud: cloud.AzureChina, }, } -client, err := armelasticsans.NewSKUsClient(, cred, &options) +client, err := armelasticsan.NewVolumesClient(, cred, &options) ``` ## Provide Feedback If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Elasticsans` label. +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Elasticsan` label. # Contributing diff --git a/sdk/resourcemanager/elasticsan/armelasticsan/autorest.md b/sdk/resourcemanager/elasticsan/armelasticsan/autorest.md new file mode 100644 index 000000000000..47e9a6a56cbe --- /dev/null +++ b/sdk/resourcemanager/elasticsan/armelasticsan/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- https://github.com/Azure/azure-rest-api-specs/blob/e1da7cbab8d4f554484dedb676ba7bdbdf6cdf78/specification/elasticsan/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/e1da7cbab8d4f554484dedb676ba7bdbdf6cdf78/specification/elasticsan/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 0.1.0 + +``` \ No newline at end of file diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/build.go b/sdk/resourcemanager/elasticsan/armelasticsan/build.go similarity index 78% rename from sdk/resourcemanager/elasticsans/armelasticsans/build.go rename to sdk/resourcemanager/elasticsan/armelasticsan/build.go index 3673ca729529..0175a606d048 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/build.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/elasticsans/armelasticsans +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/elasticsan/armelasticsan -package armelasticsans +package armelasticsan diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/ci.yml b/sdk/resourcemanager/elasticsan/armelasticsan/ci.yml similarity index 71% rename from sdk/resourcemanager/elasticsans/armelasticsans/ci.yml rename to sdk/resourcemanager/elasticsan/armelasticsan/ci.yml index 0c07a7f8fd6e..0043600ceb57 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/ci.yml +++ b/sdk/resourcemanager/elasticsan/armelasticsan/ci.yml @@ -8,7 +8,7 @@ trigger: - release/* paths: include: - - sdk/resourcemanager/elasticsans/armelasticsans/ + - sdk/resourcemanager/elasticsan/armelasticsan/ pr: branches: @@ -19,10 +19,10 @@ pr: - release/* paths: include: - - sdk/resourcemanager/elasticsans/armelasticsans/ + - sdk/resourcemanager/elasticsan/armelasticsan/ stages: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: IncludeRelease: true - ServiceDirectory: 'resourcemanager/elasticsans/armelasticsans' + ServiceDirectory: 'resourcemanager/elasticsan/armelasticsan' diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/constants.go b/sdk/resourcemanager/elasticsan/armelasticsan/constants.go similarity index 98% rename from sdk/resourcemanager/elasticsans/armelasticsans/constants.go rename to sdk/resourcemanager/elasticsan/armelasticsan/constants.go index 9aef01ea3255..03902965f887 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/constants.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/constants.go @@ -7,11 +7,11 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan const ( - moduleName = "armelasticsans" - moduleVersion = "v0.1.1" + moduleName = "armelasticsan" + moduleVersion = "v0.1.0" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/client.go b/sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client.go similarity index 66% rename from sdk/resourcemanager/elasticsans/armelasticsans/client.go rename to sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client.go index a33bc46fc22a..527bd64318e8 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/client.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "context" @@ -23,19 +23,19 @@ import ( "strings" ) -// Client contains the methods for the ElasticSans group. -// Don't use this type directly, use NewClient() instead. -type Client struct { +// ElasticSansClient contains the methods for the ElasticSans group. +// Don't use this type directly, use NewElasticSansClient() instead. +type ElasticSansClient struct { host string subscriptionID string pl runtime.Pipeline } -// NewClient creates a new instance of Client with the specified values. +// NewElasticSansClient creates a new instance of ElasticSansClient 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 NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { +func NewElasticSansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticSansClient, error) { if options == nil { options = &arm.ClientOptions{} } @@ -47,7 +47,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options if err != nil { return nil, err } - client := &Client{ + client := &ElasticSansClient{ subscriptionID: subscriptionID, host: ep, pl: pl, @@ -61,25 +61,25 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // resourceGroupName - The name of the resource group. The name is case insensitive. // elasticSanName - The name of the ElasticSan. // parameters - Elastic San object. -// options - ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method. -func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ClientBeginCreateOptions) (*runtime.Poller[ClientCreateResponse], error) { +// options - ElasticSansClientBeginCreateOptions contains the optional parameters for the ElasticSansClient.BeginCreate method. +func (client *ElasticSansClient) BeginCreate(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ElasticSansClientBeginCreateOptions) (*runtime.Poller[ElasticSansClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, elasticSanName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ClientCreateResponse]{ + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticSansClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[ClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[ElasticSansClientCreateResponse](options.ResumeToken, client.pl, nil) } } // Create - Create ElasticSan. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-11-20-preview -func (client *Client) create(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ClientBeginCreateOptions) (*http.Response, error) { +func (client *ElasticSansClient) create(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ElasticSansClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, elasticSanName, parameters, options) if err != nil { return nil, err @@ -95,7 +95,7 @@ func (client *Client) create(ctx context.Context, resourceGroupName string, elas } // createCreateRequest creates the Create request. -func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ClientBeginCreateOptions) (*policy.Request, error) { +func (client *ElasticSansClient) createCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSan, options *ElasticSansClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,25 +125,25 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName // Generated from API version 2021-11-20-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // elasticSanName - The name of the ElasticSan. -// options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. -func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, elasticSanName string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error) { +// options - ElasticSansClientBeginDeleteOptions contains the optional parameters for the ElasticSansClient.BeginDelete method. +func (client *ElasticSansClient) BeginDelete(ctx context.Context, resourceGroupName string, elasticSanName string, options *ElasticSansClientBeginDeleteOptions) (*runtime.Poller[ElasticSansClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, elasticSanName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ClientDeleteResponse]{ + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticSansClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[ClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[ElasticSansClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Delete a Elastic San. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-11-20-preview -func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, elasticSanName string, options *ClientBeginDeleteOptions) (*http.Response, error) { +func (client *ElasticSansClient) deleteOperation(ctx context.Context, resourceGroupName string, elasticSanName string, options *ElasticSansClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, elasticSanName, options) if err != nil { return nil, err @@ -159,7 +159,7 @@ func (client *Client) deleteOperation(ctx context.Context, resourceGroupName str } // deleteCreateRequest creates the Delete request. -func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, options *ClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ElasticSansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, options *ElasticSansClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -189,24 +189,24 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // Generated from API version 2021-11-20-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // elasticSanName - The name of the ElasticSan. -// options - ClientGetOptions contains the optional parameters for the Client.Get method. -func (client *Client) Get(ctx context.Context, resourceGroupName string, elasticSanName string, options *ClientGetOptions) (ClientGetResponse, error) { +// options - ElasticSansClientGetOptions contains the optional parameters for the ElasticSansClient.Get method. +func (client *ElasticSansClient) Get(ctx context.Context, resourceGroupName string, elasticSanName string, options *ElasticSansClientGetOptions) (ElasticSansClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, elasticSanName, options) if err != nil { - return ClientGetResponse{}, err + return ElasticSansClientGetResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return ClientGetResponse{}, err + return ElasticSansClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientGetResponse{}, runtime.NewResponseError(resp) + return ElasticSansClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, options *ClientGetOptions) (*policy.Request, error) { +func (client *ElasticSansClient) getCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, options *ElasticSansClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -232,10 +232,10 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st } // getHandleResponse handles the Get response. -func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, error) { - result := ClientGetResponse{} +func (client *ElasticSansClient) getHandleResponse(resp *http.Response) (ElasticSansClientGetResponse, error) { + result := ElasticSansClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ElasticSan); err != nil { - return ClientGetResponse{}, err + return ElasticSansClientGetResponse{}, err } return result, nil } @@ -243,13 +243,14 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListByResourceGroupPager - Gets a list of ElasticSan in a resource group. // Generated from API version 2021-11-20-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// options - ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. -func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ClientListByResourceGroupResponse]{ - More: func(page ClientListByResourceGroupResponse) bool { +// options - ElasticSansClientListByResourceGroupOptions contains the optional parameters for the ElasticSansClient.ListByResourceGroup +// method. +func (client *ElasticSansClient) NewListByResourceGroupPager(resourceGroupName string, options *ElasticSansClientListByResourceGroupOptions) *runtime.Pager[ElasticSansClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ElasticSansClientListByResourceGroupResponse]{ + More: func(page ElasticSansClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ClientListByResourceGroupResponse) (ClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *ElasticSansClientListByResourceGroupResponse) (ElasticSansClientListByResourceGroupResponse, error) { var req *policy.Request var err error if page == nil { @@ -258,14 +259,14 @@ func (client *Client) NewListByResourceGroupPager(resourceGroupName string, opti req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ClientListByResourceGroupResponse{}, err + return ElasticSansClientListByResourceGroupResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return ClientListByResourceGroupResponse{}, err + return ElasticSansClientListByResourceGroupResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return ElasticSansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) } return client.listByResourceGroupHandleResponse(resp) }, @@ -273,7 +274,7 @@ func (client *Client) NewListByResourceGroupPager(resourceGroupName string, opti } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ElasticSansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ElasticSansClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -295,23 +296,24 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso } // listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (ClientListByResourceGroupResponse, error) { - result := ClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticSanList); err != nil { - return ClientListByResourceGroupResponse{}, err +func (client *ElasticSansClient) listByResourceGroupHandleResponse(resp *http.Response) (ElasticSansClientListByResourceGroupResponse, error) { + result := ElasticSansClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.List); err != nil { + return ElasticSansClientListByResourceGroupResponse{}, err } return result, nil } // NewListBySubscriptionPager - Gets a list of ElasticSans in a subscription // Generated from API version 2021-11-20-preview -// options - ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. -func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ClientListBySubscriptionResponse]{ - More: func(page ClientListBySubscriptionResponse) bool { +// options - ElasticSansClientListBySubscriptionOptions contains the optional parameters for the ElasticSansClient.ListBySubscription +// method. +func (client *ElasticSansClient) NewListBySubscriptionPager(options *ElasticSansClientListBySubscriptionOptions) *runtime.Pager[ElasticSansClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ElasticSansClientListBySubscriptionResponse]{ + More: func(page ElasticSansClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ClientListBySubscriptionResponse) (ClientListBySubscriptionResponse, error) { + Fetcher: func(ctx context.Context, page *ElasticSansClientListBySubscriptionResponse) (ElasticSansClientListBySubscriptionResponse, error) { var req *policy.Request var err error if page == nil { @@ -320,14 +322,14 @@ func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscripti req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ClientListBySubscriptionResponse{}, err + return ElasticSansClientListBySubscriptionResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return ClientListBySubscriptionResponse{}, err + return ElasticSansClientListBySubscriptionResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + return ElasticSansClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) } return client.listBySubscriptionHandleResponse(resp) }, @@ -335,7 +337,7 @@ func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscripti } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, options *ClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ElasticSansClient) listBySubscriptionCreateRequest(ctx context.Context, options *ElasticSansClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -353,10 +355,10 @@ func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, optio } // listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (ClientListBySubscriptionResponse, error) { - result := ClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticSanList); err != nil { - return ClientListBySubscriptionResponse{}, err +func (client *ElasticSansClient) listBySubscriptionHandleResponse(resp *http.Response) (ElasticSansClientListBySubscriptionResponse, error) { + result := ElasticSansClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.List); err != nil { + return ElasticSansClientListBySubscriptionResponse{}, err } return result, nil } @@ -367,25 +369,25 @@ func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (Cli // resourceGroupName - The name of the resource group. The name is case insensitive. // elasticSanName - The name of the ElasticSan. // parameters - Elastic San object. -// options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. -func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSanUpdate, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) { +// options - ElasticSansClientBeginUpdateOptions contains the optional parameters for the ElasticSansClient.BeginUpdate method. +func (client *ElasticSansClient) BeginUpdate(ctx context.Context, resourceGroupName string, elasticSanName string, parameters Update, options *ElasticSansClientBeginUpdateOptions) (*runtime.Poller[ElasticSansClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, elasticSanName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ClientUpdateResponse]{ + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticSansClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[ClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[ElasticSansClientUpdateResponse](options.ResumeToken, client.pl, nil) } } // Update - Update a Elastic San. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-11-20-preview -func (client *Client) update(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSanUpdate, options *ClientBeginUpdateOptions) (*http.Response, error) { +func (client *ElasticSansClient) update(ctx context.Context, resourceGroupName string, elasticSanName string, parameters Update, options *ElasticSansClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, elasticSanName, parameters, options) if err != nil { return nil, err @@ -401,7 +403,7 @@ func (client *Client) update(ctx context.Context, resourceGroupName string, elas } // updateCreateRequest creates the Update request. -func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, parameters ElasticSanUpdate, options *ClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ElasticSansClient) updateCreateRequest(ctx context.Context, resourceGroupName string, elasticSanName string, parameters Update, options *ElasticSansClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/client_example_test.go b/sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client_example_test.go similarity index 79% rename from sdk/resourcemanager/elasticsans/armelasticsans/client_example_test.go rename to sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client_example_test.go index 7aa1a5bf7ec2..7a464b2e5cd0 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/client_example_test.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/elasticsans_client_example_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armelasticsans_test +package armelasticsan_test import ( "context" @@ -14,17 +14,17 @@ import ( "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/elasticsans/armelasticsans" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json -func ExampleClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMaximumSetGen() { +func ExampleElasticSansClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -42,13 +42,13 @@ func ExampleClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMaxim } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json -func ExampleClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMinimumSetGen() { +func ExampleElasticSansClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -66,13 +66,13 @@ func ExampleClient_NewListBySubscriptionPager_elasticSansListBySubscriptionMinim } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json -func ExampleClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMaximumSetGen() { +func ExampleElasticSansClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -90,13 +90,13 @@ func ExampleClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMax } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json -func ExampleClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMinimumSetGen() { +func ExampleElasticSansClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -114,29 +114,29 @@ func ExampleClient_NewListByResourceGroupPager_elasticSansListByResourceGroupMin } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json -func ExampleClient_BeginCreate_elasticSansCreateMaximumSetGen() { +func ExampleElasticSansClient_BeginCreate_elasticSansCreateMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsans.ElasticSan{ + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsan.ElasticSan{ Tags: map[string]*string{ "key896": to.Ptr("aaaaaaaaaaaaaaaaaa"), }, Location: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Properties: &armelasticsans.ElasticSanProperties{ + Properties: &armelasticsan.Properties{ AvailabilityZones: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, BaseSizeTiB: to.Ptr[int64](26), ExtendedCapacitySizeTiB: to.Ptr[int64](7), - SKU: &armelasticsans.SKU{ - Name: to.Ptr(armelasticsans.SKUNamePremiumLRS), - Tier: to.Ptr(armelasticsans.SKUTierPremium), + SKU: &armelasticsan.SKU{ + Name: to.Ptr(armelasticsan.SKUNamePremiumLRS), + Tier: to.Ptr(armelasticsan.SKUTierPremium), }, }, }, nil) @@ -152,22 +152,22 @@ func ExampleClient_BeginCreate_elasticSansCreateMaximumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MinimumSet_Gen.json -func ExampleClient_BeginCreate_elasticSansCreateMinimumSetGen() { +func ExampleElasticSansClient_BeginCreate_elasticSansCreateMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsans.ElasticSan{ - Properties: &armelasticsans.ElasticSanProperties{ + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsan.ElasticSan{ + Properties: &armelasticsan.Properties{ BaseSizeTiB: to.Ptr[int64](26), ExtendedCapacitySizeTiB: to.Ptr[int64](7), - SKU: &armelasticsans.SKU{ - Name: to.Ptr(armelasticsans.SKUNamePremiumLRS), + SKU: &armelasticsan.SKU{ + Name: to.Ptr(armelasticsan.SKUNamePremiumLRS), }, }, }, nil) @@ -183,18 +183,18 @@ func ExampleClient_BeginCreate_elasticSansCreateMinimumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json -func ExampleClient_BeginUpdate_elasticSansUpdateMaximumSetGen() { +func ExampleElasticSansClient_BeginUpdate_elasticSansUpdateMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsans.ElasticSanUpdate{ - Properties: &armelasticsans.ElasticSanUpdateProperties{ + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsan.Update{ + Properties: &armelasticsan.UpdateProperties{ BaseSizeTiB: to.Ptr[int64](23), ExtendedCapacitySizeTiB: to.Ptr[int64](4), }, @@ -214,17 +214,17 @@ func ExampleClient_BeginUpdate_elasticSansUpdateMaximumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MinimumSet_Gen.json -func ExampleClient_BeginUpdate_elasticSansUpdateMinimumSetGen() { +func ExampleElasticSansClient_BeginUpdate_elasticSansUpdateMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsans.ElasticSanUpdate{}, nil) + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", armelasticsan.Update{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -237,13 +237,13 @@ func ExampleClient_BeginUpdate_elasticSansUpdateMinimumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json -func ExampleClient_BeginDelete_elasticSansDeleteMaximumSetGen() { +func ExampleElasticSansClient_BeginDelete_elasticSansDeleteMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -258,13 +258,13 @@ func ExampleClient_BeginDelete_elasticSansDeleteMaximumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json -func ExampleClient_BeginDelete_elasticSansDeleteMinimumSetGen() { +func ExampleElasticSansClient_BeginDelete_elasticSansDeleteMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -279,13 +279,13 @@ func ExampleClient_BeginDelete_elasticSansDeleteMinimumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json -func ExampleClient_Get_elasticSansGetMaximumSetGen() { +func ExampleElasticSansClient_Get_elasticSansGetMaximumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -298,13 +298,13 @@ func ExampleClient_Get_elasticSansGetMaximumSetGen() { } // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json -func ExampleClient_Get_elasticSansGetMinimumSetGen() { +func ExampleElasticSansClient_Get_elasticSansGetMinimumSetGen() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewElasticSansClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/go.mod b/sdk/resourcemanager/elasticsan/armelasticsan/go.mod similarity index 91% rename from sdk/resourcemanager/elasticsans/armelasticsans/go.mod rename to sdk/resourcemanager/elasticsan/armelasticsan/go.mod index 9634f8308b95..befd1b812893 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/go.mod +++ b/sdk/resourcemanager/elasticsan/armelasticsan/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan go 1.18 @@ -19,5 +19,3 @@ require ( golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) - -retract [v0.0.0-00000000000000-000000000000, v0.1.1] \ No newline at end of file diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/go.sum b/sdk/resourcemanager/elasticsan/armelasticsan/go.sum similarity index 100% rename from sdk/resourcemanager/elasticsans/armelasticsans/go.sum rename to sdk/resourcemanager/elasticsan/armelasticsan/go.sum diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/models.go b/sdk/resourcemanager/elasticsan/armelasticsan/models.go similarity index 89% rename from sdk/resourcemanager/elasticsans/armelasticsans/models.go rename to sdk/resourcemanager/elasticsan/armelasticsan/models.go index 472eea03a829..a416935ca92b 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/models.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/models.go @@ -7,69 +7,89 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import "time" -// ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method. -type ClientBeginCreateOptions struct { +// ElasticSan - Response for ElasticSan request. +type ElasticSan struct { + // REQUIRED; Properties of ElasticSan. + Properties *Properties `json:"properties,omitempty"` + + // The geo-location where the resource lives. + Location *string `json:"location,omitempty"` + + // Azure resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Azure resource identifier. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource metadata required by ARM RPC + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ElasticSansClientBeginCreateOptions contains the optional parameters for the ElasticSansClient.BeginCreate method. +type ElasticSansClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. -type ClientBeginDeleteOptions struct { +// ElasticSansClientBeginDeleteOptions contains the optional parameters for the ElasticSansClient.BeginDelete method. +type ElasticSansClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. -type ClientBeginUpdateOptions struct { +// ElasticSansClientBeginUpdateOptions contains the optional parameters for the ElasticSansClient.BeginUpdate method. +type ElasticSansClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ClientGetOptions contains the optional parameters for the Client.Get method. -type ClientGetOptions struct { +// ElasticSansClientGetOptions contains the optional parameters for the ElasticSansClient.Get method. +type ElasticSansClientGetOptions struct { // placeholder for future optional parameters } -// ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. -type ClientListByResourceGroupOptions struct { +// ElasticSansClientListByResourceGroupOptions contains the optional parameters for the ElasticSansClient.ListByResourceGroup +// method. +type ElasticSansClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. -type ClientListBySubscriptionOptions struct { +// ElasticSansClientListBySubscriptionOptions contains the optional parameters for the ElasticSansClient.ListBySubscription +// method. +type ElasticSansClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// ElasticSan - Response for ElasticSan request. -type ElasticSan struct { - // REQUIRED; Properties of ElasticSan. - Properties *ElasticSanProperties `json:"properties,omitempty"` - - // The geo-location where the resource lives. - Location *string `json:"location,omitempty"` - - // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` +// IscsiTargetInfo - Iscsi target information +type IscsiTargetInfo struct { + // Operational status of the iSCSI Target. + Status *OperationalStatus `json:"status,omitempty"` - // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; State of the operation on the resource. + ProvisioningState *ProvisioningStates `json:"provisioningState,omitempty" azure:"ro"` - // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + TargetIqn *string `json:"targetIqn,omitempty" azure:"ro"` - // READ-ONLY; Resource metadata required by ARM RPC - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; iSCSI Target Portal Host Name + TargetPortalHostname *string `json:"targetPortalHostname,omitempty" azure:"ro"` - // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + // READ-ONLY; iSCSI Target Portal Port + TargetPortalPort *int32 `json:"targetPortalPort,omitempty" azure:"ro"` } -// ElasticSanList - List of Elastic Sans -type ElasticSanList struct { +// List of Elastic Sans +type List struct { // REQUIRED; An array of Elastic San objects. Value []*ElasticSan `json:"value,omitempty"` @@ -77,8 +97,14 @@ type ElasticSanList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// ElasticSanOperationDisplay - Metadata about an operation. -type ElasticSanOperationDisplay struct { +// NetworkRuleSet - A set of rules governing the network accessibility. +type NetworkRuleSet struct { + // The list of virtual network rules. + VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` +} + +// OperationDisplay - Metadata about an operation. +type OperationDisplay struct { // REQUIRED; Localized friendly description for the operation, as it should be shown to the user. Description *string `json:"description,omitempty"` @@ -92,17 +118,22 @@ type ElasticSanOperationDisplay struct { Resource *string `json:"resource,omitempty"` } -// ElasticSanOperationListResult - List of operations supported by the RP. -type ElasticSanOperationListResult struct { +// OperationListResult - List of operations supported by the RP. +type OperationListResult struct { // REQUIRED; An array of operations supported by the ElasticSan RP. - Value []*ElasticSanRPOperation `json:"value,omitempty"` + Value []*RPOperation `json:"value,omitempty"` // URI to fetch the next section of the paginated response. NextLink *string `json:"nextLink,omitempty"` } -// ElasticSanProperties - Elastic San response properties. -type ElasticSanProperties struct { +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// Properties - Elastic San response properties. +type Properties struct { // REQUIRED; Base size of the Elastic San appliance in TiB. BaseSizeTiB *int64 `json:"baseSizeTiB,omitempty"` @@ -134,65 +165,18 @@ type ElasticSanProperties struct { VolumeGroupCount *int64 `json:"volumeGroupCount,omitempty" azure:"ro"` } -// ElasticSanRPOperation - Description of a ElasticSan RP Operation -type ElasticSanRPOperation struct { +// RPOperation - Description of a ElasticSan RP Operation +type RPOperation struct { // REQUIRED; The name of the operation being performed on this particular object Name *string `json:"name,omitempty"` // READ-ONLY; Additional metadata about RP operation. - Display *ElasticSanOperationDisplay `json:"display,omitempty" azure:"ro"` + Display *OperationDisplay `json:"display,omitempty" azure:"ro"` // READ-ONLY; Indicates whether the operation applies to data-plane. IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` } -// ElasticSanUpdate - Response for ElasticSan update request. -type ElasticSanUpdate struct { - // Properties of ElasticSan. - Properties *ElasticSanUpdateProperties `json:"properties,omitempty"` - - // Update tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// ElasticSanUpdateProperties - Elastic San update properties. -type ElasticSanUpdateProperties struct { - // Base size of the Elastic San appliance in TiB. - BaseSizeTiB *int64 `json:"baseSizeTiB,omitempty"` - - // Extended size of the Elastic San appliance in TiB. - ExtendedCapacitySizeTiB *int64 `json:"extendedCapacitySizeTiB,omitempty"` -} - -// IscsiTargetInfo - Iscsi target information -type IscsiTargetInfo struct { - // Operational status of the iSCSI Target. - Status *OperationalStatus `json:"status,omitempty"` - - // READ-ONLY; State of the operation on the resource. - ProvisioningState *ProvisioningStates `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". - TargetIqn *string `json:"targetIqn,omitempty" azure:"ro"` - - // READ-ONLY; iSCSI Target Portal Host Name - TargetPortalHostname *string `json:"targetPortalHostname,omitempty" azure:"ro"` - - // READ-ONLY; iSCSI Target Portal Port - TargetPortalPort *int32 `json:"targetPortalPort,omitempty" azure:"ro"` -} - -// NetworkRuleSet - A set of rules governing the network accessibility. -type NetworkRuleSet struct { - // The list of virtual network rules. - VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // SKU - The SKU name. Required for account creation; optional for update. type SKU struct { // REQUIRED; The sku name. @@ -285,6 +269,24 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } +// Update - Response for ElasticSan update request. +type Update struct { + // Properties of ElasticSan. + Properties *UpdateProperties `json:"properties,omitempty"` + + // Update tags + Tags map[string]*string `json:"tags,omitempty"` +} + +// UpdateProperties - Elastic San update properties. +type UpdateProperties struct { + // Base size of the Elastic San appliance in TiB. + BaseSizeTiB *int64 `json:"baseSizeTiB,omitempty"` + + // Extended size of the Elastic San appliance in TiB. + ExtendedCapacitySizeTiB *int64 `json:"extendedCapacitySizeTiB,omitempty"` +} + // VirtualNetworkRule - Virtual Network rule. type VirtualNetworkRule struct { // REQUIRED; Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/models_serde.go b/sdk/resourcemanager/elasticsan/armelasticsan/models_serde.go similarity index 86% rename from sdk/resourcemanager/elasticsans/armelasticsans/models_serde.go rename to sdk/resourcemanager/elasticsan/armelasticsan/models_serde.go index 00a78fb04ad7..218d00d66daf 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/models_serde.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/models_serde.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "encoding/json" @@ -67,332 +67,270 @@ func (e *ElasticSan) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanList. -func (e ElasticSanList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IscsiTargetInfo. +func (i IscsiTargetInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "status", i.Status) + populate(objectMap, "targetIqn", i.TargetIqn) + populate(objectMap, "targetPortalHostname", i.TargetPortalHostname) + populate(objectMap, "targetPortalPort", i.TargetPortalPort) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanList. -func (e *ElasticSanList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IscsiTargetInfo. +func (i *IscsiTargetInfo) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticSanOperationDisplay. -func (e ElasticSanOperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", e.Description) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "provider", e.Provider) - populate(objectMap, "resource", e.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanOperationDisplay. -func (e *ElasticSanOperationDisplay) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &e.Description) + case "status": + err = unpopulate(val, "Status", &i.Status) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) + case "targetIqn": + err = unpopulate(val, "TargetIqn", &i.TargetIqn) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &e.Provider) + case "targetPortalHostname": + err = unpopulate(val, "TargetPortalHostname", &i.TargetPortalHostname) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &e.Resource) + case "targetPortalPort": + err = unpopulate(val, "TargetPortalPort", &i.TargetPortalPort) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanOperationListResult. -func (e ElasticSanOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type List. +func (l List) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanOperationListResult. -func (e *ElasticSanOperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type List. +func (l *List) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanProperties. -func (e ElasticSanProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityZones", e.AvailabilityZones) - populate(objectMap, "baseSizeTiB", e.BaseSizeTiB) - populate(objectMap, "extendedCapacitySizeTiB", e.ExtendedCapacitySizeTiB) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "totalIops", e.TotalIops) - populate(objectMap, "totalMBps", e.TotalMBps) - populate(objectMap, "totalSizeTiB", e.TotalSizeTiB) - populate(objectMap, "totalVolumeSizeGiB", e.TotalVolumeSizeGiB) - populate(objectMap, "volumeGroupCount", e.VolumeGroupCount) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanProperties. -func (e *ElasticSanProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "availabilityZones": - err = unpopulate(val, "AvailabilityZones", &e.AvailabilityZones) - delete(rawMsg, key) - case "baseSizeTiB": - err = unpopulate(val, "BaseSizeTiB", &e.BaseSizeTiB) - delete(rawMsg, key) - case "extendedCapacitySizeTiB": - err = unpopulate(val, "ExtendedCapacitySizeTiB", &e.ExtendedCapacitySizeTiB) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &e.SKU) - delete(rawMsg, key) - case "totalIops": - err = unpopulate(val, "TotalIops", &e.TotalIops) - delete(rawMsg, key) - case "totalMBps": - err = unpopulate(val, "TotalMBps", &e.TotalMBps) - delete(rawMsg, key) - case "totalSizeTiB": - err = unpopulate(val, "TotalSizeTiB", &e.TotalSizeTiB) - delete(rawMsg, key) - case "totalVolumeSizeGiB": - err = unpopulate(val, "TotalVolumeSizeGiB", &e.TotalVolumeSizeGiB) - delete(rawMsg, key) - case "volumeGroupCount": - err = unpopulate(val, "VolumeGroupCount", &e.VolumeGroupCount) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanRPOperation. -func (e ElasticSanRPOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "display", e.Display) - populate(objectMap, "isDataAction", e.IsDataAction) - populate(objectMap, "name", e.Name) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanRPOperation. -func (e *ElasticSanRPOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &e.Display) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &e.IsDataAction) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanUpdate. -func (e ElasticSanUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanUpdate. -func (e *ElasticSanUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticSanUpdateProperties. -func (e ElasticSanUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Properties. +func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "baseSizeTiB", e.BaseSizeTiB) - populate(objectMap, "extendedCapacitySizeTiB", e.ExtendedCapacitySizeTiB) + populate(objectMap, "availabilityZones", p.AvailabilityZones) + populate(objectMap, "baseSizeTiB", p.BaseSizeTiB) + populate(objectMap, "extendedCapacitySizeTiB", p.ExtendedCapacitySizeTiB) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "totalIops", p.TotalIops) + populate(objectMap, "totalMBps", p.TotalMBps) + populate(objectMap, "totalSizeTiB", p.TotalSizeTiB) + populate(objectMap, "totalVolumeSizeGiB", p.TotalVolumeSizeGiB) + populate(objectMap, "volumeGroupCount", p.VolumeGroupCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanUpdateProperties. -func (e *ElasticSanUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. +func (p *Properties) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &p.AvailabilityZones) + delete(rawMsg, key) case "baseSizeTiB": - err = unpopulate(val, "BaseSizeTiB", &e.BaseSizeTiB) + err = unpopulate(val, "BaseSizeTiB", &p.BaseSizeTiB) delete(rawMsg, key) case "extendedCapacitySizeTiB": - err = unpopulate(val, "ExtendedCapacitySizeTiB", &e.ExtendedCapacitySizeTiB) + err = unpopulate(val, "ExtendedCapacitySizeTiB", &p.ExtendedCapacitySizeTiB) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IscsiTargetInfo. -func (i IscsiTargetInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "status", i.Status) - populate(objectMap, "targetIqn", i.TargetIqn) - populate(objectMap, "targetPortalHostname", i.TargetPortalHostname) - populate(objectMap, "targetPortalPort", i.TargetPortalPort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IscsiTargetInfo. -func (i *IscsiTargetInfo) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "targetIqn": - err = unpopulate(val, "TargetIqn", &i.TargetIqn) + case "totalIops": + err = unpopulate(val, "TotalIops", &p.TotalIops) delete(rawMsg, key) - case "targetPortalHostname": - err = unpopulate(val, "TargetPortalHostname", &i.TargetPortalHostname) + case "totalMBps": + err = unpopulate(val, "TotalMBps", &p.TotalMBps) delete(rawMsg, key) - case "targetPortalPort": - err = unpopulate(val, "TargetPortalPort", &i.TargetPortalPort) + case "totalSizeTiB": + err = unpopulate(val, "TotalSizeTiB", &p.TotalSizeTiB) + delete(rawMsg, key) + case "totalVolumeSizeGiB": + err = unpopulate(val, "TotalVolumeSizeGiB", &p.TotalVolumeSizeGiB) + delete(rawMsg, key) + case "volumeGroupCount": + err = unpopulate(val, "VolumeGroupCount", &p.VolumeGroupCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. -func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RPOperation. +func (r RPOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + populate(objectMap, "display", r.Display) + populate(objectMap, "isDataAction", r.IsDataAction) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. -func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RPOperation. +func (r *RPOperation) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "virtualNetworkRules": - err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + case "display": + err = unpopulate(val, "Display", &r.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &r.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -643,6 +581,68 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Update. +func (u *Update) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateProperties. +func (u UpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "baseSizeTiB", u.BaseSizeTiB) + populate(objectMap, "extendedCapacitySizeTiB", u.ExtendedCapacitySizeTiB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties. +func (u *UpdateProperties) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseSizeTiB": + err = unpopulate(val, "BaseSizeTiB", &u.BaseSizeTiB) + delete(rawMsg, key) + case "extendedCapacitySizeTiB": + err = unpopulate(val, "ExtendedCapacitySizeTiB", &u.ExtendedCapacitySizeTiB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/operations_client.go b/sdk/resourcemanager/elasticsan/armelasticsan/operations_client.go similarity index 96% rename from sdk/resourcemanager/elasticsans/armelasticsans/operations_client.go rename to sdk/resourcemanager/elasticsan/armelasticsan/operations_client.go index 8263cb623a82..902fec944795 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/operations_client.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/operations_client.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "context" @@ -91,7 +91,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticSanOperationListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/operations_client_example_test.go b/sdk/resourcemanager/elasticsan/armelasticsan/operations_client_example_test.go similarity index 92% rename from sdk/resourcemanager/elasticsans/armelasticsans/operations_client_example_test.go rename to sdk/resourcemanager/elasticsan/armelasticsan/operations_client_example_test.go index c79566d8de41..4d32e410ff0d 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/operations_client_example_test.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/operations_client_example_test.go @@ -6,14 +6,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armelasticsans_test +package armelasticsan_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MaximumSet_Gen.json @@ -23,7 +23,7 @@ func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewOperationsClient(cred, nil) + client, err := armelasticsan.NewOperationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -47,7 +47,7 @@ func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewOperationsClient(cred, nil) + client, err := armelasticsan.NewOperationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/response_types.go b/sdk/resourcemanager/elasticsan/armelasticsan/response_types.go similarity index 70% rename from sdk/resourcemanager/elasticsans/armelasticsans/response_types.go rename to sdk/resourcemanager/elasticsan/armelasticsan/response_types.go index 62613637ef78..decbc26172fc 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/response_types.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/response_types.go @@ -7,41 +7,41 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan -// ClientCreateResponse contains the response from method Client.Create. -type ClientCreateResponse struct { +// ElasticSansClientCreateResponse contains the response from method ElasticSansClient.Create. +type ElasticSansClientCreateResponse struct { ElasticSan } -// ClientDeleteResponse contains the response from method Client.Delete. -type ClientDeleteResponse struct { +// ElasticSansClientDeleteResponse contains the response from method ElasticSansClient.Delete. +type ElasticSansClientDeleteResponse struct { // placeholder for future response values } -// ClientGetResponse contains the response from method Client.Get. -type ClientGetResponse struct { +// ElasticSansClientGetResponse contains the response from method ElasticSansClient.Get. +type ElasticSansClientGetResponse struct { ElasticSan } -// ClientListByResourceGroupResponse contains the response from method Client.ListByResourceGroup. -type ClientListByResourceGroupResponse struct { - ElasticSanList +// ElasticSansClientListByResourceGroupResponse contains the response from method ElasticSansClient.ListByResourceGroup. +type ElasticSansClientListByResourceGroupResponse struct { + List } -// ClientListBySubscriptionResponse contains the response from method Client.ListBySubscription. -type ClientListBySubscriptionResponse struct { - ElasticSanList +// ElasticSansClientListBySubscriptionResponse contains the response from method ElasticSansClient.ListBySubscription. +type ElasticSansClientListBySubscriptionResponse struct { + List } -// ClientUpdateResponse contains the response from method Client.Update. -type ClientUpdateResponse struct { +// ElasticSansClientUpdateResponse contains the response from method ElasticSansClient.Update. +type ElasticSansClientUpdateResponse struct { ElasticSan } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - ElasticSanOperationListResult + OperationListResult } // SKUsClientListResponse contains the response from method SKUsClient.List. diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/skus_client.go b/sdk/resourcemanager/elasticsan/armelasticsan/skus_client.go similarity index 99% rename from sdk/resourcemanager/elasticsans/armelasticsans/skus_client.go rename to sdk/resourcemanager/elasticsan/armelasticsan/skus_client.go index 25b4a13b306a..8a33877a3058 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/skus_client.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/skus_client.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "context" diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/skus_client_example_test.go b/sdk/resourcemanager/elasticsan/armelasticsan/skus_client_example_test.go similarity index 84% rename from sdk/resourcemanager/elasticsans/armelasticsans/skus_client_example_test.go rename to sdk/resourcemanager/elasticsan/armelasticsan/skus_client_example_test.go index cb2c7a81b824..9555327e2b4e 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/skus_client_example_test.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/skus_client_example_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armelasticsans_test +package armelasticsan_test import ( "context" @@ -14,7 +14,7 @@ import ( "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/elasticsans/armelasticsans" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json @@ -24,11 +24,11 @@ func ExampleSKUsClient_NewListPager_skusListMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewSKUsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewSKUsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(&armelasticsans.SKUsClientListOptions{Filter: to.Ptr("aaaa")}) + pager := client.NewListPager(&armelasticsan.SKUsClientListOptions{Filter: to.Ptr("aaaa")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -48,11 +48,11 @@ func ExampleSKUsClient_NewListPager_skusListMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewSKUsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewSKUsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(&armelasticsans.SKUsClientListOptions{Filter: nil}) + pager := client.NewListPager(&armelasticsan.SKUsClientListOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/time_rfc3339.go b/sdk/resourcemanager/elasticsan/armelasticsan/time_rfc3339.go similarity index 98% rename from sdk/resourcemanager/elasticsans/armelasticsans/time_rfc3339.go rename to sdk/resourcemanager/elasticsan/armelasticsan/time_rfc3339.go index a03f2d8b6614..730065b374d4 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/time_rfc3339.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/time_rfc3339.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "encoding/json" diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client.go b/sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client.go similarity index 99% rename from sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client.go rename to sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client.go index d37a15545d7a..184475efb7c1 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "context" diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client_example_test.go b/sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client_example_test.go similarity index 83% rename from sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client_example_test.go rename to sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client_example_test.go index e26160f8c166..0970f8bd7a67 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/volumegroups_client_example_test.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/volumegroups_client_example_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armelasticsans_test +package armelasticsan_test import ( "context" @@ -14,7 +14,7 @@ import ( "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/elasticsans/armelasticsans" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json @@ -24,7 +24,7 @@ func ExampleVolumeGroupsClient_NewListByElasticSanPager_volumeGroupsListByElasti log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -48,7 +48,7 @@ func ExampleVolumeGroupsClient_NewListByElasticSanPager_volumeGroupsListByElasti log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -72,24 +72,24 @@ func ExampleVolumeGroupsClient_BeginCreate_volumeGroupsCreateMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsans.VolumeGroup{ + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsan.VolumeGroup{ Tags: map[string]*string{ "key5933": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), }, - Properties: &armelasticsans.VolumeGroupProperties{ - Encryption: to.Ptr(armelasticsans.EncryptionTypeEncryptionAtRestWithPlatformKey), - NetworkACLs: &armelasticsans.NetworkRuleSet{ - VirtualNetworkRules: []*armelasticsans.VirtualNetworkRule{ + Properties: &armelasticsan.VolumeGroupProperties{ + Encryption: to.Ptr(armelasticsan.EncryptionTypeEncryptionAtRestWithPlatformKey), + NetworkACLs: &armelasticsan.NetworkRuleSet{ + VirtualNetworkRules: []*armelasticsan.VirtualNetworkRule{ { Action: to.Ptr("Allow"), VirtualNetworkResourceID: to.Ptr("aaaaaaaaaaaaaaaa"), }}, }, - ProtocolType: to.Ptr(armelasticsans.StorageTargetTypeIscsi), + ProtocolType: to.Ptr(armelasticsan.StorageTargetTypeIscsi), }, }, nil) if err != nil { @@ -110,11 +110,11 @@ func ExampleVolumeGroupsClient_BeginCreate_volumeGroupsCreateMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsans.VolumeGroup{}, nil) + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsan.VolumeGroup{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -133,21 +133,21 @@ func ExampleVolumeGroupsClient_BeginUpdate_volumeGroupsUpdateMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsans.VolumeGroupUpdate{ - Properties: &armelasticsans.VolumeGroupUpdateProperties{ - Encryption: to.Ptr(armelasticsans.EncryptionTypeEncryptionAtRestWithPlatformKey), - NetworkACLs: &armelasticsans.NetworkRuleSet{ - VirtualNetworkRules: []*armelasticsans.VirtualNetworkRule{ + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsan.VolumeGroupUpdate{ + Properties: &armelasticsan.VolumeGroupUpdateProperties{ + Encryption: to.Ptr(armelasticsan.EncryptionTypeEncryptionAtRestWithPlatformKey), + NetworkACLs: &armelasticsan.NetworkRuleSet{ + VirtualNetworkRules: []*armelasticsan.VirtualNetworkRule{ { Action: to.Ptr("Allow"), VirtualNetworkResourceID: to.Ptr("aaaaaaaaaaaaaaaa"), }}, }, - ProtocolType: to.Ptr(armelasticsans.StorageTargetTypeIscsi), + ProtocolType: to.Ptr(armelasticsan.StorageTargetTypeIscsi), }, Tags: map[string]*string{ "key7542": to.Ptr("aaaaaaaaaaaaaaaaaaaa"), @@ -171,11 +171,11 @@ func ExampleVolumeGroupsClient_BeginUpdate_volumeGroupsUpdateMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsans.VolumeGroupUpdate{}, nil) + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", armelasticsan.VolumeGroupUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -194,7 +194,7 @@ func ExampleVolumeGroupsClient_BeginDelete_volumeGroupsDeleteMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -215,7 +215,7 @@ func ExampleVolumeGroupsClient_BeginDelete_volumeGroupsDeleteMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -236,7 +236,7 @@ func ExampleVolumeGroupsClient_Get_volumeGroupsGetMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -255,7 +255,7 @@ func ExampleVolumeGroupsClient_Get_volumeGroupsGetMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumeGroupsClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/volumes_client.go b/sdk/resourcemanager/elasticsan/armelasticsan/volumes_client.go similarity index 99% rename from sdk/resourcemanager/elasticsans/armelasticsans/volumes_client.go rename to sdk/resourcemanager/elasticsan/armelasticsan/volumes_client.go index 82eb8c018c1b..81eef96635fc 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/volumes_client.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/volumes_client.go @@ -7,7 +7,7 @@ // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. -package armelasticsans +package armelasticsan import ( "context" diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/volumes_client_example_test.go b/sdk/resourcemanager/elasticsan/armelasticsan/volumes_client_example_test.go similarity index 87% rename from sdk/resourcemanager/elasticsans/armelasticsans/volumes_client_example_test.go rename to sdk/resourcemanager/elasticsan/armelasticsan/volumes_client_example_test.go index 945148160062..0c9b41cc9616 100644 --- a/sdk/resourcemanager/elasticsans/armelasticsans/volumes_client_example_test.go +++ b/sdk/resourcemanager/elasticsan/armelasticsan/volumes_client_example_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armelasticsans_test +package armelasticsan_test import ( "context" @@ -14,7 +14,7 @@ import ( "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/elasticsans/armelasticsans" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsan/armelasticsan" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json @@ -24,16 +24,16 @@ func ExampleVolumesClient_BeginCreate_volumesCreateMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsans.Volume{ + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsan.Volume{ Tags: map[string]*string{ "key7423": to.Ptr("aaaa"), }, - Properties: &armelasticsans.VolumeProperties{ - CreationData: &armelasticsans.SourceCreationData{ + Properties: &armelasticsan.VolumeProperties{ + CreationData: &armelasticsan.SourceCreationData{ CreateSource: to.Ptr("None"), SourceURI: to.Ptr("aaaaaa"), }, @@ -58,11 +58,11 @@ func ExampleVolumesClient_BeginCreate_volumesCreateMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsans.Volume{}, nil) + poller, err := client.BeginCreate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsan.Volume{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -81,12 +81,12 @@ func ExampleVolumesClient_BeginUpdate_volumesUpdateMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsans.VolumeUpdate{ - Properties: &armelasticsans.VolumeUpdateProperties{ + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsan.VolumeUpdate{ + Properties: &armelasticsan.VolumeUpdateProperties{ SizeGiB: to.Ptr[int64](9), }, Tags: map[string]*string{ @@ -111,11 +111,11 @@ func ExampleVolumesClient_BeginUpdate_volumesUpdateMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsans.VolumeUpdate{}, nil) + poller, err := client.BeginUpdate(ctx, "rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", armelasticsan.VolumeUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -134,7 +134,7 @@ func ExampleVolumesClient_BeginDelete_volumesDeleteMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -155,7 +155,7 @@ func ExampleVolumesClient_BeginDelete_volumesDeleteMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -176,7 +176,7 @@ func ExampleVolumesClient_Get_volumesGetMaximumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -195,7 +195,7 @@ func ExampleVolumesClient_Get_volumesGetMinimumSetGen() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -214,7 +214,7 @@ func ExampleVolumesClient_NewListByVolumeGroupPager_volumesListByVolumeGroupMaxi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -238,7 +238,7 @@ func ExampleVolumesClient_NewListByVolumeGroupPager_volumesListByVolumeGroupMini log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armelasticsans.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) + client, err := armelasticsan.NewVolumesClient("aaaaaaaaaaaaaaaaaa", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/CHANGELOG.md b/sdk/resourcemanager/elasticsans/armelasticsans/CHANGELOG.md deleted file mode 100644 index 21bd663fb1d4..000000000000 --- a/sdk/resourcemanager/elasticsans/armelasticsans/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -# Release History - -## 0.1.1 (2022-10-12) - -### Other Changes -- Retract this module because of wrong namespace. - -## 0.1.0 (2022-09-20) - -The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elasticsans/armelasticsans` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). diff --git a/sdk/resourcemanager/elasticsans/armelasticsans/autorest.md b/sdk/resourcemanager/elasticsans/armelasticsans/autorest.md deleted file mode 100644 index 1ed2e1ff15ee..000000000000 --- a/sdk/resourcemanager/elasticsans/armelasticsans/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/elasticsan/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/elasticsan/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.1 - -``` \ No newline at end of file