From db51bb93bef7af3b3a96e0e0550533a50fe5d29a Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 21 Mar 2023 13:26:03 +0800 Subject: [PATCH] change mgmt. example generation to use `ClientFactory` (#939) * switch example to ClientFactory * bump version and add changelog * format code * format --- packages/autorest.gotest/CHANGELOG.json | 12 ++ packages/autorest.gotest/CHANGELOG.md | 9 +- packages/autorest.gotest/README.md | 2 +- packages/autorest.gotest/package.json | 4 +- .../src/generator/exampleGenerator.ts | 73 +++++-- .../src/template/exampleTest.go.njk | 12 +- .../armagrifood/__debug/go-tester-pre.yaml | 1 - .../armagrifood/__debug/go-tester.yaml | 4 +- .../extensions_client_example_test.go | 20 +- ...farmbeatsextensions_client_example_test.go | 8 +- .../farmbeatsmodels_client_example_test.go | 32 +-- .../locations_client_example_test.go | 8 +- .../operations_client_example_test.go | 4 +- ...endpointconnections_client_example_test.go | 16 +- ...rivatelinkresources_client_example_test.go | 8 +- .../armappplatform/__debug/go-tester-pre.yaml | 1 - .../armappplatform/__debug/go-tester.yaml | 4 +- .../apps_client_example_test.go | 28 +-- .../bindings_client_example_test.go | 20 +- .../certificates_client_example_test.go | 16 +- .../configservers_client_example_test.go | 16 +- .../customdomains_client_example_test.go | 20 +- .../deployments_client_example_test.go | 40 ++-- .../monitoringsettings_client_example_test.go | 12 +- .../operations_client_example_test.go | 4 +- .../runtimeversions_client_example_test.go | 4 +- .../services_client_example_test.go | 48 ++--- .../skus_client_example_test.go | 4 +- .../armcompute/__debug/go-tester-pre.yaml | 1 - .../compute/armcompute/__debug/go-tester.yaml | 4 +- .../availabilitysets_client_example_test.go | 8 +- ...iceoperatingsystems_client_example_test.go | 16 +- ...erviceroleinstances_client_example_test.go | 28 +-- .../cloudserviceroles_client_example_test.go | 8 +- .../cloudservices_client_example_test.go | 64 +++--- ...ervicesupdatedomain_client_example_test.go | 12 +- ...dedicatedhostgroups_client_example_test.go | 8 +- .../dedicatedhosts_client_example_test.go | 8 +- .../diskaccesses_client_example_test.go | 48 ++--- .../diskencryptionsets_client_example_test.go | 40 ++-- .../diskrestorepoint_client_example_test.go | 8 +- .../armcompute/disks_client_example_test.go | 88 ++++---- .../galleries_client_example_test.go | 32 +-- ...galleryapplications_client_example_test.go | 20 +- ...applicationversions_client_example_test.go | 24 +-- .../galleryimages_client_example_test.go | 20 +- ...alleryimageversions_client_example_test.go | 52 ++--- ...llerysharingprofile_client_example_test.go | 8 +- .../armcompute/images_client_example_test.go | 56 ++--- .../loganalytics_client_example_test.go | 8 +- ...mityplacementgroups_client_example_test.go | 24 +-- .../resourceskus_client_example_test.go | 8 +- ...orepointcollections_client_example_test.go | 20 +- .../restorepoints_client_example_test.go | 8 +- .../sharedgalleries_client_example_test.go | 8 +- ...sharedgalleryimages_client_example_test.go | 8 +- ...alleryimageversions_client_example_test.go | 8 +- .../snapshots_client_example_test.go | 24 +-- .../sshpublickeys_client_example_test.go | 12 +- ...lmachineruncommands_client_example_test.go | 28 +-- .../virtualmachines_client_example_test.go | 196 +++++++++--------- ...esetrollingupgrades_client_example_test.go | 4 +- ...ualmachinescalesets_client_example_test.go | 116 +++++------ ...calesetvmextensions_client_example_test.go | 20 +- ...alesetvmruncommands_client_example_test.go | 20 +- ...lmachinescalesetvms_client_example_test.go | 24 +-- .../__debug/go-tester-pre.yaml | 1 - .../__debug/go-tester.yaml | 4 +- .../batchdeployments_client_example_test.go | 20 +- .../batchendpoints_client_example_test.go | 24 +-- .../codecontainers_client_example_test.go | 16 +- .../codeversions_client_example_test.go | 16 +- ...componentcontainers_client_example_test.go | 16 +- .../componentversions_client_example_test.go | 16 +- .../compute_client_example_test.go | 80 +++---- .../datacontainers_client_example_test.go | 16 +- .../datastores_client_example_test.go | 32 +-- .../dataversions_client_example_test.go | 16 +- ...vironmentcontainers_client_example_test.go | 16 +- ...environmentversions_client_example_test.go | 16 +- .../jobs_client_example_test.go | 56 ++--- .../modelcontainers_client_example_test.go | 16 +- .../modelversions_client_example_test.go | 16 +- .../onlinedeployments_client_example_test.go | 44 ++-- .../onlineendpoints_client_example_test.go | 32 +-- .../operations_client_example_test.go | 4 +- ...endpointconnections_client_example_test.go | 16 +- ...rivatelinkresources_client_example_test.go | 4 +- .../quotas_client_example_test.go | 8 +- .../usages_client_example_test.go | 4 +- ...virtualmachinesizes_client_example_test.go | 4 +- ...orkspaceconnections_client_example_test.go | 16 +- .../workspacefeatures_client_example_test.go | 4 +- .../workspaces_client_example_test.go | 56 ++--- .../armsignalr/__debug/go-tester-pre.yaml | 1 - .../signalr/armsignalr/__debug/go-tester.yaml | 4 +- .../signalr/armsignalr/client_example_test.go | 40 ++-- .../operations_client_example_test.go | 4 +- ...endpointconnections_client_example_test.go | 16 +- ...rivatelinkresources_client_example_test.go | 4 +- ...rivatelinkresources_client_example_test.go | 16 +- .../armsignalr/usages_client_example_test.go | 4 +- .../__snapshots__/testGoTester.ts.snap | 96 ++++----- 103 files changed, 1167 insertions(+), 1106 deletions(-) diff --git a/packages/autorest.gotest/CHANGELOG.json b/packages/autorest.gotest/CHANGELOG.json index d0ed8c9d9..d50b23e07 100644 --- a/packages/autorest.gotest/CHANGELOG.json +++ b/packages/autorest.gotest/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@autorest/gotest", "entries": [ + { + "version": "4.6.0", + "tag": "@autorest/gotest_v4.6.0", + "date": "Mon, 13 Mar 2023 09:28:18 GMT", + "comments": { + "minor": [ + { + "comment": "Change example generation to use `ClientFactory`." + } + ] + } + }, { "version": "4.5.2", "tag": "@autorest/gotest_v4.5.2", diff --git a/packages/autorest.gotest/CHANGELOG.md b/packages/autorest.gotest/CHANGELOG.md index 08b650b8c..b0e77c91a 100644 --- a/packages/autorest.gotest/CHANGELOG.md +++ b/packages/autorest.gotest/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @autorest/gotest -This log was last generated on Mon, 30 Jan 2023 08:26:19 GMT and should not be manually modified. +This log was last generated on Mon, 13 Mar 2023 09:28:18 GMT and should not be manually modified. + +## 4.6.0 +Mon, 13 Mar 2023 09:28:18 GMT + +### Minor changes + +- Change example generation to use `ClientFactory`. ## 4.5.2 Mon, 30 Jan 2023 08:26:19 GMT diff --git a/packages/autorest.gotest/README.md b/packages/autorest.gotest/README.md index 0734d3e9a..2da86269c 100644 --- a/packages/autorest.gotest/README.md +++ b/packages/autorest.gotest/README.md @@ -62,7 +62,7 @@ testmodeler: version: 3.8.2 use-extension: - '@autorest/go': '4.0.0-preview.45' + '@autorest/go': '4.0.0-preview.47' '@autorest/testmodeler': '2.3.2' pipeline: diff --git a/packages/autorest.gotest/package.json b/packages/autorest.gotest/package.json index d07ce8ed0..c0e81d519 100644 --- a/packages/autorest.gotest/package.json +++ b/packages/autorest.gotest/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/gotest", - "version": "4.5.2", + "version": "4.6.0", "description": "Autorest extension for go test generation", "main": "dist/index.js", "scripts": { @@ -47,7 +47,7 @@ "dependencies": { "@autorest/codemodel": "~4.18.2", "@autorest/extension-base": "~3.4.4", - "@autorest/go": "~4.0.0-preview.45", + "@autorest/go": "~4.0.0-preview.47", "@autorest/testmodeler": "~2.3.2", "@azure-tools/codegen": "~2.9.1", "@azure-tools/linq": "~3.1.0", diff --git a/packages/autorest.gotest/src/generator/exampleGenerator.ts b/packages/autorest.gotest/src/generator/exampleGenerator.ts index 607b78cc2..1ce3954fb 100644 --- a/packages/autorest.gotest/src/generator/exampleGenerator.ts +++ b/packages/autorest.gotest/src/generator/exampleGenerator.ts @@ -3,15 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BaseCodeGenerator } from './baseGenerator'; -import { Config } from '../common/constant'; +import { ObjectSchema, Parameter, SchemaType } from '@autorest/codemodel'; +import { sortParametersByRequired } from '@autorest/go/dist/generator/helpers'; import { ExampleModel, MockTestDefinitionModel } from '@autorest/testmodeler/dist/src/core/model'; -import { MockTestDataRender } from './mockTestGenerator'; +import { camelCase, trimEnd } from 'lodash'; +import { Config } from '../common/constant'; import { ParameterOutput } from '../common/model'; -import { camelCase } from 'lodash'; -import _ = require('lodash'); +import { BaseCodeGenerator } from './baseGenerator'; +import { MockTestDataRender } from './mockTestGenerator'; -export class ExampleDataRender extends MockTestDataRender {} +export class ExampleDataRender extends MockTestDataRender { + public renderData(): void { + super.renderData(); + const allClientParams = new Array(); + for (const group of this.context.codeModel.operationGroups) { + if (group.language.go!.clientParams) { + const clientParams = >group.language.go!.clientParams; + for (const clientParam of clientParams) { + if (allClientParams.filter((cp) => cp.language.go!.name === clientParam.language.go!.name).length > 0) { + continue; + } + allClientParams.push(clientParam); + } + } + } + allClientParams.sort(sortParametersByRequired); + const clientFactoryParametersOutput = new Array(); + for (const clientParam of allClientParams) { + const isPolymophismValue = clientParam?.schema?.type === SchemaType.Object && (clientParam.schema).discriminator?.property.isDiscriminator === true; + const isPtr: boolean = isPolymophismValue || !(clientParam.required || clientParam.language.go.byValue === true); + clientFactoryParametersOutput.push(new ParameterOutput(this.getLanguageName(clientParam), this.getDefaultValue(clientParam, isPtr))); + } + this.context.codeModel.testModel.mockTest['clientFactoryParametersOutput'] = clientFactoryParametersOutput; + } +} export class ExampleCodeGenerator extends BaseCodeGenerator { public generateCode(extraParam: Record = {}): void { @@ -32,19 +57,23 @@ export class ExampleCodeGenerator extends BaseCodeGenerator { fileName = fileName.substring(0, fileName.length - 6) + '_client'; } - this.renderAndWrite({ exampleGroups: exampleGroups, swaggerCommit: this.context.swaggerCommit }, 'exampleTest.go.njk', `${this.getFilePrefix(Config.exampleFilePrefix)}${fileName}_example_test.go`, extraParam, { - getParamsValue: (params: Array) => { - return params - .map((p) => { - return p.paramOutput; - }) - .join(', '); + this.renderAndWrite( + { + clientFactoryParametersOutput: this.context.codeModel.testModel.mockTest['clientFactoryParametersOutput'], + exampleGroups: exampleGroups, + swaggerCommit: this.context.swaggerCommit, }, - getExampleSuffix: (exampleKey: string) => { - return camelCase(exampleKey); + 'exampleTest.go.njk', + `${this.getFilePrefix(Config.exampleFilePrefix)}${fileName}_example_test.go`, + extraParam, + { + getParamsValue: this.getParamsValue, + getExampleSuffix: (exampleKey: string) => { + return camelCase(exampleKey); + }, + getCommentResponseOutput: this.getCommentResponseOutput, }, - getCommentResponseOutput: this.getCommentResponseOutput, - }); + ); } } @@ -71,6 +100,14 @@ export class ExampleCodeGenerator extends BaseCodeGenerator { indentNum++; } } - return _.trimEnd(result, '\n'); + return trimEnd(result, '\n'); + } + + public getParamsValue(params: Array) { + return params + .map((p) => { + return p.paramOutput; + }) + .join(', '); } } diff --git a/packages/autorest.gotest/src/template/exampleTest.go.njk b/packages/autorest.gotest/src/template/exampleTest.go.njk index 39b3de811..744a77166 100644 --- a/packages/autorest.gotest/src/template/exampleTest.go.njk +++ b/packages/autorest.gotest/src/template/exampleTest.go.njk @@ -26,15 +26,15 @@ func Example{{example.operationGroup.language.go.clientName}}_{{example.opName}} log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := {{packageName}}.{{example.operationGroup.language.go.clientCtorName}}({{jsFunc.getParamsValue(example.clientParametersOutput) + ", " if example.clientParametersOutput.length>0 else ""}}cred, nil) - if err != nil { + clientFactory, err := {{packageName}}.NewClientFactory({{jsFunc.getParamsValue(clientFactoryParametersOutput) + ", " if clientFactoryParametersOutput.length>0 else ""}}cred, nil) + if err != nil { log.Fatalf("failed to create client: %v", err) } {%- if example.returnInfo.length == 2 %} {%- if example.isLRO %} - poller, err := client.{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) + poller, err := clientFactory.{{example.operationGroup.language.go.clientCtorName}}().{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) {%- else %} - {% if example.checkResponse %}res{% else %}_{% endif %}, err {% if example.checkResponse %}:{% endif %}= client.{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) + {% if example.checkResponse %}res{% else %}_{% endif %}, err {% if example.checkResponse %}:{% endif %}= clientFactory.{{example.operationGroup.language.go.clientCtorName}}().{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) {%- endif %} if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -46,7 +46,7 @@ func Example{{example.operationGroup.language.go.clientName}}_{{example.opName}} } {%- endif %} {%- elif (example.returnInfo.length == 1) and (example.isPageable) %} - pager := client.{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) + pager := clientFactory.{{example.operationGroup.language.go.clientCtorName}}().{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -60,7 +60,7 @@ func Example{{example.operationGroup.language.go.clientName}}_{{example.opName}} // page{% if not example.responseIsDiscriminator %}.{{example.responseType}}{% endif %} = {{jsFunc.getCommentResponseOutput(example.responseOutput)}} } {%- else %} - client.{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) + clientFactory.{{example.operationGroup.language.go.clientCtorName}}().{{example.opName}}({{jsFunc.getParamsValue(example.methodParametersOutput)}}) {%- endif %} {%- if example.isLRO and example.isPageable and example.checkResponse %} for res.More() { diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester-pre.yaml b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester-pre.yaml index 26504a3a4..10a5ae955 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester-pre.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester-pre.yaml @@ -12435,7 +12435,6 @@ language: name: AzureAgFoodPlatformRPService description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester.yaml b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester.yaml index f2ed16c89..27b6c05c7 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/__debug/go-tester.yaml @@ -8913,6 +8913,9 @@ security: - https://management.azure.com/.default testModel: mockTest: + clientFactoryParametersOutput: + - paramName: subscriptionID + paramOutput: '""' exampleGroups: - operationId: Extensions_Create examples: @@ -13874,7 +13877,6 @@ language: name: AzureAgFoodPlatformRPService description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/extensions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/extensions_client_example_test.go index feba92164..9e21b287a 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/extensions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/extensions_client_example_test.go @@ -24,11 +24,11 @@ func ExampleExtensionsClient_Create() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Create(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) + _, err = clientFactory.NewExtensionsClient().Create(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -41,11 +41,11 @@ func ExampleExtensionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) + res, err := clientFactory.NewExtensionsClient().Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -81,11 +81,11 @@ func ExampleExtensionsClient_Update() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Update(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) + res, err := clientFactory.NewExtensionsClient().Update(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -121,11 +121,11 @@ func ExampleExtensionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) + _, err = clientFactory.NewExtensionsClient().Delete(ctx, "examples-rg", "examples-farmbeatsResourceName", "provider.extension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -138,11 +138,11 @@ func ExampleExtensionsClient_NewListByFarmBeatsPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByFarmBeatsPager("examples-rg", "examples-farmbeatsResourceName", &armagrifood.ExtensionsClientListByFarmBeatsOptions{ExtensionIDs: []string{}, + pager := clientFactory.NewExtensionsClient().NewListByFarmBeatsPager("examples-rg", "examples-farmbeatsResourceName", &armagrifood.ExtensionsClientListByFarmBeatsOptions{ExtensionIDs: []string{}, ExtensionCategories: []string{}, MaxPageSize: nil, SkipToken: nil, diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsextensions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsextensions_client_example_test.go index 46b36c519..677a4c5ca 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsextensions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsextensions_client_example_test.go @@ -24,11 +24,11 @@ func ExampleFarmBeatsExtensionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsExtensionsClient(cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(&armagrifood.FarmBeatsExtensionsClientListOptions{FarmBeatsExtensionIDs: []string{}, + pager := clientFactory.NewFarmBeatsExtensionsClient().NewListPager(&armagrifood.FarmBeatsExtensionsClientListOptions{FarmBeatsExtensionIDs: []string{}, FarmBeatsExtensionNames: []string{}, ExtensionCategories: []string{}, PublisherIDs: []string{}, @@ -273,11 +273,11 @@ func ExampleFarmBeatsExtensionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsExtensionsClient(cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "DTN.ContentServices", nil) + res, err := clientFactory.NewFarmBeatsExtensionsClient().Get(ctx, "DTN.ContentServices", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsmodels_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsmodels_client_example_test.go index 7338824b9..4c10c93a2 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsmodels_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/farmbeatsmodels_client_example_test.go @@ -25,11 +25,11 @@ func ExampleFarmBeatsModelsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "examples-rg", "examples-farmBeatsResourceName", nil) + res, err := clientFactory.NewFarmBeatsModelsClient().Get(ctx, "examples-rg", "examples-farmBeatsResourceName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -67,11 +67,11 @@ func ExampleFarmBeatsModelsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "examples-rg", "examples-farmbeatsResourceName", armagrifood.FarmBeats{ + res, err := clientFactory.NewFarmBeatsModelsClient().CreateOrUpdate(ctx, "examples-rg", "examples-farmbeatsResourceName", armagrifood.FarmBeats{ Location: to.Ptr("eastus2"), Tags: map[string]*string{ "key1": to.Ptr("value1"), @@ -115,11 +115,11 @@ func ExampleFarmBeatsModelsClient_BeginUpdate_farmBeatsModelsUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "examples-rg", "examples-farmBeatsResourceName", armagrifood.FarmBeatsUpdateRequestModel{ + poller, err := clientFactory.NewFarmBeatsModelsClient().BeginUpdate(ctx, "examples-rg", "examples-farmBeatsResourceName", armagrifood.FarmBeatsUpdateRequestModel{ Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), @@ -166,11 +166,11 @@ func ExampleFarmBeatsModelsClient_BeginUpdate_farmBeatsModelsUpdateWithSensor() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "examples-rg", "examples-farmBeatsResourceName", armagrifood.FarmBeatsUpdateRequestModel{ + poller, err := clientFactory.NewFarmBeatsModelsClient().BeginUpdate(ctx, "examples-rg", "examples-farmBeatsResourceName", armagrifood.FarmBeatsUpdateRequestModel{ Identity: &armagrifood.Identity{ Type: to.Ptr("SystemAssigned"), }, @@ -233,11 +233,11 @@ func ExampleFarmBeatsModelsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "examples-rg", "examples-farmBeatsResourceName", nil) + _, err = clientFactory.NewFarmBeatsModelsClient().Delete(ctx, "examples-rg", "examples-farmBeatsResourceName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -250,11 +250,11 @@ func ExampleFarmBeatsModelsClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(&armagrifood.FarmBeatsModelsClientListBySubscriptionOptions{MaxPageSize: nil, + pager := clientFactory.NewFarmBeatsModelsClient().NewListBySubscriptionPager(&armagrifood.FarmBeatsModelsClientListBySubscriptionOptions{MaxPageSize: nil, SkipToken: nil, }) for pager.More() { @@ -302,11 +302,11 @@ func ExampleFarmBeatsModelsClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("examples-rg", &armagrifood.FarmBeatsModelsClientListByResourceGroupOptions{MaxPageSize: nil, + pager := clientFactory.NewFarmBeatsModelsClient().NewListByResourceGroupPager("examples-rg", &armagrifood.FarmBeatsModelsClientListByResourceGroupOptions{MaxPageSize: nil, SkipToken: nil, }) for pager.More() { @@ -354,11 +354,11 @@ func ExampleFarmBeatsModelsClient_GetOperationResult() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetOperationResult(ctx, "examples-rg", "examples-farmBeatsResourceName", "resource-provisioning-id-farmBeatsResourceName", nil) + res, err := clientFactory.NewFarmBeatsModelsClient().GetOperationResult(ctx, "examples-rg", "examples-farmBeatsResourceName", "resource-provisioning-id-farmBeatsResourceName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/locations_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/locations_client_example_test.go index 86936d1f8..ea41a6e76 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/locations_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/locations_client_example_test.go @@ -25,11 +25,11 @@ func ExampleLocationsClient_CheckNameAvailability_locationsCheckNameAvailability log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewLocationsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ + res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ Name: to.Ptr("existingaccountname"), Type: to.Ptr("Microsoft.AgFoodPlatform/farmBeats"), }, nil) @@ -53,11 +53,11 @@ func ExampleLocationsClient_CheckNameAvailability_locationsCheckNameAvailability log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewLocationsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ + res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ Name: to.Ptr("newaccountname"), Type: to.Ptr("Microsoft.AgFoodPlatform/farmBeats"), }, nil) diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/operations_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/operations_client_example_test.go index b0553dfab..df3e40d6b 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/operations_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/operations_client_example_test.go @@ -24,11 +24,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewOperationsClient(cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privateendpointconnections_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privateendpointconnections_client_example_test.go index ce654b5c3..55932f596 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privateendpointconnections_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privateendpointconnections_client_example_test.go @@ -25,11 +25,11 @@ func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateEndpointConnectionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", armagrifood.PrivateEndpointConnection{ + res, err := clientFactory.NewPrivateEndpointConnectionsClient().CreateOrUpdate(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", armagrifood.PrivateEndpointConnection{ Properties: &armagrifood.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armagrifood.PrivateLinkServiceConnectionState{ Description: to.Ptr("Approved by johndoe@contoso.com"), @@ -68,11 +68,11 @@ func ExamplePrivateEndpointConnectionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateEndpointConnectionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -104,11 +104,11 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateEndpointConnectionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", nil) + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -125,11 +125,11 @@ func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateEndpointConnectionsClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourcePager("examples-rg", "examples-farmbeatsResourceName", nil) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByResourcePager("examples-rg", "examples-farmbeatsResourceName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privatelinkresources_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privatelinkresources_client_example_test.go index 72dbda6a7..3dbe6f58e 100644 --- a/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privatelinkresources_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/agrifood/armagrifood/privatelinkresources_client_example_test.go @@ -24,11 +24,11 @@ func ExamplePrivateLinkResourcesClient_NewListByResourcePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateLinkResourcesClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourcePager("examples-rg", "examples-farmbeatsResourceName", nil) + pager := clientFactory.NewPrivateLinkResourcesClient().NewListByResourcePager("examples-rg", "examples-farmbeatsResourceName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -64,11 +64,11 @@ func ExamplePrivateLinkResourcesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armagrifood.NewPrivateLinkResourcesClient("11111111-2222-3333-4444-555555555555", cred, nil) + clientFactory, err := armagrifood.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "farmbeats", nil) + res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "examples-rg", "examples-farmbeatsResourceName", "farmbeats", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester-pre.yaml b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester-pre.yaml index 123fbf8aa..cf01758a2 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester-pre.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester-pre.yaml @@ -39966,7 +39966,6 @@ language: name: AppPlatformManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester.yaml b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester.yaml index 54c372a3e..8d40f253b 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/__debug/go-tester.yaml @@ -20340,6 +20340,9 @@ security: - https://management.azure.com/.default testModel: mockTest: + clientFactoryParametersOutput: + - paramName: subscriptionID + paramOutput: '""' exampleGroups: - operationId: Services_Get examples: @@ -45227,7 +45230,6 @@ language: name: AppPlatformManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/apps_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/apps_client_example_test.go index 558ede44c..61ae69eff 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/apps_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/apps_client_example_test.go @@ -25,11 +25,11 @@ func ExampleAppsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", "myapp", &armappplatform.AppsClientGetOptions{SyncStatus: nil}) + res, err := clientFactory.NewAppsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", &armappplatform.AppsClientGetOptions{SyncStatus: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -74,11 +74,11 @@ func ExampleAppsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ + poller, err := clientFactory.NewAppsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ Location: to.Ptr("eastus"), Properties: &armappplatform.AppResourceProperties{ ActiveDeploymentName: to.Ptr("mydeployment1"), @@ -144,11 +144,11 @@ func ExampleAppsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", nil) + poller, err := clientFactory.NewAppsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -165,11 +165,11 @@ func ExampleAppsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ + poller, err := clientFactory.NewAppsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ Identity: &armappplatform.ManagedIdentityProperties{ Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), }, @@ -238,11 +238,11 @@ func ExampleAppsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myservice", nil) + pager := clientFactory.NewAppsClient().NewListPager("myResourceGroup", "myservice", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -295,11 +295,11 @@ func ExampleAppsClient_GetResourceUploadURL() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetResourceUploadURL(ctx, "myResourceGroup", "myservice", "myapp", nil) + res, err := clientFactory.NewAppsClient().GetResourceUploadURL(ctx, "myResourceGroup", "myservice", "myapp", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -319,11 +319,11 @@ func ExampleAppsClient_ValidateDomain() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ValidateDomain(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.CustomDomainValidatePayload{ + res, err := clientFactory.NewAppsClient().ValidateDomain(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.CustomDomainValidatePayload{ Name: to.Ptr("mydomain.io"), }, nil) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/bindings_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/bindings_client_example_test.go index 310a88f9c..59e2ad681 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/bindings_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/bindings_client_example_test.go @@ -25,11 +25,11 @@ func ExampleBindingsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) + res, err := clientFactory.NewBindingsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -62,11 +62,11 @@ func ExampleBindingsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ + poller, err := clientFactory.NewBindingsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ Properties: &armappplatform.BindingResourceProperties{ BindingParameters: map[string]any{ "apiType": "SQL", @@ -112,11 +112,11 @@ func ExampleBindingsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) + poller, err := clientFactory.NewBindingsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -133,11 +133,11 @@ func ExampleBindingsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ + poller, err := clientFactory.NewBindingsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ Properties: &armappplatform.BindingResourceProperties{ BindingParameters: map[string]any{ "apiType": "SQL", @@ -182,11 +182,11 @@ func ExampleBindingsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myservice", "myapp", nil) + pager := clientFactory.NewBindingsClient().NewListPager("myResourceGroup", "myservice", "myapp", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/certificates_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/certificates_client_example_test.go index 4976f8c43..b52d90d27 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/certificates_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/certificates_client_example_test.go @@ -25,11 +25,11 @@ func ExampleCertificatesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", "mycertificate", nil) + res, err := clientFactory.NewCertificatesClient().Get(ctx, "myResourceGroup", "myservice", "mycertificate", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -65,11 +65,11 @@ func ExampleCertificatesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "mycertificate", armappplatform.CertificateResource{ + poller, err := clientFactory.NewCertificatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "mycertificate", armappplatform.CertificateResource{ Properties: &armappplatform.CertificateProperties{ CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), KeyVaultCertName: to.Ptr("mycert"), @@ -115,11 +115,11 @@ func ExampleCertificatesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", "mycertificate", nil) + poller, err := clientFactory.NewCertificatesClient().BeginDelete(ctx, "myResourceGroup", "myservice", "mycertificate", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -136,11 +136,11 @@ func ExampleCertificatesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myService", nil) + pager := clientFactory.NewCertificatesClient().NewListPager("myResourceGroup", "myService", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/configservers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/configservers_client_example_test.go index 63d2b8f17..296c99fb6 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/configservers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/configservers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleConfigServersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", nil) + res, err := clientFactory.NewConfigServersClient().Get(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -61,11 +61,11 @@ func ExampleConfigServersClient_BeginUpdatePut() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ + poller, err := clientFactory.NewConfigServersClient().BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ Properties: &armappplatform.ConfigServerProperties{ ConfigServer: &armappplatform.ConfigServerSettings{ GitProperty: &armappplatform.ConfigServerGitProperty{ @@ -112,11 +112,11 @@ func ExampleConfigServersClient_BeginUpdatePatch() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ + poller, err := clientFactory.NewConfigServersClient().BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ Properties: &armappplatform.ConfigServerProperties{ ConfigServer: &armappplatform.ConfigServerSettings{ GitProperty: &armappplatform.ConfigServerGitProperty{ @@ -163,11 +163,11 @@ func ExampleConfigServersClient_BeginValidate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginValidate(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerSettings{ + poller, err := clientFactory.NewConfigServersClient().BeginValidate(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerSettings{ GitProperty: &armappplatform.ConfigServerGitProperty{ Label: to.Ptr("master"), SearchPaths: []*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/customdomains_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/customdomains_client_example_test.go index 2cdc70514..a9072521b 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/customdomains_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/customdomains_client_example_test.go @@ -25,11 +25,11 @@ func ExampleCustomDomainsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) + res, err := clientFactory.NewCustomDomainsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -55,11 +55,11 @@ func ExampleCustomDomainsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ + poller, err := clientFactory.NewCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ Properties: &armappplatform.CustomDomainProperties{ CertName: to.Ptr("mycert"), Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), @@ -94,11 +94,11 @@ func ExampleCustomDomainsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) + poller, err := clientFactory.NewCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -115,11 +115,11 @@ func ExampleCustomDomainsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ + poller, err := clientFactory.NewCustomDomainsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ Properties: &armappplatform.CustomDomainProperties{ CertName: to.Ptr("mycert"), Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), @@ -154,11 +154,11 @@ func ExampleCustomDomainsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myservice", "myapp", nil) + pager := clientFactory.NewCustomDomainsClient().NewListPager("myResourceGroup", "myservice", "myapp", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/deployments_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/deployments_client_example_test.go index 2b951ee29..9d18e6930 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/deployments_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/deployments_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDeploymentsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + res, err := clientFactory.NewDeploymentsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -83,11 +83,11 @@ func ExampleDeploymentsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ + poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ Properties: &armappplatform.DeploymentResourceProperties{ DeploymentSettings: &armappplatform.DeploymentSettings{ CPU: to.Ptr[int32](1), @@ -168,11 +168,11 @@ func ExampleDeploymentsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + poller, err := clientFactory.NewDeploymentsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -189,11 +189,11 @@ func ExampleDeploymentsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ + poller, err := clientFactory.NewDeploymentsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ Properties: &armappplatform.DeploymentResourceProperties{ Source: &armappplatform.UserSourceInfo{ Type: to.Ptr(armappplatform.UserSourceTypeSource), @@ -260,11 +260,11 @@ func ExampleDeploymentsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myservice", "myapp", &armappplatform.DeploymentsClientListOptions{Version: []string{}}) + pager := clientFactory.NewDeploymentsClient().NewListPager("myResourceGroup", "myservice", "myapp", &armappplatform.DeploymentsClientListOptions{Version: []string{}}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -326,11 +326,11 @@ func ExampleDeploymentsClient_NewListForClusterPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListForClusterPager("myResourceGroup", "myservice", &armappplatform.DeploymentsClientListForClusterOptions{Version: []string{}}) + pager := clientFactory.NewDeploymentsClient().NewListForClusterPager("myResourceGroup", "myservice", &armappplatform.DeploymentsClientListForClusterOptions{Version: []string{}}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -392,11 +392,11 @@ func ExampleDeploymentsClient_BeginStart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + poller, err := clientFactory.NewDeploymentsClient().BeginStart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -413,11 +413,11 @@ func ExampleDeploymentsClient_BeginStop() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStop(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + poller, err := clientFactory.NewDeploymentsClient().BeginStop(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -434,11 +434,11 @@ func ExampleDeploymentsClient_BeginRestart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + poller, err := clientFactory.NewDeploymentsClient().BeginRestart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -455,11 +455,11 @@ func ExampleDeploymentsClient_GetLogFileURL() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetLogFileURL(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) + res, err := clientFactory.NewDeploymentsClient().GetLogFileURL(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/monitoringsettings_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/monitoringsettings_client_example_test.go index 6ccc96e36..226f313b8 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/monitoringsettings_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/monitoringsettings_client_example_test.go @@ -25,11 +25,11 @@ func ExampleMonitoringSettingsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", nil) + res, err := clientFactory.NewMonitoringSettingsClient().Get(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -59,11 +59,11 @@ func ExampleMonitoringSettingsClient_BeginUpdatePut() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ + poller, err := clientFactory.NewMonitoringSettingsClient().BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ Properties: &armappplatform.MonitoringSettingProperties{ AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), AppInsightsSamplingRate: to.Ptr[float64](10), @@ -103,11 +103,11 @@ func ExampleMonitoringSettingsClient_BeginUpdatePatch() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ + poller, err := clientFactory.NewMonitoringSettingsClient().BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ Properties: &armappplatform.MonitoringSettingProperties{ AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), AppInsightsSamplingRate: to.Ptr[float64](10), diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/operations_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/operations_client_example_test.go index be2a7b43e..9776c8188 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/operations_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/operations_client_example_test.go @@ -24,11 +24,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewOperationsClient(cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/runtimeversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/runtimeversions_client_example_test.go index b5f93ecd3..dbe37d7c0 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/runtimeversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/runtimeversions_client_example_test.go @@ -24,11 +24,11 @@ func ExampleRuntimeVersionsClient_ListRuntimeVersions() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewRuntimeVersionsClient(cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListRuntimeVersions(ctx, nil) + res, err := clientFactory.NewRuntimeVersionsClient().ListRuntimeVersions(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/services_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/services_client_example_test.go index fcad7e158..c6b35bef9 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/services_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/services_client_example_test.go @@ -25,11 +25,11 @@ func ExampleServicesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myservice", nil) + res, err := clientFactory.NewServicesClient().Get(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -94,11 +94,11 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ + poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ Location: to.Ptr("eastus"), Tags: map[string]*string{ "key1": to.Ptr("value1"), @@ -177,11 +177,11 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateVNetInjecti log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ + poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ Location: to.Ptr("eastus"), Tags: map[string]*string{ "key1": to.Ptr("value1"), @@ -272,11 +272,11 @@ func ExampleServicesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myservice", nil) + poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -293,11 +293,11 @@ func ExampleServicesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ + poller, err := clientFactory.NewServicesClient().BeginUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ Location: to.Ptr("eastus"), Tags: map[string]*string{ "key1": to.Ptr("value1"), @@ -376,11 +376,11 @@ func ExampleServicesClient_ListTestKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListTestKeys(ctx, "myResourceGroup", "myservice", nil) + res, err := clientFactory.NewServicesClient().ListTestKeys(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -403,11 +403,11 @@ func ExampleServicesClient_RegenerateTestKey() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.RegenerateTestKey(ctx, "myResourceGroup", "myservice", armappplatform.RegenerateTestKeyRequestPayload{ + res, err := clientFactory.NewServicesClient().RegenerateTestKey(ctx, "myResourceGroup", "myservice", armappplatform.RegenerateTestKeyRequestPayload{ KeyType: to.Ptr(armappplatform.TestKeyTypePrimary), }, nil) if err != nil { @@ -432,11 +432,11 @@ func ExampleServicesClient_DisableTestEndpoint() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.DisableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) + _, err = clientFactory.NewServicesClient().DisableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -449,11 +449,11 @@ func ExampleServicesClient_EnableTestEndpoint() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.EnableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) + res, err := clientFactory.NewServicesClient().EnableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -476,11 +476,11 @@ func ExampleServicesClient_CheckNameAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckNameAvailability(ctx, "eastus", armappplatform.NameAvailabilityParameters{ + res, err := clientFactory.NewServicesClient().CheckNameAvailability(ctx, "eastus", armappplatform.NameAvailabilityParameters{ Name: to.Ptr("myservice"), Type: to.Ptr("Microsoft.AppPlatform/Spring"), }, nil) @@ -504,11 +504,11 @@ func ExampleServicesClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(nil) + pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -581,11 +581,11 @@ func ExampleServicesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", nil) + pager := clientFactory.NewServicesClient().NewListPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/skus_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/skus_client_example_test.go index 6c4469430..649f57e8f 100644 --- a/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/skus_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/appplatform/armappplatform/skus_client_example_test.go @@ -24,11 +24,11 @@ func ExampleSKUsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewSKUsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armappplatform.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewSKUsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester-pre.yaml b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester-pre.yaml index f08fb9c84..a7c3999d5 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester-pre.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester-pre.yaml @@ -187353,7 +187353,6 @@ language: name: ComputeManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester.yaml b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester.yaml index 206e9cf61..55844ca12 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/__debug/go-tester.yaml @@ -110627,6 +110627,9 @@ security: - https://management.azure.com/.default testModel: mockTest: + clientFactoryParametersOutput: + - paramName: subscriptionID + paramOutput: '""' exampleGroups: - operationId: Operations_List examples: [] @@ -208836,7 +208839,6 @@ language: name: ComputeManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/availabilitysets_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/availabilitysets_client_example_test.go index 7b01a82cf..856e294c2 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/availabilitysets_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/availabilitysets_client_example_test.go @@ -25,11 +25,11 @@ func ExampleAvailabilitySetsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("1", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myAvailabilitySet", armcompute.AvailabilitySet{ + res, err := clientFactory.NewAvailabilitySetsClient().CreateOrUpdate(ctx, "myResourceGroup", "myAvailabilitySet", armcompute.AvailabilitySet{ Location: to.Ptr("westus"), AdditionalProperties: map[string]*string{ "anyProperty": to.Ptr("fakeValue"), @@ -67,11 +67,11 @@ func ExampleAvailabilitySetsClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("Faked for test: +ge+2020, %3E2012")}) + pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("Faked for test: +ge+2020, %3E2012")}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go index a6d209d07..5457d0814 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go @@ -24,11 +24,11 @@ func ExampleCloudServiceOperatingSystemsClient_GetOSVersion() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetOSVersion(ctx, "westus2", "WA-GUEST-OS-3.90_202010-02", nil) + res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSVersion(ctx, "westus2", "WA-GUEST-OS-3.90_202010-02", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -58,11 +58,11 @@ func ExampleCloudServiceOperatingSystemsClient_NewListOSVersionsPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListOSVersionsPager("westus2", nil) + pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSVersionsPager("westus2", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -114,11 +114,11 @@ func ExampleCloudServiceOperatingSystemsClient_GetOSFamily() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetOSFamily(ctx, "westus2", "3", nil) + res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSFamily(ctx, "westus2", "3", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -151,11 +151,11 @@ func ExampleCloudServiceOperatingSystemsClient_NewListOSFamiliesPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListOSFamiliesPager("westus2", nil) + pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSFamiliesPager("westus2", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroleinstances_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroleinstances_client_example_test.go index ede581d67..a3527be0f 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroleinstances_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroleinstances_client_example_test.go @@ -24,11 +24,11 @@ func ExampleCloudServiceRoleInstancesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginDelete(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -45,11 +45,11 @@ func ExampleCloudServiceRoleInstancesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewCloudServiceRoleInstancesClient().Get(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -83,11 +83,11 @@ func ExampleCloudServiceRoleInstancesClient_GetInstanceView() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetInstanceView(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) + res, err := clientFactory.NewCloudServiceRoleInstancesClient().GetInstanceView(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -115,11 +115,11 @@ func ExampleCloudServiceRoleInstancesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientListOptions{Expand: nil}) + pager := clientFactory.NewCloudServiceRoleInstancesClient().NewListPager("ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -215,11 +215,11 @@ func ExampleCloudServiceRoleInstancesClient_BeginRestart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestart(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginRestart(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -236,11 +236,11 @@ func ExampleCloudServiceRoleInstancesClient_BeginReimage() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReimage(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginReimage(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -257,11 +257,11 @@ func ExampleCloudServiceRoleInstancesClient_BeginRebuild() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRebuild(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginRebuild(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroles_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroles_client_example_test.go index 85bc46209..72eb18819 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroles_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudserviceroles_client_example_test.go @@ -24,11 +24,11 @@ func ExampleCloudServiceRolesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRolesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "{role-name}", "ConstosoRG", "{cs-name}", nil) + res, err := clientFactory.NewCloudServiceRolesClient().Get(ctx, "{role-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -58,11 +58,11 @@ func ExampleCloudServiceRolesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServiceRolesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("ConstosoRG", "{cs-name}", nil) + pager := clientFactory.NewCloudServiceRolesClient().NewListPager("ConstosoRG", "{cs-name}", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservices_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservices_client_example_test.go index b0729546c..e5e912c71 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservices_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservices_client_example_test.go @@ -25,11 +25,11 @@ func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithMul log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ + poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), @@ -145,11 +145,11 @@ func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSin log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ + poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), @@ -249,11 +249,11 @@ func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSin log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ + poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), @@ -373,11 +373,11 @@ func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSin log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ + poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), @@ -507,11 +507,11 @@ func ExampleCloudServicesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudServiceUpdate{ + poller, err := clientFactory.NewCloudServicesClient().BeginUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudServiceUpdate{ Tags: map[string]*string{ "Documentation": to.Ptr("RestAPI"), }, @@ -590,11 +590,11 @@ func ExampleCloudServicesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServicesClient().BeginDelete(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -611,11 +611,11 @@ func ExampleCloudServicesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "ConstosoRG", "{cs-name}", nil) + res, err := clientFactory.NewCloudServicesClient().Get(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -699,11 +699,11 @@ func ExampleCloudServicesClient_GetInstanceView() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetInstanceView(ctx, "ConstosoRG", "{cs-name}", nil) + res, err := clientFactory.NewCloudServicesClient().GetInstanceView(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -762,11 +762,11 @@ func ExampleCloudServicesClient_NewListAllPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAllPager(nil) + pager := clientFactory.NewCloudServicesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -858,11 +858,11 @@ func ExampleCloudServicesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("ConstosoRG", nil) + pager := clientFactory.NewCloudServicesClient().NewListPager("ConstosoRG", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -954,11 +954,11 @@ func ExampleCloudServicesClient_BeginStart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStart(ctx, "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServicesClient().BeginStart(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -975,11 +975,11 @@ func ExampleCloudServicesClient_BeginPowerOff() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginPowerOff(ctx, "ConstosoRG", "{cs-name}", nil) + poller, err := clientFactory.NewCloudServicesClient().BeginPowerOff(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -996,11 +996,11 @@ func ExampleCloudServicesClient_BeginRestart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestart(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRestartOptions{Parameters: &armcompute.RoleInstances{ + poller, err := clientFactory.NewCloudServicesClient().BeginRestart(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRestartOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, @@ -1022,11 +1022,11 @@ func ExampleCloudServicesClient_BeginReimage() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReimage(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginReimageOptions{Parameters: &armcompute.RoleInstances{ + poller, err := clientFactory.NewCloudServicesClient().BeginReimage(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginReimageOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, @@ -1048,11 +1048,11 @@ func ExampleCloudServicesClient_BeginRebuild() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRebuild(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRebuildOptions{Parameters: &armcompute.RoleInstances{ + poller, err := clientFactory.NewCloudServicesClient().BeginRebuild(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRebuildOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, @@ -1074,11 +1074,11 @@ func ExampleCloudServicesClient_BeginDeleteInstances() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDeleteInstances(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginDeleteInstancesOptions{Parameters: &armcompute.RoleInstances{ + poller, err := clientFactory.NewCloudServicesClient().BeginDeleteInstances(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginDeleteInstancesOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservicesupdatedomain_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservicesupdatedomain_client_example_test.go index cb00bcb41..feef1d0fa 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservicesupdatedomain_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/cloudservicesupdatedomain_client_example_test.go @@ -24,11 +24,11 @@ func ExampleCloudServicesUpdateDomainClient_BeginWalkUpdateDomain() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginWalkUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, armcompute.UpdateDomain{}, nil) + poller, err := clientFactory.NewCloudServicesUpdateDomainClient().BeginWalkUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, armcompute.UpdateDomain{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -45,11 +45,11 @@ func ExampleCloudServicesUpdateDomainClient_GetUpdateDomain() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, nil) + res, err := clientFactory.NewCloudServicesUpdateDomainClient().GetUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -69,11 +69,11 @@ func ExampleCloudServicesUpdateDomainClient_NewListUpdateDomainsPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListUpdateDomainsPager("ConstosoRG", "{cs-name}", nil) + pager := clientFactory.NewCloudServicesUpdateDomainClient().NewListUpdateDomainsPager("ConstosoRG", "{cs-name}", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhostgroups_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhostgroups_client_example_test.go index 977e39fd2..62cd30807 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhostgroups_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhostgroups_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDedicatedHostGroupsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", armcompute.DedicatedHostGroup{ + res, err := clientFactory.NewDedicatedHostGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", armcompute.DedicatedHostGroup{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("finance"), @@ -71,11 +71,11 @@ func ExampleDedicatedHostGroupsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewDedicatedHostGroupsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhosts_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhosts_client_example_test.go index 8fe8b7c28..f7b5f1fe0 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhosts_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/dedicatedhosts_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDedicatedHostsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", "myDedicatedHost", armcompute.DedicatedHost{ + poller, err := clientFactory.NewDedicatedHostsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", "myDedicatedHost", armcompute.DedicatedHost{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("HR"), @@ -77,11 +77,11 @@ func ExampleDedicatedHostsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", &armcompute.DedicatedHostsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewDedicatedHostsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", &armcompute.DedicatedHostsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskaccesses_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskaccesses_client_example_test.go index 0f6d3d963..b2d2732b7 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskaccesses_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskaccesses_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDiskAccessesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccess{ + poller, err := clientFactory.NewDiskAccessesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccess{ Location: to.Ptr("West US"), }, nil) if err != nil { @@ -61,11 +61,11 @@ func ExampleDiskAccessesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccessUpdate{ + poller, err := clientFactory.NewDiskAccessesClient().BeginUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccessUpdate{ Tags: map[string]*string{ "department": to.Ptr("Development"), "project": to.Ptr("PrivateEndpoints"), @@ -100,11 +100,11 @@ func ExampleDiskAccessesClient_Get_getInformationAboutADiskAccessResourceWithPri log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myDiskAccess", nil) + res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -151,11 +151,11 @@ func ExampleDiskAccessesClient_Get_getInformationAboutADiskAccessResource() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myDiskAccess", nil) + res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -185,11 +185,11 @@ func ExampleDiskAccessesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myDiskAccess", nil) + poller, err := clientFactory.NewDiskAccessesClient().BeginDelete(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -206,11 +206,11 @@ func ExampleDiskAccessesClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewDiskAccessesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -279,11 +279,11 @@ func ExampleDiskAccessesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewDiskAccessesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -352,11 +352,11 @@ func ExampleDiskAccessesClient_GetPrivateLinkResources() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetPrivateLinkResources(ctx, "myResourceGroup", "myDiskAccess", nil) + res, err := clientFactory.NewDiskAccessesClient().GetPrivateLinkResources(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -387,11 +387,11 @@ func ExampleDiskAccessesClient_BeginUpdateAPrivateEndpointConnection() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdateAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", armcompute.PrivateEndpointConnection{ + poller, err := clientFactory.NewDiskAccessesClient().BeginUpdateAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", armcompute.PrivateEndpointConnection{ Properties: &armcompute.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ Description: to.Ptr("Approving myPrivateEndpointConnection"), @@ -434,11 +434,11 @@ func ExampleDiskAccessesClient_GetAPrivateEndpointConnection() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) + res, err := clientFactory.NewDiskAccessesClient().GetAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -470,11 +470,11 @@ func ExampleDiskAccessesClient_BeginDeleteAPrivateEndpointConnection() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDeleteAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) + poller, err := clientFactory.NewDiskAccessesClient().BeginDeleteAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -491,11 +491,11 @@ func ExampleDiskAccessesClient_NewListPrivateEndpointConnectionsPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPrivateEndpointConnectionsPager("myResourceGroup", "myDiskAccess", nil) + pager := clientFactory.NewDiskAccessesClient().NewListPrivateEndpointConnectionsPager("myResourceGroup", "myDiskAccess", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskencryptionsets_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskencryptionsets_client_example_test.go index b66e787ba..285c7f3f6 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskencryptionsets_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskencryptionsets_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate_createADiskEncryptionSe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ Location: to.Ptr("West US"), Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), @@ -75,11 +75,11 @@ func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate_createADiskEncryptionSe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ Location: to.Ptr("West US"), Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), @@ -131,11 +131,11 @@ func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSetWithRot log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, @@ -184,11 +184,11 @@ func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSetWithRot log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, @@ -241,11 +241,11 @@ func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSet() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Properties: &armcompute.DiskEncryptionSetUpdateProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"), @@ -302,11 +302,11 @@ func ExampleDiskEncryptionSetsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) + res, err := clientFactory.NewDiskEncryptionSetsClient().Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -347,11 +347,11 @@ func ExampleDiskEncryptionSetsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) + poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginDelete(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -368,11 +368,11 @@ func ExampleDiskEncryptionSetsClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewDiskEncryptionSetsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -446,11 +446,11 @@ func ExampleDiskEncryptionSetsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewDiskEncryptionSetsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -524,11 +524,11 @@ func ExampleDiskEncryptionSetsClient_NewListAssociatedResourcesPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAssociatedResourcesPager("myResourceGroup", "myDiskEncryptionSet", nil) + pager := clientFactory.NewDiskEncryptionSetsClient().NewListAssociatedResourcesPager("myResourceGroup", "myDiskEncryptionSet", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskrestorepoint_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskrestorepoint_client_example_test.go index ce2ec7d56..11c4a84b3 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskrestorepoint_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/diskrestorepoint_client_example_test.go @@ -24,11 +24,11 @@ func ExampleDiskRestorePointClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) + res, err := clientFactory.NewDiskRestorePointClient().Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -56,11 +56,11 @@ func ExampleDiskRestorePointClient_NewListByRestorePointPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByRestorePointPager("myResourceGroup", "rpc", "vmrp", nil) + pager := clientFactory.NewDiskRestorePointClient().NewListByRestorePointPager("myResourceGroup", "rpc", "vmrp", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/disks_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/disks_client_example_test.go index f8b5aa7e8..aa0b509aa 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/disks_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/disks_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskAndAssociateWithDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -72,11 +72,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskAndAssociateWithDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -121,11 +121,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByCopyingASnapshot log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -164,11 +164,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByImportingAnUnman log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -209,11 +209,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByImportingAnUnman log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -252,11 +252,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAPlatformImage log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -307,11 +307,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAnExistingMana log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk2", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk2", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -350,11 +350,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithSecurityProfil log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("North Central US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -405,11 +405,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithSsdZrsAccountT log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -455,11 +455,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAManagedUploadDisk() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -498,11 +498,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAnEmptyManagedDiskInExtendedLo log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), ExtendedLocation: &armcompute.ExtendedLocation{ Name: to.Ptr("{edge-zone-id}"), @@ -549,11 +549,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAnEmptyManagedDisk() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -592,11 +592,11 @@ func ExampleDisksClient_BeginCreateOrUpdate_createAnUltraManagedDiskWithLogicalS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ + poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ @@ -644,11 +644,11 @@ func ExampleDisksClient_BeginUpdate_createOrUpdateABurstingEnabledManagedDisk() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ BurstingEnabled: to.Ptr(true), DiskSizeGB: to.Ptr[int32](1024), @@ -685,11 +685,11 @@ func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddPurchasePlan() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ PurchasePlan: &armcompute.DiskPurchasePlan{ Name: to.Ptr("myPurchasePlanName"), @@ -744,11 +744,11 @@ func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddSupportsHibernation() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ SupportsHibernation: to.Ptr(true), }, @@ -791,11 +791,11 @@ func ExampleDisksClient_BeginUpdate_updateAManagedDiskToChangeTier() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ Tier: to.Ptr("P30"), }, @@ -830,11 +830,11 @@ func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableBursting() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ BurstingEnabled: to.Ptr(false), }, @@ -868,11 +868,11 @@ func ExampleDisksClient_BeginUpdate_updateManagedDiskToRemoveDiskAccessResourceA log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ + poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), }, @@ -908,11 +908,11 @@ func ExampleDisksClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myManagedDisk", nil) + res, err := clientFactory.NewDisksClient().Get(ctx, "myResourceGroup", "myManagedDisk", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -985,11 +985,11 @@ func ExampleDisksClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewDisksClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1115,11 +1115,11 @@ func ExampleDisksClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewDisksClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleries_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleries_client_example_test.go index 323233142..488442ec0 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleries_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleries_client_example_test.go @@ -25,11 +25,11 @@ func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryWith log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ + poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), @@ -71,11 +71,11 @@ func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGallery() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ + poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), @@ -111,11 +111,11 @@ func ExampleGalleriesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.GalleryUpdate{ + poller, err := clientFactory.NewGalleriesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.GalleryUpdate{ Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), }, @@ -150,11 +150,11 @@ func ExampleGalleriesClient_Get_getAGalleryWithSelectPermissions() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: to.Ptr(armcompute.SelectPermissionsPermissions)}) + res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: to.Ptr(armcompute.SelectPermissionsPermissions)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -191,11 +191,11 @@ func ExampleGalleriesClient_Get_getAGallery() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil}) + res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -222,11 +222,11 @@ func ExampleGalleriesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myGalleryName", nil) + poller, err := clientFactory.NewGalleriesClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -243,11 +243,11 @@ func ExampleGalleriesClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewGalleriesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -283,11 +283,11 @@ func ExampleGalleriesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewGalleriesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplications_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplications_client_example_test.go index ce581b3e7..c18aa2dcf 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplications_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplications_client_example_test.go @@ -25,11 +25,11 @@ func ExampleGalleryApplicationsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplication{ + poller, err := clientFactory.NewGalleryApplicationsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplication{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryApplicationProperties{ Description: to.Ptr("This is the gallery application description."), @@ -71,11 +71,11 @@ func ExampleGalleryApplicationsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplicationUpdate{ + poller, err := clientFactory.NewGalleryApplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplicationUpdate{ Properties: &armcompute.GalleryApplicationProperties{ Description: to.Ptr("This is the gallery application description."), Eula: to.Ptr("This is the gallery application EULA."), @@ -116,11 +116,11 @@ func ExampleGalleryApplicationsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) + res, err := clientFactory.NewGalleryApplicationsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -147,11 +147,11 @@ func ExampleGalleryApplicationsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) + poller, err := clientFactory.NewGalleryApplicationsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -168,11 +168,11 @@ func ExampleGalleryApplicationsClient_NewListByGalleryPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) + pager := clientFactory.NewGalleryApplicationsClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplicationversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplicationversions_client_example_test.go index 2e2272005..17f1ae645 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplicationversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryapplicationversions_client_example_test.go @@ -27,11 +27,11 @@ func ExampleGalleryApplicationVersionsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersion{ + poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryApplicationVersionProperties{ PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ @@ -103,11 +103,11 @@ func ExampleGalleryApplicationVersionsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersionUpdate{ + poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersionUpdate{ Properties: &armcompute.GalleryApplicationVersionProperties{ PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00Z"); return t }()), @@ -178,11 +178,11 @@ func ExampleGalleryApplicationVersionsClient_Get_getAGalleryApplicationVersionWi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) + res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -236,11 +236,11 @@ func ExampleGalleryApplicationVersionsClient_Get_getAGalleryApplicationVersion() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -286,11 +286,11 @@ func ExampleGalleryApplicationVersionsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", nil) + poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -307,11 +307,11 @@ func ExampleGalleryApplicationVersionsClient_NewListByGalleryApplicationPager() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByGalleryApplicationPager("myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) + pager := clientFactory.NewGalleryApplicationVersionsClient().NewListByGalleryApplicationPager("myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimages_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimages_client_example_test.go index 03be60e51..88d3cffdb 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimages_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimages_client_example_test.go @@ -25,11 +25,11 @@ func ExampleGalleryImagesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImage{ + poller, err := clientFactory.NewGalleryImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImage{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageProperties{ HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), @@ -76,11 +76,11 @@ func ExampleGalleryImagesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImageUpdate{ + poller, err := clientFactory.NewGalleryImagesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImageUpdate{ Properties: &armcompute.GalleryImageProperties{ HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), Identifier: &armcompute.GalleryImageIdentifier{ @@ -126,11 +126,11 @@ func ExampleGalleryImagesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) + res, err := clientFactory.NewGalleryImagesClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -161,11 +161,11 @@ func ExampleGalleryImagesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) + poller, err := clientFactory.NewGalleryImagesClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -182,11 +182,11 @@ func ExampleGalleryImagesClient_NewListByGalleryPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) + pager := clientFactory.NewGalleryImagesClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimageversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimageversions_client_example_test.go index 7012d5aa3..3e68fcb24 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimageversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/galleryimageversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimple log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ @@ -164,11 +164,11 @@ func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimple log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ @@ -303,11 +303,11 @@ func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimple log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ @@ -440,11 +440,11 @@ func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimple log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ @@ -579,11 +579,11 @@ func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimple log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ @@ -698,11 +698,11 @@ func ExampleGalleryImageVersionsClient_BeginUpdate_updateASimpleGalleryImageVers log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ @@ -790,11 +790,11 @@ func ExampleGalleryImageVersionsClient_BeginUpdate_updateASimpleGalleryImageVers log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ @@ -878,11 +878,11 @@ func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithReplicatio log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) + res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -966,11 +966,11 @@ func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithSnapshotsA log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1035,11 +1035,11 @@ func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithVhdAsASour log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1106,11 +1106,11 @@ func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersion() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1178,11 +1178,11 @@ func ExampleGalleryImageVersionsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", nil) + poller, err := clientFactory.NewGalleryImageVersionsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1199,11 +1199,11 @@ func ExampleGalleryImageVersionsClient_NewListByGalleryImagePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByGalleryImagePager("myResourceGroup", "myGalleryName", "myGalleryImageName", nil) + pager := clientFactory.NewGalleryImageVersionsClient().NewListByGalleryImagePager("myResourceGroup", "myGalleryName", "myGalleryImageName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/gallerysharingprofile_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/gallerysharingprofile_client_example_test.go index d349a638f..26514c56d 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/gallerysharingprofile_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/gallerysharingprofile_client_example_test.go @@ -25,11 +25,11 @@ func ExampleGallerySharingProfileClient_BeginUpdate_addSharingIdToTheSharingProf log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGallerySharingProfileClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ + poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ Groups: []*armcompute.SharingProfileGroup{ { Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), @@ -78,11 +78,11 @@ func ExampleGallerySharingProfileClient_BeginUpdate_resetSharingProfileOfAGaller log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewGallerySharingProfileClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ + poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesReset), }, nil) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/images_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/images_client_example_test.go index 572dba884..94b51808f 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/images_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/images_client_example_test.go @@ -25,11 +25,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromABlob log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -85,11 +85,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromABlob log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -141,11 +141,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAMana log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -205,11 +205,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAMana log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -265,11 +265,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromASnap log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -329,11 +329,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromASnap log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -389,11 +389,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAnExi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ SourceVirtualMachine: &armcompute.SubResource{ @@ -445,11 +445,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatInclu log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -509,11 +509,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatInclu log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -581,11 +581,11 @@ func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatInclu log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ + poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ @@ -653,11 +653,11 @@ func ExampleImagesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myImage", armcompute.ImageUpdate{ + poller, err := clientFactory.NewImagesClient().BeginUpdate(ctx, "myResourceGroup", "myImage", armcompute.ImageUpdate{ Tags: map[string]*string{ "department": to.Ptr("HR"), }, @@ -727,11 +727,11 @@ func ExampleImagesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myImage", &armcompute.ImagesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewImagesClient().Get(ctx, "myResourceGroup", "myImage", &armcompute.ImagesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -784,11 +784,11 @@ func ExampleImagesClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewImagesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -847,11 +847,11 @@ func ExampleImagesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewImagesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/loganalytics_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/loganalytics_client_example_test.go index 3ce82d642..874803221 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/loganalytics_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/loganalytics_client_example_test.go @@ -27,11 +27,11 @@ func ExampleLogAnalyticsClient_BeginExportRequestRateByInterval() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewLogAnalyticsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginExportRequestRateByInterval(ctx, "westus", armcompute.RequestRateByIntervalInput{ + poller, err := clientFactory.NewLogAnalyticsClient().BeginExportRequestRateByInterval(ctx, "westus", armcompute.RequestRateByIntervalInput{ BlobContainerSasURI: to.Ptr("https://somesasuri"), FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862601Z"); return t }()), GroupByResourceName: to.Ptr(true), @@ -62,11 +62,11 @@ func ExampleLogAnalyticsClient_BeginExportThrottledRequests() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewLogAnalyticsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginExportThrottledRequests(ctx, "westus", armcompute.ThrottledRequestsInput{ + poller, err := clientFactory.NewLogAnalyticsClient().BeginExportThrottledRequests(ctx, "westus", armcompute.ThrottledRequestsInput{ BlobContainerSasURI: to.Ptr("https://somesasuri"), FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862601Z"); return t }()), GroupByClientApplicationID: to.Ptr(false), diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/proximityplacementgroups_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/proximityplacementgroups_client_example_test.go index 2ba9416b3..e7c046f65 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/proximityplacementgroups_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/proximityplacementgroups_client_example_test.go @@ -25,11 +25,11 @@ func ExampleProximityPlacementGroupsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "$(resourceName)", armcompute.ProximityPlacementGroup{ + res, err := clientFactory.NewProximityPlacementGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "$(resourceName)", armcompute.ProximityPlacementGroup{ Location: to.Ptr("westus"), Properties: &armcompute.ProximityPlacementGroupProperties{ ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), @@ -59,11 +59,11 @@ func ExampleProximityPlacementGroupsClient_Update() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Update(ctx, "myResourceGroup", "myProximityPlacementGroup", armcompute.ProximityPlacementGroupUpdate{ + res, err := clientFactory.NewProximityPlacementGroupsClient().Update(ctx, "myResourceGroup", "myProximityPlacementGroup", armcompute.ProximityPlacementGroupUpdate{ Tags: map[string]*string{ "additionalProp1": to.Ptr("string"), }, @@ -92,11 +92,11 @@ func ExampleProximityPlacementGroupsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "myResourceGroup", "$(resourceName)", nil) + _, err = clientFactory.NewProximityPlacementGroupsClient().Delete(ctx, "myResourceGroup", "$(resourceName)", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -109,11 +109,11 @@ func ExampleProximityPlacementGroupsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myProximityPlacementGroup", &armcompute.ProximityPlacementGroupsClientGetOptions{IncludeColocationStatus: nil}) + res, err := clientFactory.NewProximityPlacementGroupsClient().Get(ctx, "myResourceGroup", "myProximityPlacementGroup", &armcompute.ProximityPlacementGroupsClientGetOptions{IncludeColocationStatus: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -150,11 +150,11 @@ func ExampleProximityPlacementGroupsClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(nil) + pager := clientFactory.NewProximityPlacementGroupsClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -199,11 +199,11 @@ func ExampleProximityPlacementGroupsClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewProximityPlacementGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/resourceskus_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/resourceskus_client_example_test.go index 91d3a4314..f82f804c7 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/resourceskus_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/resourceskus_client_example_test.go @@ -25,11 +25,11 @@ func ExampleResourceSKUsClient_NewListPager_listsAllAvailableResourceSkUs() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewResourceSKUsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil}) + pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -218,11 +218,11 @@ func ExampleResourceSKUsClient_NewListPager_listsAllAvailableResourceSkUsForTheS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewResourceSKUsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: to.Ptr("location eq 'westus'")}) + pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: to.Ptr("location eq 'westus'")}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepointcollections_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepointcollections_client_example_test.go index 1c55459f2..b90307690 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepointcollections_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepointcollections_client_example_test.go @@ -25,11 +25,11 @@ func ExampleRestorePointCollectionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myRpc", armcompute.RestorePointCollection{ + res, err := clientFactory.NewRestorePointCollectionsClient().CreateOrUpdate(ctx, "myResourceGroup", "myRpc", armcompute.RestorePointCollection{ Location: to.Ptr("norwayeast"), Tags: map[string]*string{ "myTag1": to.Ptr("tagValue1"), @@ -72,11 +72,11 @@ func ExampleRestorePointCollectionsClient_Get_getARestorePointCollectionButNotTh log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myRpc", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "myRpc", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -109,11 +109,11 @@ func ExampleRestorePointCollectionsClient_Get_getARestorePointCollectionIncludin log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "rpcName", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "rpcName", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -213,11 +213,11 @@ func ExampleRestorePointCollectionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", nil) + pager := clientFactory.NewRestorePointCollectionsClient().NewListPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -275,11 +275,11 @@ func ExampleRestorePointCollectionsClient_NewListAllPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAllPager(nil) + pager := clientFactory.NewRestorePointCollectionsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepoints_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepoints_client_example_test.go index b33d333b0..dc02eb3bd 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepoints_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/restorepoints_client_example_test.go @@ -25,11 +25,11 @@ func ExampleRestorePointsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "rpcName", "rpName", armcompute.RestorePoint{ + poller, err := clientFactory.NewRestorePointsClient().BeginCreate(ctx, "myResourceGroup", "rpcName", "rpName", armcompute.RestorePoint{ ExcludeDisks: []*armcompute.APIEntityReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), @@ -51,11 +51,11 @@ func ExampleRestorePointsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewRestorePointsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "rpcName", "rpName", nil) + res, err := clientFactory.NewRestorePointsClient().Get(ctx, "myResourceGroup", "rpcName", "rpName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleries_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleries_client_example_test.go index f93ffca9d..85ebe961e 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleries_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleries_client_example_test.go @@ -24,11 +24,11 @@ func ExampleSharedGalleriesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myLocation", &armcompute.SharedGalleriesClientListOptions{SharedTo: nil}) + pager := clientFactory.NewSharedGalleriesClient().NewListPager("myLocation", &armcompute.SharedGalleriesClientListOptions{SharedTo: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -59,11 +59,11 @@ func ExampleSharedGalleriesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleriesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myLocation", "galleryUniqueName", nil) + res, err := clientFactory.NewSharedGalleriesClient().Get(ctx, "myLocation", "galleryUniqueName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimages_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimages_client_example_test.go index 878669587..d9a830b1e 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimages_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimages_client_example_test.go @@ -24,11 +24,11 @@ func ExampleSharedGalleryImagesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myLocation", "galleryUniqueName", &armcompute.SharedGalleryImagesClientListOptions{SharedTo: nil}) + pager := clientFactory.NewSharedGalleryImagesClient().NewListPager("myLocation", "galleryUniqueName", &armcompute.SharedGalleryImagesClientListOptions{SharedTo: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -69,11 +69,11 @@ func ExampleSharedGalleryImagesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleryImagesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", nil) + res, err := clientFactory.NewSharedGalleryImagesClient().Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimageversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimageversions_client_example_test.go index 6c1a18a50..06ffe3dfd 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimageversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sharedgalleryimageversions_client_example_test.go @@ -24,11 +24,11 @@ func ExampleSharedGalleryImageVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myLocation", "galleryUniqueName", "myGalleryImageName", &armcompute.SharedGalleryImageVersionsClientListOptions{SharedTo: nil}) + pager := clientFactory.NewSharedGalleryImageVersionsClient().NewListPager("myLocation", "galleryUniqueName", "myGalleryImageName", &armcompute.SharedGalleryImageVersionsClientListOptions{SharedTo: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -63,11 +63,11 @@ func ExampleSharedGalleryImageVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSharedGalleryImageVersionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", "myGalleryImageVersionName", nil) + res, err := clientFactory.NewSharedGalleryImageVersionsClient().Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", "myGalleryImageVersionName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/snapshots_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/snapshots_client_example_test.go index cad9fc487..af99c3368 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/snapshots_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/snapshots_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotByImportingAnUnma log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ + poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ @@ -70,11 +70,11 @@ func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotByImportingAnUnma log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ + poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ @@ -113,11 +113,11 @@ func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotFromAnExistingSna log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ + poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ @@ -156,11 +156,11 @@ func ExampleSnapshotsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "mySnapshot", nil) + res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myResourceGroup", "mySnapshot", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -225,11 +225,11 @@ func ExampleSnapshotsClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewSnapshotsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -294,11 +294,11 @@ func ExampleSnapshotsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewSnapshotsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sshpublickeys_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sshpublickeys_client_example_test.go index 9aa47cf73..fcc9877cb 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sshpublickeys_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/sshpublickeys_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSSHPublicKeysClient_Create() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Create(ctx, "myResourceGroup", "mySshPublicKeyName", armcompute.SSHPublicKeyResource{ + res, err := clientFactory.NewSSHPublicKeysClient().Create(ctx, "myResourceGroup", "mySshPublicKeyName", armcompute.SSHPublicKeyResource{ Location: to.Ptr("westus"), Properties: &armcompute.SSHPublicKeyResourceProperties{ PublicKey: to.Ptr("{ssh-rsa public key}"), @@ -58,11 +58,11 @@ func ExampleSSHPublicKeysClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "mySshPublicKeyName", nil) + res, err := clientFactory.NewSSHPublicKeysClient().Get(ctx, "myResourceGroup", "mySshPublicKeyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -89,11 +89,11 @@ func ExampleSSHPublicKeysClient_GenerateKeyPair() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", nil) + res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachineruncommands_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachineruncommands_client_example_test.go index 20f7de4d2..e4a6149ee 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachineruncommands_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachineruncommands_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVirtualMachineRunCommandsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("subid", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("SoutheastAsia", nil) + pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListPager("SoutheastAsia", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -123,11 +123,11 @@ func ExampleVirtualMachineRunCommandsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("24fb23e3-6ba3-41f0-9b6e-e41131d5d61e", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "SoutheastAsia", "RunPowerShellScript", nil) + res, err := clientFactory.NewVirtualMachineRunCommandsClient().Get(ctx, "SoutheastAsia", "RunPowerShellScript", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -167,11 +167,11 @@ func ExampleVirtualMachineRunCommandsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommand{ + poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommand{ Location: to.Ptr("West US"), Properties: &armcompute.VirtualMachineRunCommandProperties{ AsyncExecution: to.Ptr(false), @@ -239,11 +239,11 @@ func ExampleVirtualMachineRunCommandsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ + poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ Properties: &armcompute.VirtualMachineRunCommandProperties{ Source: &armcompute.VirtualMachineRunCommandScriptSource{ Script: to.Ptr("Write-Host Script Source Updated!"), @@ -297,11 +297,11 @@ func ExampleVirtualMachineRunCommandsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myVM", "myRunCommand", nil) + poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginDelete(ctx, "myResourceGroup", "myVM", "myRunCommand", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -318,11 +318,11 @@ func ExampleVirtualMachineRunCommandsClient_GetByVirtualMachine() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetByVirtualMachine(ctx, "myResourceGroup", "myVM", "myRunCommand", &armcompute.VirtualMachineRunCommandsClientGetByVirtualMachineOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineRunCommandsClient().GetByVirtualMachine(ctx, "myResourceGroup", "myVM", "myRunCommand", &armcompute.VirtualMachineRunCommandsClientGetByVirtualMachineOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -366,11 +366,11 @@ func ExampleVirtualMachineRunCommandsClient_NewListByVirtualMachinePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByVirtualMachinePager("myResourceGroup", "myVM", &armcompute.VirtualMachineRunCommandsClientListByVirtualMachineOptions{Expand: nil}) + pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListByVirtualMachinePager("myResourceGroup", "myVM", &armcompute.VirtualMachineRunCommandsClientListByVirtualMachineOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachines_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachines_client_example_test.go index db0a45f8f..01023b69c 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachines_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachines_client_example_test.go @@ -27,11 +27,11 @@ func ExampleVirtualMachinesClient_NewListByLocationPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscriptionId}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByLocationPager("eastus", nil) + pager := clientFactory.NewVirtualMachinesClient().NewListByLocationPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -169,11 +169,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -289,11 +289,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -409,11 +409,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -531,11 +531,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithUefiSettingsO log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -657,11 +657,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithUserData() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ @@ -782,11 +782,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithNetworkInterf log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -914,11 +914,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatch log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1036,11 +1036,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatch log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1158,11 +1158,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatch log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1282,11 +1282,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatch log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1404,11 +1404,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithPatchS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1528,11 +1528,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createACustomImageVmFromAn log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1635,11 +1635,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAPlatformImageVmWith log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1783,11 +1783,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromACustomImage( log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1889,11 +1889,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromAGeneralizedS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -1995,11 +1995,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromASpecializedS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -2087,11 +2087,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmInAVirtualMachine log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -2207,11 +2207,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmInAnAvailabilityS log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ AvailabilitySet: &armcompute.SubResource{ @@ -2325,11 +2325,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithDiskEncryptio log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -2487,11 +2487,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithHostEncryptio log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("$(fakeStepVar)"), @@ -2615,11 +2615,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithScheduledEven log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ @@ -2751,11 +2751,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithAMarketplaceI log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -2873,11 +2873,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithAnExtensionsT log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ @@ -2999,11 +2999,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithBootDiagnosti log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ @@ -3123,11 +3123,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEmptyDataDisk log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -3263,11 +3263,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -3393,11 +3393,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -3523,11 +3523,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -3651,11 +3651,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithManagedBootDi log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ @@ -3773,11 +3773,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithPasswordAuthe log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -3885,11 +3885,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithPremiumStorag log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -3997,11 +3997,11 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithSshAuthentica log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ @@ -4124,11 +4124,11 @@ func ExampleVirtualMachinesClient_BeginUpdate_updateAVmByDetachingDataDisk() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), @@ -4267,11 +4267,11 @@ func ExampleVirtualMachinesClient_BeginUpdate_updateAVmByForceDetachingDataDisk( log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), @@ -4412,11 +4412,11 @@ func ExampleVirtualMachinesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) + poller, err := clientFactory.NewVirtualMachinesClient().BeginDelete(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4433,11 +4433,11 @@ func ExampleVirtualMachinesClient_Get_getAVirtualMachine() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4560,11 +4560,11 @@ func ExampleVirtualMachinesClient_Get_getAVirtualMachinePlacedOnADedicatedHostGr log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4636,11 +4636,11 @@ func ExampleVirtualMachinesClient_InstanceView_getVirtualMachineInstanceView() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.InstanceView(ctx, "myResourceGroup", "myVM", nil) + res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4777,11 +4777,11 @@ func ExampleVirtualMachinesClient_InstanceView_getInstanceViewOfAVirtualMachineP log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.InstanceView(ctx, "myResourceGroup", "myVM", nil) + res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4838,11 +4838,11 @@ func ExampleVirtualMachinesClient_Generalize() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Generalize(ctx, "myResourceGroup", "myVMName", nil) + _, err = clientFactory.NewVirtualMachinesClient().Generalize(ctx, "myResourceGroup", "myVMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4855,11 +4855,11 @@ func ExampleVirtualMachinesClient_NewListAvailableSizesPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAvailableSizesPager("myResourceGroup", "myVmName", nil) + pager := clientFactory.NewVirtualMachinesClient().NewListAvailableSizesPager("myResourceGroup", "myVmName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -4899,11 +4899,11 @@ func ExampleVirtualMachinesClient_BeginReapply() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReapply(ctx, "ResourceGroup", "VMName", nil) + poller, err := clientFactory.NewVirtualMachinesClient().BeginReapply(ctx, "ResourceGroup", "VMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4920,11 +4920,11 @@ func ExampleVirtualMachinesClient_BeginReimage() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReimage(ctx, "myResourceGroup", "myVMName", &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginReimage(ctx, "myResourceGroup", "myVMName", &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ TempDisk: to.Ptr(true), }, }) @@ -4944,11 +4944,11 @@ func ExampleVirtualMachinesClient_RetrieveBootDiagnosticsData() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "VMName", &armcompute.VirtualMachinesClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) + res, err := clientFactory.NewVirtualMachinesClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "VMName", &armcompute.VirtualMachinesClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4968,11 +4968,11 @@ func ExampleVirtualMachinesClient_SimulateEviction() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.SimulateEviction(ctx, "ResourceGroup", "VMName", nil) + _, err = clientFactory.NewVirtualMachinesClient().SimulateEviction(ctx, "ResourceGroup", "VMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4985,11 +4985,11 @@ func ExampleVirtualMachinesClient_BeginAssessPatches() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginAssessPatches(ctx, "myResourceGroupName", "myVMName", nil) + poller, err := clientFactory.NewVirtualMachinesClient().BeginAssessPatches(ctx, "myResourceGroupName", "myVMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5044,11 +5044,11 @@ func ExampleVirtualMachinesClient_BeginInstallPatches() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginInstallPatches(ctx, "myResourceGroupName", "myVMName", armcompute.VirtualMachineInstallPatchesParameters{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginInstallPatches(ctx, "myResourceGroupName", "myVMName", armcompute.VirtualMachineInstallPatchesParameters{ MaximumDuration: to.Ptr("PT4H"), RebootSetting: to.Ptr(armcompute.VMGuestPatchRebootSettingIfRequired), WindowsParameters: &armcompute.WindowsParameters{ @@ -5108,11 +5108,11 @@ func ExampleVirtualMachinesClient_BeginRunCommand() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("24fb23e3-6ba3-41f0-9b6e-e41131d5d61e", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRunCommand(ctx, "crptestar98131", "vm3036", armcompute.RunCommandInput{ + poller, err := clientFactory.NewVirtualMachinesClient().BeginRunCommand(ctx, "crptestar98131", "vm3036", armcompute.RunCommandInput{ CommandID: to.Ptr("RunPowerShellScript"), }, nil) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go index 929610551..b1196ec24 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go @@ -24,11 +24,11 @@ func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginStartExtensionUpgra log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetRollingUpgradesClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStartExtensionUpgrade(ctx, "myResourceGroup", "{vmss-name}", nil) + poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginStartExtensionUpgrade(ctx, "myResourceGroup", "{vmss-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesets_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesets_client_example_test.go index de16e0ef2..04fd20a42 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesets_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesets_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVirtualMachineScaleSetsClient_NewListByLocationPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByLocationPager("eastus", nil) + pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListByLocationPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -205,11 +205,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createACustomImage log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "", "", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "", "", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -341,11 +341,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAPlatformIma log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -495,11 +495,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFro log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -638,11 +638,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFro log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -781,11 +781,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFro log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -910,11 +910,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -1085,11 +1085,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -1271,11 +1271,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -1437,11 +1437,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -1601,11 +1601,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -1761,11 +1761,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -1919,11 +1919,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -2091,11 +2091,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ @@ -2249,11 +2249,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -2411,11 +2411,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -2593,11 +2593,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -2761,11 +2761,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), @@ -2923,11 +2923,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3114,11 +3114,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3274,11 +3274,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3424,11 +3424,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3574,11 +3574,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3739,11 +3739,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -3901,11 +3901,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -4058,11 +4058,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWit log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("centralus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), @@ -4247,11 +4247,11 @@ func ExampleVirtualMachineScaleSetsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", &armcompute.VirtualMachineScaleSetsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) + poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", &armcompute.VirtualMachineScaleSetsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4268,11 +4268,11 @@ func ExampleVirtualMachineScaleSetsClient_Get_getAVirtualMachineScaleSetPlacedOn log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4367,11 +4367,11 @@ func ExampleVirtualMachineScaleSetsClient_Get_getAVirtualMachineScaleSetWithUser log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go index f75418313..25eb739aa 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtension{ + poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtension{ Properties: &armcompute.VirtualMachineExtensionProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), @@ -97,11 +97,11 @@ func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtensionUpdate{ + poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtensionUpdate{ Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), @@ -146,11 +146,11 @@ func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", nil) + poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -167,11 +167,11 @@ func ExampleVirtualMachineScaleSetVMExtensionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", &armcompute.VirtualMachineScaleSetVMExtensionsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", &armcompute.VirtualMachineScaleSetVMExtensionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -202,11 +202,11 @@ func ExampleVirtualMachineScaleSetVMExtensionsClient_List() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.List(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMExtensionsClientListOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().List(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMExtensionsClientListOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go index 0ad939978..6b78780ed 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommand{ + poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommand{ Location: to.Ptr("West US"), Properties: &armcompute.VirtualMachineRunCommandProperties{ AsyncExecution: to.Ptr(false), @@ -93,11 +93,11 @@ func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ + poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ Properties: &armcompute.VirtualMachineRunCommandProperties{ Source: &armcompute.VirtualMachineRunCommandScriptSource{ Script: to.Ptr("Write-Host Script Source Updated!"), @@ -151,11 +151,11 @@ func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", nil) + poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -172,11 +172,11 @@ func ExampleVirtualMachineScaleSetVMRunCommandsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", &armcompute.VirtualMachineScaleSetVMRunCommandsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", &armcompute.VirtualMachineScaleSetVMRunCommandsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -220,11 +220,11 @@ func ExampleVirtualMachineScaleSetVMRunCommandsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMRunCommandsClientListOptions{Expand: nil}) + pager := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().NewListPager("myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMRunCommandsClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvms_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvms_client_example_test.go index 85f36480e..c818da827 100644 --- a/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvms_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/compute/armcompute/virtualmachinescalesetvms_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVirtualMachineScaleSetVMsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) + poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -46,11 +46,11 @@ func ExampleVirtualMachineScaleSetVMsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) + res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -184,11 +184,11 @@ func ExampleVirtualMachineScaleSetVMsClient_GetInstanceView() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetInstanceView(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", nil) + res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().GetInstanceView(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -243,11 +243,11 @@ func ExampleVirtualMachineScaleSetVMsClient_RetrieveBootDiagnosticsData() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) + res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -267,11 +267,11 @@ func ExampleVirtualMachineScaleSetVMsClient_SimulateEviction() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.SimulateEviction(ctx, "ResourceGroup", "VmScaleSetName", "InstanceId", nil) + _, err = clientFactory.NewVirtualMachineScaleSetVMsClient().SimulateEviction(ctx, "ResourceGroup", "VmScaleSetName", "InstanceId", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -284,11 +284,11 @@ func ExampleVirtualMachineScaleSetVMsClient_BeginRunCommand() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) + clientFactory, err := armcompute.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRunCommand(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", armcompute.RunCommandInput{ + poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRunCommand(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", armcompute.RunCommandInput{ CommandID: to.Ptr("RunPowerShellScript"), Script: []*string{ to.Ptr("# Test multi-line string\r\nWrite-Host Hello World!")}, diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester-pre.yaml b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester-pre.yaml index d8eced7d0..6d61577d1 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester-pre.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester-pre.yaml @@ -102972,7 +102972,6 @@ language: - *ref_40 - *ref_748 - *ref_766 - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester.yaml b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester.yaml index 38fc87ee8..008029b51 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/__debug/go-tester.yaml @@ -70471,6 +70471,9 @@ security: - https://management.azure.com/.default testModel: mockTest: + clientFactoryParametersOutput: + - paramName: subscriptionID + paramOutput: '""' exampleGroups: - operationId: Operations_List examples: @@ -113256,7 +113259,6 @@ language: - *ref_40 - *ref_748 - *ref_766 - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchdeployments_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchdeployments_client_example_test.go index 50fde6677..a4c23246e 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchdeployments_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchdeployments_client_example_test.go @@ -25,11 +25,11 @@ func ExampleBatchDeploymentsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearningservices.BatchDeploymentsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewBatchDeploymentsClient().NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearningservices.BatchDeploymentsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, }) @@ -130,11 +130,11 @@ func ExampleBatchDeploymentsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) + poller, err := clientFactory.NewBatchDeploymentsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -151,11 +151,11 @@ func ExampleBatchDeploymentsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) + res, err := clientFactory.NewBatchDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -245,11 +245,11 @@ func ExampleBatchDeploymentsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialBatchDeploymentPartialTrackedResource{ + poller, err := clientFactory.NewBatchDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialBatchDeploymentPartialTrackedResource{ Identity: &armmachinelearningservices.PartialManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]any{ @@ -389,11 +389,11 @@ func ExampleBatchDeploymentsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.BatchDeploymentData{ + poller, err := clientFactory.NewBatchDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.BatchDeploymentData{ Location: to.Ptr("string"), Tags: map[string]*string{}, Identity: &armmachinelearningservices.ManagedServiceIdentity{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchendpoints_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchendpoints_client_example_test.go index 781921d04..31fde52cb 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchendpoints_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/batchendpoints_client_example_test.go @@ -25,11 +25,11 @@ func ExampleBatchEndpointsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.BatchEndpointsClientListOptions{Count: to.Ptr[int32](1), + pager := clientFactory.NewBatchEndpointsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.BatchEndpointsClientListOptions{Count: to.Ptr[int32](1), Skip: nil, }) for pager.More() { @@ -102,11 +102,11 @@ func ExampleBatchEndpointsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "resourceGroup-1234", "testworkspace", "testBatchEndpoint", nil) + poller, err := clientFactory.NewBatchEndpointsClient().BeginDelete(ctx, "resourceGroup-1234", "testworkspace", "testBatchEndpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -123,11 +123,11 @@ func ExampleBatchEndpointsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + res, err := clientFactory.NewBatchEndpointsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -190,11 +190,11 @@ func ExampleBatchEndpointsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.PartialBatchEndpointPartialTrackedResource{ + poller, err := clientFactory.NewBatchEndpointsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.PartialBatchEndpointPartialTrackedResource{ Identity: &armmachinelearningservices.PartialManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]any{ @@ -284,11 +284,11 @@ func ExampleBatchEndpointsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.BatchEndpointData{ + poller, err := clientFactory.NewBatchEndpointsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.BatchEndpointData{ Location: to.Ptr("string"), Tags: map[string]*string{}, Identity: &armmachinelearningservices.ManagedServiceIdentity{ @@ -382,11 +382,11 @@ func ExampleBatchEndpointsClient_ListKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + res, err := clientFactory.NewBatchEndpointsClient().ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codecontainers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codecontainers_client_example_test.go index bb6d82984..fe6b59e27 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codecontainers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codecontainers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleCodeContainersClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("testrg123", "testworkspace", &armmachinelearningservices.CodeContainersClientListOptions{Skip: nil}) + pager := clientFactory.NewCodeContainersClient().NewListPager("testrg123", "testworkspace", &armmachinelearningservices.CodeContainersClientListOptions{Skip: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -93,11 +93,11 @@ func ExampleCodeContainersClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) + _, err = clientFactory.NewCodeContainersClient().Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -110,11 +110,11 @@ func ExampleCodeContainersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "testworkspace", "testContainer", nil) + res, err := clientFactory.NewCodeContainersClient().Get(ctx, "testrg123", "testworkspace", "testContainer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -150,11 +150,11 @@ func ExampleCodeContainersClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "testrg123", "testworkspace", "testContainer", armmachinelearningservices.CodeContainerData{ + res, err := clientFactory.NewCodeContainersClient().CreateOrUpdate(ctx, "testrg123", "testworkspace", "testContainer", armmachinelearningservices.CodeContainerData{ Properties: &armmachinelearningservices.CodeContainerDetails{ Description: to.Ptr("string"), Tags: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codeversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codeversions_client_example_test.go index dea3f8ebe..570f5ff99 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codeversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/codeversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleCodeVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.CodeVersionsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewCodeVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.CodeVersionsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, }) @@ -80,11 +80,11 @@ func ExampleCodeVersionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + _, err = clientFactory.NewCodeVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -97,11 +97,11 @@ func ExampleCodeVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + res, err := clientFactory.NewCodeVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -141,11 +141,11 @@ func ExampleCodeVersionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.CodeVersionData{ + res, err := clientFactory.NewCodeVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.CodeVersionData{ Properties: &armmachinelearningservices.CodeVersionDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentcontainers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentcontainers_client_example_test.go index 125b9f463..679022e61 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentcontainers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentcontainers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleComponentContainersClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.ComponentContainersClientListOptions{Skip: nil, + pager := clientFactory.NewComponentContainersClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.ComponentContainersClientListOptions{Skip: nil, ListViewType: nil, }) for pager.More() { @@ -77,11 +77,11 @@ func ExampleComponentContainersClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) + _, err = clientFactory.NewComponentContainersClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -94,11 +94,11 @@ func ExampleComponentContainersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewComponentContainersClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -136,11 +136,11 @@ func ExampleComponentContainersClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.ComponentContainerData{ + res, err := clientFactory.NewComponentContainersClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.ComponentContainerData{ Properties: &armmachinelearningservices.ComponentContainerDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentversions_client_example_test.go index 3e5fa3232..4faf6b9a8 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/componentversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleComponentVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.ComponentVersionsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewComponentVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.ComponentVersionsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, ListViewType: nil, @@ -83,11 +83,11 @@ func ExampleComponentVersionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + _, err = clientFactory.NewComponentVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -100,11 +100,11 @@ func ExampleComponentVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + res, err := clientFactory.NewComponentVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -146,11 +146,11 @@ func ExampleComponentVersionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.ComponentVersionData{ + res, err := clientFactory.NewComponentVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.ComponentVersionData{ Properties: &armmachinelearningservices.ComponentVersionDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/compute_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/compute_client_example_test.go index d62581f7f..cf9ba9efd 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/compute_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/compute_client_example_test.go @@ -25,11 +25,11 @@ func ExampleComputeClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("testrg123", "workspaces123", &armmachinelearningservices.ComputeClientListOptions{Skip: nil}) + pager := clientFactory.NewComputeClient().NewListPager("testrg123", "workspaces123", &armmachinelearningservices.ComputeClientListOptions{Skip: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -81,11 +81,11 @@ func ExampleComputeClient_Get_getAAksCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspaces123", "compute123", nil) + res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -115,11 +115,11 @@ func ExampleComputeClient_Get_getAAmlCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspaces123", "compute123", nil) + res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -176,11 +176,11 @@ func ExampleComputeClient_Get_getAKubernetesCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspaces123", "compute123", nil) + res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -232,11 +232,11 @@ func ExampleComputeClient_Get_getAnComputeInstance() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspaces123", "compute123", nil) + res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -299,11 +299,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_attachAKubernetesCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.Kubernetes{ Description: to.Ptr("some compute"), ComputeType: to.Ptr(armmachinelearningservices.ComputeTypeKubernetes), @@ -383,11 +383,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_createAAmlCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.AmlCompute{ Properties: &armmachinelearningservices.AmlComputeProperties{ EnableNodePublicIP: to.Ptr(true), @@ -438,11 +438,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_createADataFactoryCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.DataFactory{ ComputeType: to.Ptr(armmachinelearningservices.ComputeTypeDataFactory), }, @@ -477,11 +477,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_createAnAksCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.AKS{ ComputeType: to.Ptr(armmachinelearningservices.ComputeTypeAKS), }, @@ -516,11 +516,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_createAnComputeInstanceCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.ComputeInstance{ ComputeType: to.Ptr(armmachinelearningservices.ComputeTypeComputeInstance), Properties: &armmachinelearningservices.ComputeInstanceProperties{ @@ -572,11 +572,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_createAnComputeInstanceComputeWith log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.ComputeInstance{ ComputeType: to.Ptr(armmachinelearningservices.ComputeTypeComputeInstance), Properties: &armmachinelearningservices.ComputeInstanceProperties{ @@ -614,11 +614,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_updateAAmlCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.AmlCompute{ Properties: &armmachinelearningservices.AmlComputeProperties{ ScaleSettings: &armmachinelearningservices.ScaleSettings{ @@ -692,11 +692,11 @@ func ExampleComputeClient_BeginCreateOrUpdate_updateAnAksCompute() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ + poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ComputeResource{ Properties: &armmachinelearningservices.AKS{ Properties: &armmachinelearningservices.AKSSchemaProperties{ AgentCount: to.Ptr[int32](4), @@ -741,11 +741,11 @@ func ExampleComputeClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ClusterUpdateParameters{ + poller, err := clientFactory.NewComputeClient().BeginUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.ClusterUpdateParameters{ Properties: &armmachinelearningservices.ClusterUpdateProperties{ Properties: &armmachinelearningservices.ScaleSettingsInformation{ ScaleSettings: &armmachinelearningservices.ScaleSettings{ @@ -786,11 +786,11 @@ func ExampleComputeClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.UnderlyingResourceActionDelete, nil) + poller, err := clientFactory.NewComputeClient().BeginDelete(ctx, "testrg123", "workspaces123", "compute123", armmachinelearningservices.UnderlyingResourceActionDelete, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -807,11 +807,11 @@ func ExampleComputeClient_NewListNodesPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListNodesPager("testrg123", "workspaces123", "compute123", nil) + pager := clientFactory.NewComputeClient().NewListNodesPager("testrg123", "workspaces123", "compute123", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -850,11 +850,11 @@ func ExampleComputeClient_ListKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, "testrg123", "workspaces123", "compute123", nil) + res, err := clientFactory.NewComputeClient().ListKeys(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -878,11 +878,11 @@ func ExampleComputeClient_BeginStart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStart(ctx, "testrg123", "workspaces123", "compute123", nil) + poller, err := clientFactory.NewComputeClient().BeginStart(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -899,11 +899,11 @@ func ExampleComputeClient_BeginStop() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStop(ctx, "testrg123", "workspaces123", "compute123", nil) + poller, err := clientFactory.NewComputeClient().BeginStop(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -920,11 +920,11 @@ func ExampleComputeClient_BeginRestart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestart(ctx, "testrg123", "workspaces123", "compute123", nil) + poller, err := clientFactory.NewComputeClient().BeginRestart(ctx, "testrg123", "workspaces123", "compute123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datacontainers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datacontainers_client_example_test.go index 2712b419f..d2cb42b3e 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datacontainers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datacontainers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDataContainersClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("testrg123", "workspace123", &armmachinelearningservices.DataContainersClientListOptions{Skip: nil, + pager := clientFactory.NewDataContainersClient().NewListPager("testrg123", "workspace123", &armmachinelearningservices.DataContainersClientListOptions{Skip: nil, ListViewType: nil, }) for pager.More() { @@ -105,11 +105,11 @@ func ExampleDataContainersClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "testrg123", "workspace123", "datacontainer123", nil) + _, err = clientFactory.NewDataContainersClient().Delete(ctx, "testrg123", "workspace123", "datacontainer123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -122,11 +122,11 @@ func ExampleDataContainersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspace123", "datacontainer123", nil) + res, err := clientFactory.NewDataContainersClient().Get(ctx, "testrg123", "workspace123", "datacontainer123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -167,11 +167,11 @@ func ExampleDataContainersClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "testrg123", "workspace123", "datacontainer123", armmachinelearningservices.DataContainerData{ + res, err := clientFactory.NewDataContainersClient().CreateOrUpdate(ctx, "testrg123", "workspace123", "datacontainer123", armmachinelearningservices.DataContainerData{ Properties: &armmachinelearningservices.DataContainerDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datastores_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datastores_client_example_test.go index 15a9743b3..77bac4f44 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datastores_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/datastores_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDatastoresClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.DatastoresClientListOptions{Skip: nil, + pager := clientFactory.NewDatastoresClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.DatastoresClientListOptions{Skip: nil, Count: to.Ptr[int32](1), IsDefault: to.Ptr(false), Names: []string{ @@ -89,11 +89,11 @@ func ExampleDatastoresClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) + _, err = clientFactory.NewDatastoresClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -106,11 +106,11 @@ func ExampleDatastoresClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewDatastoresClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -154,11 +154,11 @@ func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureDataLake log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ + res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ Properties: &armmachinelearningservices.AzureDataLakeGen1Datastore{ Description: to.Ptr("string"), Tags: map[string]*string{ @@ -222,11 +222,11 @@ func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureDataLake log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ + res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ Properties: &armmachinelearningservices.AzureDataLakeGen2Datastore{ Description: to.Ptr("string"), Tags: map[string]*string{ @@ -296,11 +296,11 @@ func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureFileStor log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ + res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ Properties: &armmachinelearningservices.AzureFileDatastore{ Description: to.Ptr("string"), Tags: map[string]*string{ @@ -362,11 +362,11 @@ func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureBlobWAcc log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ + res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.DatastoreData{ Properties: &armmachinelearningservices.AzureBlobDatastore{ Description: to.Ptr("string"), Tags: map[string]*string{ @@ -429,11 +429,11 @@ func ExampleDatastoresClient_ListSecrets() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListSecrets(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewDatastoresClient().ListSecrets(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/dataversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/dataversions_client_example_test.go index 192eb3d2c..40a8e8842 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/dataversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/dataversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleDataVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.DataVersionsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewDataVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.DataVersionsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, Tags: to.Ptr("string"), @@ -83,11 +83,11 @@ func ExampleDataVersionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + _, err = clientFactory.NewDataVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -100,11 +100,11 @@ func ExampleDataVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + res, err := clientFactory.NewDataVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -145,11 +145,11 @@ func ExampleDataVersionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.DataVersionBaseData{ + res, err := clientFactory.NewDataVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.DataVersionBaseData{ Properties: &armmachinelearningservices.URIFileDataVersion{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentcontainers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentcontainers_client_example_test.go index 5966e8ac4..31938b91f 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentcontainers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentcontainers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleEnvironmentContainersClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("testrg123", "testworkspace", &armmachinelearningservices.EnvironmentContainersClientListOptions{Skip: nil, + pager := clientFactory.NewEnvironmentContainersClient().NewListPager("testrg123", "testworkspace", &armmachinelearningservices.EnvironmentContainersClientListOptions{Skip: nil, ListViewType: nil, }) for pager.More() { @@ -75,11 +75,11 @@ func ExampleEnvironmentContainersClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) + _, err = clientFactory.NewEnvironmentContainersClient().Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -92,11 +92,11 @@ func ExampleEnvironmentContainersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "testworkspace", "testEnvironment", nil) + res, err := clientFactory.NewEnvironmentContainersClient().Get(ctx, "testrg123", "testworkspace", "testEnvironment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -132,11 +132,11 @@ func ExampleEnvironmentContainersClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "testrg123", "testworkspace", "testEnvironment", armmachinelearningservices.EnvironmentContainerData{ + res, err := clientFactory.NewEnvironmentContainersClient().CreateOrUpdate(ctx, "testrg123", "testworkspace", "testEnvironment", armmachinelearningservices.EnvironmentContainerData{ Properties: &armmachinelearningservices.EnvironmentContainerDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentversions_client_example_test.go index 9cab922a9..f61f5d862 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/environmentversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleEnvironmentVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.EnvironmentVersionsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewEnvironmentVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.EnvironmentVersionsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, ListViewType: nil, @@ -101,11 +101,11 @@ func ExampleEnvironmentVersionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + _, err = clientFactory.NewEnvironmentVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -118,11 +118,11 @@ func ExampleEnvironmentVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + res, err := clientFactory.NewEnvironmentVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -182,11 +182,11 @@ func ExampleEnvironmentVersionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.EnvironmentVersionData{ + res, err := clientFactory.NewEnvironmentVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.EnvironmentVersionData{ Properties: &armmachinelearningservices.EnvironmentVersionDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/jobs_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/jobs_client_example_test.go index de8332165..15297541b 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/jobs_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/jobs_client_example_test.go @@ -27,11 +27,11 @@ func ExampleJobsClient_NewListPager_listAutoMlJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, + pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, JobType: nil, Tag: nil, ListViewType: nil, @@ -155,11 +155,11 @@ func ExampleJobsClient_NewListPager_listCommandJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, + pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, JobType: to.Ptr("string"), Tag: to.Ptr("string"), ListViewType: nil, @@ -273,11 +273,11 @@ func ExampleJobsClient_NewListPager_listPipelineJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, + pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, JobType: to.Ptr("string"), Tag: to.Ptr("string"), ListViewType: nil, @@ -363,11 +363,11 @@ func ExampleJobsClient_NewListPager_listSweepJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, + pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.JobsClientListOptions{Skip: nil, JobType: to.Ptr("string"), Tag: to.Ptr("string"), ListViewType: nil, @@ -479,11 +479,11 @@ func ExampleJobsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "test-rg", "my-aml-workspace", "string", nil) + poller, err := clientFactory.NewJobsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -500,11 +500,11 @@ func ExampleJobsClient_Get_getAutoMlJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -614,11 +614,11 @@ func ExampleJobsClient_Get_getCommandJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -718,11 +718,11 @@ func ExampleJobsClient_Get_getPipelineJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -794,11 +794,11 @@ func ExampleJobsClient_Get_getSweepJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", nil) + res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -896,11 +896,11 @@ func ExampleJobsClient_CreateOrUpdate_createOrUpdateAutoMlJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ + res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ Properties: &armmachinelearningservices.AutoMLJob{ Description: to.Ptr("string"), Properties: map[string]*string{ @@ -1089,11 +1089,11 @@ func ExampleJobsClient_CreateOrUpdate_createOrUpdateCommandJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ + res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ Properties: &armmachinelearningservices.CommandJob{ Description: to.Ptr("string"), Properties: map[string]*string{ @@ -1259,11 +1259,11 @@ func ExampleJobsClient_CreateOrUpdate_createOrUpdatePipelineJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ + res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ Properties: &armmachinelearningservices.PipelineJob{ Description: to.Ptr("string"), Properties: map[string]*string{ @@ -1375,11 +1375,11 @@ func ExampleJobsClient_CreateOrUpdate_createOrUpdateSweepJob() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ + res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearningservices.JobBaseData{ Properties: &armmachinelearningservices.SweepJob{ Description: to.Ptr("string"), Properties: map[string]*string{ @@ -1543,11 +1543,11 @@ func ExampleJobsClient_Cancel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Cancel(ctx, "test-rg", "my-aml-workspace", "string", nil) + _, err = clientFactory.NewJobsClient().Cancel(ctx, "test-rg", "my-aml-workspace", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelcontainers_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelcontainers_client_example_test.go index d459b0a69..14397b352 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelcontainers_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelcontainers_client_example_test.go @@ -25,11 +25,11 @@ func ExampleModelContainersClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("testrg123", "workspace123", &armmachinelearningservices.ModelContainersClientListOptions{Skip: nil, + pager := clientFactory.NewModelContainersClient().NewListPager("testrg123", "workspace123", &armmachinelearningservices.ModelContainersClientListOptions{Skip: nil, Count: nil, ListViewType: nil, }) @@ -76,11 +76,11 @@ func ExampleModelContainersClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "testrg123", "workspace123", "testContainer", nil) + _, err = clientFactory.NewModelContainersClient().Delete(ctx, "testrg123", "workspace123", "testContainer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -93,11 +93,11 @@ func ExampleModelContainersClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "testrg123", "workspace123", "testContainer", nil) + res, err := clientFactory.NewModelContainersClient().Get(ctx, "testrg123", "workspace123", "testContainer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -133,11 +133,11 @@ func ExampleModelContainersClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "testrg123", "workspace123", "testContainer", armmachinelearningservices.ModelContainerData{ + res, err := clientFactory.NewModelContainersClient().CreateOrUpdate(ctx, "testrg123", "workspace123", "testContainer", armmachinelearningservices.ModelContainerData{ Properties: &armmachinelearningservices.ModelContainerDetails{ Description: to.Ptr("Model container description"), Tags: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelversions_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelversions_client_example_test.go index 3e1118de4..e4cf7a9b5 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelversions_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/modelversions_client_example_test.go @@ -25,11 +25,11 @@ func ExampleModelVersionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.ModelVersionsClientListOptions{Skip: nil, + pager := clientFactory.NewModelVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearningservices.ModelVersionsClientListOptions{Skip: nil, OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Version: to.Ptr("string"), @@ -95,11 +95,11 @@ func ExampleModelVersionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + _, err = clientFactory.NewModelVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -112,11 +112,11 @@ func ExampleModelVersionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) + res, err := clientFactory.NewModelVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -164,11 +164,11 @@ func ExampleModelVersionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.ModelVersionData{ + res, err := clientFactory.NewModelVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearningservices.ModelVersionData{ Properties: &armmachinelearningservices.ModelVersionDetails{ Description: to.Ptr("string"), Properties: map[string]*string{ diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlinedeployments_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlinedeployments_client_example_test.go index 7efd1e395..d9488534a 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlinedeployments_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlinedeployments_client_example_test.go @@ -25,11 +25,11 @@ func ExampleOnlineDeploymentsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearningservices.OnlineDeploymentsClientListOptions{OrderBy: to.Ptr("string"), + pager := clientFactory.NewOnlineDeploymentsClient().NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearningservices.OnlineDeploymentsClientListOptions{OrderBy: to.Ptr("string"), Top: to.Ptr[int32](1), Skip: nil, }) @@ -138,11 +138,11 @@ func ExampleOnlineDeploymentsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", nil) + poller, err := clientFactory.NewOnlineDeploymentsClient().BeginDelete(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -159,11 +159,11 @@ func ExampleOnlineDeploymentsClient_Get_getKubernetesOnlineDeployment() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) + res, err := clientFactory.NewOnlineDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -261,11 +261,11 @@ func ExampleOnlineDeploymentsClient_Get_getManagedOnlineDeployment() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) + res, err := clientFactory.NewOnlineDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -358,11 +358,11 @@ func ExampleOnlineDeploymentsClient_BeginUpdate_updateKubernetesOnlineDeployment log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialOnlineDeploymentPartialTrackedResource{ + poller, err := clientFactory.NewOnlineDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialOnlineDeploymentPartialTrackedResource{ Identity: &armmachinelearningservices.PartialManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]any{ @@ -484,11 +484,11 @@ func ExampleOnlineDeploymentsClient_BeginUpdate_updateManagedOnlineDeployment() log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialOnlineDeploymentPartialTrackedResource{ + poller, err := clientFactory.NewOnlineDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.PartialOnlineDeploymentPartialTrackedResource{ Identity: &armmachinelearningservices.PartialManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]any{ @@ -605,11 +605,11 @@ func ExampleOnlineDeploymentsClient_BeginCreateOrUpdate_createOrUpdateKubernetes log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.OnlineDeploymentData{ + poller, err := clientFactory.NewOnlineDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.OnlineDeploymentData{ Location: to.Ptr("string"), Tags: map[string]*string{}, Identity: &armmachinelearningservices.ManagedServiceIdentity{ @@ -774,11 +774,11 @@ func ExampleOnlineDeploymentsClient_BeginCreateOrUpdate_createOrUpdateManagedOnl log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.OnlineDeploymentData{ + poller, err := clientFactory.NewOnlineDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearningservices.OnlineDeploymentData{ Location: to.Ptr("string"), Tags: map[string]*string{}, Identity: &armmachinelearningservices.ManagedServiceIdentity{ @@ -933,11 +933,11 @@ func ExampleOnlineDeploymentsClient_GetLogs() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetLogs(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", armmachinelearningservices.DeploymentLogsRequest{ + res, err := clientFactory.NewOnlineDeploymentsClient().GetLogs(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", armmachinelearningservices.DeploymentLogsRequest{ ContainerType: to.Ptr(armmachinelearningservices.ContainerTypeStorageInitializer), Tail: to.Ptr[int32](0), }, nil) @@ -959,11 +959,11 @@ func ExampleOnlineDeploymentsClient_NewListSKUsPager_listKubernetesOnlineDeploym log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearningservices.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), + pager := clientFactory.NewOnlineDeploymentsClient().NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearningservices.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), Skip: nil, }) for pager.More() { @@ -1002,11 +1002,11 @@ func ExampleOnlineDeploymentsClient_NewListSKUsPager_listManagedOnlineDeployment log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearningservices.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), + pager := clientFactory.NewOnlineDeploymentsClient().NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearningservices.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), Skip: nil, }) for pager.More() { diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlineendpoints_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlineendpoints_client_example_test.go index 9ad87f793..0bff704a7 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlineendpoints_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/onlineendpoints_client_example_test.go @@ -25,11 +25,11 @@ func ExampleOnlineEndpointsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.OnlineEndpointsClientListOptions{Name: to.Ptr("string"), + pager := clientFactory.NewOnlineEndpointsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearningservices.OnlineEndpointsClientListOptions{Name: to.Ptr("string"), Count: to.Ptr[int32](1), ComputeType: to.Ptr(armmachinelearningservices.EndpointComputeTypeManaged), Skip: nil, @@ -109,11 +109,11 @@ func ExampleOnlineEndpointsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + poller, err := clientFactory.NewOnlineEndpointsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -130,11 +130,11 @@ func ExampleOnlineEndpointsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + res, err := clientFactory.NewOnlineEndpointsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -199,11 +199,11 @@ func ExampleOnlineEndpointsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.PartialOnlineEndpointPartialTrackedResource{ + poller, err := clientFactory.NewOnlineEndpointsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.PartialOnlineEndpointPartialTrackedResource{ Identity: &armmachinelearningservices.PartialManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]any{ @@ -294,11 +294,11 @@ func ExampleOnlineEndpointsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.OnlineEndpointData{ + poller, err := clientFactory.NewOnlineEndpointsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.OnlineEndpointData{ Location: to.Ptr("string"), Tags: map[string]*string{}, Identity: &armmachinelearningservices.ManagedServiceIdentity{ @@ -395,11 +395,11 @@ func ExampleOnlineEndpointsClient_ListKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + res, err := clientFactory.NewOnlineEndpointsClient().ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -419,11 +419,11 @@ func ExampleOnlineEndpointsClient_BeginRegenerateKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRegenerateKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.RegenerateEndpointKeysRequest{ + poller, err := clientFactory.NewOnlineEndpointsClient().BeginRegenerateKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearningservices.RegenerateEndpointKeysRequest{ KeyType: to.Ptr(armmachinelearningservices.KeyTypePrimary), KeyValue: to.Ptr("string"), }, nil) @@ -443,11 +443,11 @@ func ExampleOnlineEndpointsClient_GetToken() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetToken(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) + res, err := clientFactory.NewOnlineEndpointsClient().GetToken(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/operations_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/operations_client_example_test.go index 2065b1325..47026045b 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/operations_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/operations_client_example_test.go @@ -24,11 +24,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewOperationsClient(cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privateendpointconnections_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privateendpointconnections_client_example_test.go index 13a6ca382..913f89458 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privateendpointconnections_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privateendpointconnections_client_example_test.go @@ -25,11 +25,11 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("rg-1234", "testworkspace", nil) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("rg-1234", "testworkspace", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -85,11 +85,11 @@ func ExamplePrivateEndpointConnectionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -121,11 +121,11 @@ func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", armmachinelearningservices.PrivateEndpointConnection{ + res, err := clientFactory.NewPrivateEndpointConnectionsClient().CreateOrUpdate(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", armmachinelearningservices.PrivateEndpointConnection{ Properties: &armmachinelearningservices.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armmachinelearningservices.PrivateLinkServiceConnectionState{ Description: to.Ptr("Auto-Approved"), @@ -164,11 +164,11 @@ func ExamplePrivateEndpointConnectionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) + _, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privatelinkresources_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privatelinkresources_client_example_test.go index 817d345ba..5257e6d45 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privatelinkresources_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/privatelinkresources_client_example_test.go @@ -24,11 +24,11 @@ func ExamplePrivateLinkResourcesClient_List() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.List(ctx, "rg-1234", "testworkspace", nil) + res, err := clientFactory.NewPrivateLinkResourcesClient().List(ctx, "rg-1234", "testworkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/quotas_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/quotas_client_example_test.go index 5d2a5e04a..11ea47137 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/quotas_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/quotas_client_example_test.go @@ -25,11 +25,11 @@ func ExampleQuotasClient_Update() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Update(ctx, "eastus", armmachinelearningservices.QuotaUpdateParameters{ + res, err := clientFactory.NewQuotasClient().Update(ctx, "eastus", armmachinelearningservices.QuotaUpdateParameters{ Value: []*armmachinelearningservices.QuotaBaseProperties{ { Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), @@ -76,11 +76,11 @@ func ExampleQuotasClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("eastus", nil) + pager := clientFactory.NewQuotasClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/usages_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/usages_client_example_test.go index c4b074683..fdfd5b366 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/usages_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/usages_client_example_test.go @@ -24,11 +24,11 @@ func ExampleUsagesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewUsagesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("eastus", nil) + pager := clientFactory.NewUsagesClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/virtualmachinesizes_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/virtualmachinesizes_client_example_test.go index 739913c44..dbb886b93 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/virtualmachinesizes_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/virtualmachinesizes_client_example_test.go @@ -24,11 +24,11 @@ func ExampleVirtualMachineSizesClient_List() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewVirtualMachineSizesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.List(ctx, "eastus", nil) + res, err := clientFactory.NewVirtualMachineSizesClient().List(ctx, "eastus", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaceconnections_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaceconnections_client_example_test.go index 244f41f94..959208ec1 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaceconnections_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaceconnections_client_example_test.go @@ -25,11 +25,11 @@ func ExampleWorkspaceConnectionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspaceConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("resourceGroup-1", "workspace-1", &armmachinelearningservices.WorkspaceConnectionsClientListOptions{Target: to.Ptr("www.facebook.com"), + pager := clientFactory.NewWorkspaceConnectionsClient().NewListPager("resourceGroup-1", "workspace-1", &armmachinelearningservices.WorkspaceConnectionsClientListOptions{Target: to.Ptr("www.facebook.com"), Category: to.Ptr("ACR"), }) for pager.More() { @@ -77,11 +77,11 @@ func ExampleWorkspaceConnectionsClient_Create() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspaceConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Create(ctx, "resourceGroup-1", "workspace-1", "connection-1", armmachinelearningservices.WorkspaceConnection{ + res, err := clientFactory.NewWorkspaceConnectionsClient().Create(ctx, "resourceGroup-1", "workspace-1", "connection-1", armmachinelearningservices.WorkspaceConnection{ Properties: &armmachinelearningservices.WorkspaceConnectionProps{ AuthType: to.Ptr("PAT"), Category: to.Ptr("ACR"), @@ -115,11 +115,11 @@ func ExampleWorkspaceConnectionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspaceConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) + res, err := clientFactory.NewWorkspaceConnectionsClient().Get(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -146,11 +146,11 @@ func ExampleWorkspaceConnectionsClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspaceConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) + _, err = clientFactory.NewWorkspaceConnectionsClient().Delete(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspacefeatures_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspacefeatures_client_example_test.go index b8e252eaf..06fe2deff 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspacefeatures_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspacefeatures_client_example_test.go @@ -24,11 +24,11 @@ func ExampleWorkspaceFeaturesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspaceFeaturesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "testworkspace", nil) + pager := clientFactory.NewWorkspaceFeaturesClient().NewListPager("myResourceGroup", "testworkspace", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaces_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaces_client_example_test.go index b7236f373..c8957c336 100644 --- a/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaces_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/machinelearningservices/armmachinelearningservices/workspaces_client_example_test.go @@ -25,11 +25,11 @@ func ExampleWorkspacesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "workspace-1234", "testworkspace", nil) + res, err := clientFactory.NewWorkspacesClient().Get(ctx, "workspace-1234", "testworkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -115,11 +115,11 @@ func ExampleWorkspacesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearningservices.Workspace{ + poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearningservices.Workspace{ Identity: &armmachinelearningservices.ManagedServiceIdentity{ Type: to.Ptr(armmachinelearningservices.ManagedServiceIdentityTypeSystemAssignedUserAssigned), UserAssignedIdentities: map[string]*armmachinelearningservices.UserAssignedIdentity{ @@ -227,11 +227,11 @@ func ExampleWorkspacesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "workspace-1234", "testworkspace", nil) + poller, err := clientFactory.NewWorkspacesClient().BeginDelete(ctx, "workspace-1234", "testworkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -248,11 +248,11 @@ func ExampleWorkspacesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearningservices.WorkspaceUpdateParameters{ + poller, err := clientFactory.NewWorkspacesClient().BeginUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearningservices.WorkspaceUpdateParameters{ Properties: &armmachinelearningservices.WorkspacePropertiesUpdateParameters{ Description: to.Ptr("new description"), FriendlyName: to.Ptr("New friendly name"), @@ -299,11 +299,11 @@ func ExampleWorkspacesClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("workspace-1234", &armmachinelearningservices.WorkspacesClientListByResourceGroupOptions{Skip: nil}) + pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("workspace-1234", &armmachinelearningservices.WorkspacesClientListByResourceGroupOptions{Skip: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -357,11 +357,11 @@ func ExampleWorkspacesClient_BeginDiagnose() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDiagnose(ctx, "workspace-1234", "testworkspace", &armmachinelearningservices.WorkspacesClientBeginDiagnoseOptions{Parameters: &armmachinelearningservices.DiagnoseWorkspaceParameters{ + poller, err := clientFactory.NewWorkspacesClient().BeginDiagnose(ctx, "workspace-1234", "testworkspace", &armmachinelearningservices.WorkspacesClientBeginDiagnoseOptions{Parameters: &armmachinelearningservices.DiagnoseWorkspaceParameters{ Value: &armmachinelearningservices.DiagnoseRequestProperties{ ApplicationInsights: map[string]any{}, ContainerRegistry: map[string]any{}, @@ -420,11 +420,11 @@ func ExampleWorkspacesClient_ListKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, "testrg123", "workspaces123", nil) + res, err := clientFactory.NewWorkspacesClient().ListKeys(ctx, "testrg123", "workspaces123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -457,11 +457,11 @@ func ExampleWorkspacesClient_BeginResyncKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginResyncKeys(ctx, "testrg123", "workspaces123", nil) + poller, err := clientFactory.NewWorkspacesClient().BeginResyncKeys(ctx, "testrg123", "workspaces123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -478,11 +478,11 @@ func ExampleWorkspacesClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(&armmachinelearningservices.WorkspacesClientListBySubscriptionOptions{Skip: nil}) + pager := clientFactory.NewWorkspacesClient().NewListBySubscriptionPager(&armmachinelearningservices.WorkspacesClientListBySubscriptionOptions{Skip: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -536,11 +536,11 @@ func ExampleWorkspacesClient_ListNotebookAccessToken() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListNotebookAccessToken(ctx, "workspace-1234", "testworkspace", nil) + res, err := clientFactory.NewWorkspacesClient().ListNotebookAccessToken(ctx, "workspace-1234", "testworkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -564,11 +564,11 @@ func ExampleWorkspacesClient_BeginPrepareNotebook() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginPrepareNotebook(ctx, "testrg123", "workspaces123", nil) + poller, err := clientFactory.NewWorkspacesClient().BeginPrepareNotebook(ctx, "testrg123", "workspaces123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -596,11 +596,11 @@ func ExampleWorkspacesClient_ListStorageAccountKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListStorageAccountKeys(ctx, "testrg123", "workspaces123", nil) + res, err := clientFactory.NewWorkspacesClient().ListStorageAccountKeys(ctx, "testrg123", "workspaces123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -618,11 +618,11 @@ func ExampleWorkspacesClient_ListNotebookKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListNotebookKeys(ctx, "testrg123", "workspaces123", nil) + res, err := clientFactory.NewWorkspacesClient().ListNotebookKeys(ctx, "testrg123", "workspaces123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -640,11 +640,11 @@ func ExampleWorkspacesClient_ListOutboundNetworkDependenciesEndpoints() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armmachinelearningservices.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil) + clientFactory, err := armmachinelearningservices.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListOutboundNetworkDependenciesEndpoints(ctx, "workspace-1234", "testworkspace", nil) + res, err := clientFactory.NewWorkspacesClient().ListOutboundNetworkDependenciesEndpoints(ctx, "workspace-1234", "testworkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester-pre.yaml b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester-pre.yaml index 181cad69f..0d1abf974 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester-pre.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester-pre.yaml @@ -18494,7 +18494,6 @@ language: name: SignalRManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester.yaml b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester.yaml index 1ec7a9516..c517753d2 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester.yaml +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/__debug/go-tester.yaml @@ -9918,6 +9918,9 @@ security: - https://management.azure.com/.default testModel: mockTest: + clientFactoryParametersOutput: + - paramName: subscriptionID + paramOutput: '""' exampleGroups: - operationId: Operations_List examples: @@ -22230,7 +22233,6 @@ language: name: SignalRManagementClient description: '' azureARM: true - exportClients: false groupParameters: true hasTimeRFC3339: true headAsBoolean: true diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/client_example_test.go index 7b8d750b7..4c364e5cd 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/client_example_test.go @@ -25,11 +25,11 @@ func ExampleClient_CheckNameAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckNameAvailability(ctx, "eastus", armsignalr.NameAvailabilityParameters{ + res, err := clientFactory.NewClient().CheckNameAvailability(ctx, "eastus", armsignalr.NameAvailabilityParameters{ Name: to.Ptr("mySignalRService"), Type: to.Ptr("Microsoft.SignalRService/SignalR"), }, nil) @@ -53,11 +53,11 @@ func ExampleClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(nil) + pager := clientFactory.NewClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -197,11 +197,11 @@ func ExampleClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) + pager := clientFactory.NewClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -341,11 +341,11 @@ func ExampleClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myResourceGroup", "mySignalRService", nil) + res, err := clientFactory.NewClient().Get(ctx, "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -477,11 +477,11 @@ func ExampleClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ + poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ Location: to.Ptr("eastus"), Tags: map[string]*string{ "key1": to.Ptr("value1"), @@ -693,11 +693,11 @@ func ExampleClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "mySignalRService", nil) + poller, err := clientFactory.NewClient().BeginDelete(ctx, "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -714,11 +714,11 @@ func ExampleClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ + poller, err := clientFactory.NewClient().BeginUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ Location: to.Ptr("eastus"), Tags: map[string]*string{ "$(subscriptionId)": to.Ptr("$(subscriptionId)"), @@ -931,11 +931,11 @@ func ExampleClient_ListKeys() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, "myResourceGroup", "mySignalRService", nil) + res, err := clientFactory.NewClient().ListKeys(ctx, "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -953,11 +953,11 @@ func ExampleClient_BeginRegenerateKey() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRegenerateKey(ctx, "myResourceGroup", "mySignalRService", armsignalr.RegenerateKeyParameters{ + poller, err := clientFactory.NewClient().BeginRegenerateKey(ctx, "myResourceGroup", "mySignalRService", armsignalr.RegenerateKeyParameters{ KeyType: to.Ptr(armsignalr.KeyTypePrimary), }, nil) if err != nil { @@ -976,11 +976,11 @@ func ExampleClient_BeginRestart() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestart(ctx, "myResourceGroup", "mySignalRService", nil) + poller, err := clientFactory.NewClient().BeginRestart(ctx, "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/operations_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/operations_client_example_test.go index 6193abca4..b2a8d71e6 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/operations_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/operations_client_example_test.go @@ -24,11 +24,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewOperationsClient(cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privateendpointconnections_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privateendpointconnections_client_example_test.go index dada6f4fc..112852706 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privateendpointconnections_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privateendpointconnections_client_example_test.go @@ -25,11 +25,11 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "mySignalRService", nil) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "mySignalRService", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -76,11 +76,11 @@ func ExamplePrivateEndpointConnectionsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -119,11 +119,11 @@ func ExamplePrivateEndpointConnectionsClient_Update() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Update(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", armsignalr.PrivateEndpointConnection{ + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Update(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", armsignalr.PrivateEndpointConnection{ Properties: &armsignalr.PrivateEndpointConnectionProperties{ PrivateEndpoint: &armsignalr.PrivateEndpoint{ ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -172,11 +172,11 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", nil) + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privatelinkresources_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privatelinkresources_client_example_test.go index 7ee45ac48..1a62070e0 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privatelinkresources_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/privatelinkresources_client_example_test.go @@ -24,11 +24,11 @@ func ExamplePrivateLinkResourcesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "mySignalRService", nil) + pager := clientFactory.NewPrivateLinkResourcesClient().NewListPager("myResourceGroup", "mySignalRService", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go index c57f66af0..8830a0c6d 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSharedPrivateLinkResourcesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewSharedPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", "mySignalRService", nil) + pager := clientFactory.NewSharedPrivateLinkResourcesClient().NewListPager("myResourceGroup", "mySignalRService", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -65,11 +65,11 @@ func ExampleSharedPrivateLinkResourcesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewSharedPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "upstream", "myResourceGroup", "mySignalRService", nil) + res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "upstream", "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -97,11 +97,11 @@ func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewSharedPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "upstream", "myResourceGroup", "mySignalRService", armsignalr.SharedPrivateLinkResource{ + poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginCreateOrUpdate(ctx, "upstream", "myResourceGroup", "mySignalRService", armsignalr.SharedPrivateLinkResource{ Properties: &armsignalr.SharedPrivateLinkResourceProperties{ GroupID: to.Ptr("sites"), PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), @@ -139,11 +139,11 @@ func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewSharedPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "upstream", "myResourceGroup", "mySignalRService", nil) + poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "upstream", "myResourceGroup", "mySignalRService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/usages_client_example_test.go b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/usages_client_example_test.go index 7aa1cf2d1..418aab51a 100644 --- a/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/usages_client_example_test.go +++ b/packages/autorest.gotest/test/integrationtest/output/signalr/armsignalr/usages_client_example_test.go @@ -24,11 +24,11 @@ func ExampleUsagesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armsignalr.NewUsagesClient("00000000-0000-0000-0000-000000000000", cred, nil) + clientFactory, err := armsignalr.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("eastus", nil) + pager := clientFactory.NewUsagesClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/packages/autorest.gotest/test/unittest/generator/__snapshots__/testGoTester.ts.snap b/packages/autorest.gotest/test/unittest/generator/__snapshots__/testGoTester.ts.snap index c24db858d..6d0786881 100644 --- a/packages/autorest.gotest/test/unittest/generator/__snapshots__/testGoTester.ts.snap +++ b/packages/autorest.gotest/test/unittest/generator/__snapshots__/testGoTester.ts.snap @@ -33,11 +33,11 @@ func ExampleExtensionsClient_Create() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - _, err = client.Create(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) + _, err = clientFactory.NewExtensionsClient().Create(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -49,11 +49,11 @@ func ExampleExtensionsClient_Get() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.Get(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) + res, err := clientFactory.NewExtensionsClient().Get(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -88,11 +88,11 @@ func ExampleExtensionsClient_Update() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.Update(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) + res, err := clientFactory.NewExtensionsClient().Update(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -127,11 +127,11 @@ func ExampleExtensionsClient_Delete() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - _, err = client.Delete(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) + _, err = clientFactory.NewExtensionsClient().Delete(ctx, \\"provider.extension\\", \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -143,11 +143,11 @@ func ExampleExtensionsClient_NewListByFarmBeatsPager() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewExtensionsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - pager := client.NewListByFarmBeatsPager(\\"examples-rg\\", \\"examples-farmbeatsResourceName\\", &armagrifood.ExtensionsClientListByFarmBeatsOptions{ExtensionIDs: []string{}, + pager := clientFactory.NewExtensionsClient().NewListByFarmBeatsPager(\\"examples-rg\\", \\"examples-farmbeatsResourceName\\", &armagrifood.ExtensionsClientListByFarmBeatsOptions{ExtensionIDs: []string{}, ExtensionCategories: []string{}, MaxPageSize: nil, SkipToken: nil, @@ -219,11 +219,11 @@ func ExampleFarmBeatsExtensionsClient_NewListPager() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsExtensionsClient(cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - pager := client.NewListPager(&armagrifood.FarmBeatsExtensionsClientListOptions{FarmBeatsExtensionIDs: []string{}, + pager := clientFactory.NewFarmBeatsExtensionsClient().NewListPager(&armagrifood.FarmBeatsExtensionsClientListOptions{FarmBeatsExtensionIDs: []string{}, FarmBeatsExtensionNames: []string{}, ExtensionCategories: []string{}, PublisherIDs: []string{}, @@ -467,11 +467,11 @@ func ExampleFarmBeatsExtensionsClient_Get() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsExtensionsClient(cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.Get(ctx, \\"DTN.ContentServices\\", nil) + res, err := clientFactory.NewFarmBeatsExtensionsClient().Get(ctx, \\"DTN.ContentServices\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -727,11 +727,11 @@ func ExampleFarmBeatsModelsClient_Get() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.Get(ctx, \\"examples-rg\\", \\"examples-farmBeatsResourceName\\", nil) + res, err := clientFactory.NewFarmBeatsModelsClient().Get(ctx, \\"examples-rg\\", \\"examples-farmBeatsResourceName\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -768,11 +768,11 @@ func ExampleFarmBeatsModelsClient_CreateOrUpdate() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.CreateOrUpdate(ctx, \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", armagrifood.FarmBeats{ + res, err := clientFactory.NewFarmBeatsModelsClient().CreateOrUpdate(ctx, \\"examples-farmbeatsResourceName\\", \\"examples-rg\\", armagrifood.FarmBeats{ Tags: map[string]*string{ \\"key1\\": to.Ptr(\\"value1\\"), \\"key2\\": to.Ptr(\\"value2\\"), @@ -815,11 +815,11 @@ func ExampleFarmBeatsModelsClient_Update() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.Update(ctx, \\"examples-farmBeatsResourceName\\", \\"examples-rg\\", armagrifood.FarmBeatsUpdateRequestModel{ + res, err := clientFactory.NewFarmBeatsModelsClient().Update(ctx, \\"examples-farmBeatsResourceName\\", \\"examples-rg\\", armagrifood.FarmBeatsUpdateRequestModel{ Tags: map[string]*string{ \\"key1\\": to.Ptr(\\"value1\\"), \\"key2\\": to.Ptr(\\"value2\\"), @@ -861,11 +861,11 @@ func ExampleFarmBeatsModelsClient_Delete() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - _, err = client.Delete(ctx, \\"examples-rg\\", \\"examples-farmBeatsResourceName\\", nil) + _, err = clientFactory.NewFarmBeatsModelsClient().Delete(ctx, \\"examples-rg\\", \\"examples-farmBeatsResourceName\\", nil) if err != nil { log.Fatalf(\\"failed to finish the request: %v\\", err) } @@ -877,11 +877,11 @@ func ExampleFarmBeatsModelsClient_NewListBySubscriptionPager() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - pager := client.NewListBySubscriptionPager(&armagrifood.FarmBeatsModelsClientListBySubscriptionOptions{MaxPageSize: nil, + pager := clientFactory.NewFarmBeatsModelsClient().NewListBySubscriptionPager(&armagrifood.FarmBeatsModelsClientListBySubscriptionOptions{MaxPageSize: nil, SkipToken: nil, }) for pager.More() { @@ -928,11 +928,11 @@ func ExampleFarmBeatsModelsClient_NewListByResourceGroupPager() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewFarmBeatsModelsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - pager := client.NewListByResourceGroupPager(\\"examples-rg\\", &armagrifood.FarmBeatsModelsClientListByResourceGroupOptions{MaxPageSize: nil, + pager := clientFactory.NewFarmBeatsModelsClient().NewListByResourceGroupPager(\\"examples-rg\\", &armagrifood.FarmBeatsModelsClientListByResourceGroupOptions{MaxPageSize: nil, SkipToken: nil, }) for pager.More() { @@ -1004,11 +1004,11 @@ func ExampleLocationsClient_CheckNameAvailability_locationsCheckNameAvailability log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewLocationsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ + res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ Name: to.Ptr(\\"existingaccountname\\"), Type: to.Ptr(\\"Microsoft.AgFoodPlatform/farmBeats\\"), }, nil) @@ -1031,11 +1031,11 @@ func ExampleLocationsClient_CheckNameAvailability_locationsCheckNameAvailability log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewLocationsClient(\\"11111111-2222-3333-4444-555555555555\\", cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - res, err := client.CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ + res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, armagrifood.CheckNameAvailabilityRequest{ Name: to.Ptr(\\"newaccountname\\"), Type: to.Ptr(\\"Microsoft.AgFoodPlatform/farmBeats\\"), }, nil) @@ -1341,11 +1341,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf(\\"failed to obtain a credential: %v\\", err) } ctx := context.Background() - client, err := armagrifood.NewOperationsClient(cred, nil) - if err != nil { + clientFactory, err := armagrifood.NewClientFactory(\\"\\", cred, nil) + if err != nil { log.Fatalf(\\"failed to create client: %v\\", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil {