From 6a6bf54392e7ba4199470b0181667df2576ca24e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 27 May 2022 07:50:22 +0000 Subject: [PATCH] CodeGen from PR 19247 in Azure/azure-rest-api-specs Merge 59fdc57bc4684aed97ea547d42ba7ee9915dc7a6 into 40fdd84627937fdd8b3b06486497c8f2cfced350 --- .../datafactory/armdatafactory/CHANGELOG.md | 22 + .../datafactory/armdatafactory/autorest.md | 6 +- .../datafactory/armdatafactory/go.mod | 12 +- .../datafactory/armdatafactory/go.sum | 25 +- ...erated_example_activityruns_client_test.go | 47 -- ...xample_dataflowdebugsession_client_test.go | 252 ---------- ...generated_example_dataflows_client_test.go | 150 ------ ..._generated_example_datasets_client_test.go | 141 ------ ...ted_example_exposurecontrol_client_test.go | 102 ----- ...generated_example_factories_client_test.go | 251 ---------- ...ple_integrationruntimenodes_client_test.go | 91 ---- ...rationruntimeobjectmetadata_client_test.go | 71 --- ...example_integrationruntimes_client_test.go | 432 ------------------ ...ated_example_linkedservices_client_test.go | 122 ----- ...ple_managedprivateendpoints_client_test.go | 122 ----- ...mple_managedvirtualnetworks_client_test.go | 92 ---- ...enerated_example_operations_client_test.go | 41 -- ...erated_example_pipelineruns_client_test.go | 97 ---- ...generated_example_pipelines_client_test.go | 218 --------- ...e_privateendpointconnection_client_test.go | 97 ---- ..._privateendpointconnections_client_test.go | 43 -- ...xample_privatelinkresources_client_test.go | 39 -- ...nerated_example_triggerruns_client_test.go | 97 ---- ..._generated_example_triggers_client_test.go | 291 ------------ .../armdatafactory/zz_generated_constants.go | 4 +- .../zz_generated_globalparameters_client.go | 301 ++++++++++++ .../armdatafactory/zz_generated_models.go | 65 +++ .../zz_generated_models_serde.go | 31 ++ .../zz_generated_response_types.go | 20 + 29 files changed, 448 insertions(+), 2834 deletions(-) delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_activityruns_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflowdebugsession_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflows_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_datasets_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_exposurecontrol_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_factories_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimenodes_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimeobjectmetadata_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimes_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_linkedservices_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedprivateendpoints_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedvirtualnetworks_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelineruns_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelines_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnection_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggerruns_client_test.go delete mode 100644 sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggers_client_test.go create mode 100644 sdk/resourcemanager/datafactory/armdatafactory/zz_generated_globalparameters_client.go diff --git a/sdk/resourcemanager/datafactory/armdatafactory/CHANGELOG.md b/sdk/resourcemanager/datafactory/armdatafactory/CHANGELOG.md index b8ec5fb3284d..d574e4fbac49 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/CHANGELOG.md +++ b/sdk/resourcemanager/datafactory/armdatafactory/CHANGELOG.md @@ -1,5 +1,27 @@ # Release History +## 1.1.0 (2022-05-27) +### Features Added + +- New const `RestServiceAuthenticationTypeOAuth2ClientCredential` +- New function `GlobalParameterResource.MarshalJSON() ([]byte, error)` +- New struct `GlobalParameterListResponse` +- New struct `GlobalParameterResource` +- New struct `GlobalParametersClientCreateOrUpdateOptions` +- New struct `GlobalParametersClientCreateOrUpdateResponse` +- New struct `GlobalParametersClientDeleteOptions` +- New struct `GlobalParametersClientDeleteResponse` +- New struct `GlobalParametersClientGetOptions` +- New struct `GlobalParametersClientGetResponse` +- New struct `GlobalParametersClientListByFactoryOptions` +- New struct `GlobalParametersClientListByFactoryResponse` +- New field `Resource` in struct `RestServiceLinkedServiceTypeProperties` +- New field `TokenEndpoint` in struct `RestServiceLinkedServiceTypeProperties` +- New field `ClientSecret` in struct `RestServiceLinkedServiceTypeProperties` +- New field `ClientID` in struct `RestServiceLinkedServiceTypeProperties` +- New field `Scope` in struct `RestServiceLinkedServiceTypeProperties` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/datafactory/armdatafactory/autorest.md b/sdk/resourcemanager/datafactory/armdatafactory/autorest.md index 14f456863485..d6e1fa6ecc91 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/autorest.md +++ b/sdk/resourcemanager/datafactory/armdatafactory/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/datafactory/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/datafactory/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datafactory/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/datafactory/armdatafactory/go.mod b/sdk/resourcemanager/datafactory/armdatafactory/go.mod index 4db9acb4eee7..d0d06bc92ebc 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/go.mod +++ b/sdk/resourcemanager/datafactory/armdatafactory/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdata go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/datafactory/armdatafactory/go.sum b/sdk/resourcemanager/datafactory/armdatafactory/go.sum index ed5b814680ee..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/go.sum +++ b/sdk/resourcemanager/datafactory/armdatafactory/go.sum @@ -1,33 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_activityruns_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_activityruns_client_test.go deleted file mode 100644 index b10c3aeee038..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_activityruns_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ActivityRuns_QueryByPipelineRun.json -func ExampleActivityRunsClient_QueryByPipelineRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewActivityRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryByPipelineRun(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "2f7fdb90-5df1-4b8e-ac2f-064cfa58202b", - armdatafactory.RunFilterParameters{ - LastUpdatedAfter: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:36:44.3345758Z"); return t }()), - LastUpdatedBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:49:48.3686473Z"); return t }()), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflowdebugsession_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflowdebugsession_client_test.go deleted file mode 100644 index 9ebcead07c5a..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflowdebugsession_client_test.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlowDebugSession_Create.json -func ExampleDataFlowDebugSessionClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowDebugSessionClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.CreateDataFlowDebugSessionRequest{ - IntegrationRuntime: &armdatafactory.IntegrationRuntimeDebugResource{ - Name: to.Ptr("ir1"), - Properties: &armdatafactory.ManagedIntegrationRuntime{ - Type: to.Ptr(armdatafactory.IntegrationRuntimeTypeManaged), - TypeProperties: &armdatafactory.ManagedIntegrationRuntimeTypeProperties{ - ComputeProperties: &armdatafactory.IntegrationRuntimeComputeProperties{ - DataFlowProperties: &armdatafactory.IntegrationRuntimeDataFlowProperties{ - ComputeType: to.Ptr(armdatafactory.DataFlowComputeTypeGeneral), - CoreCount: to.Ptr[int32](48), - TimeToLive: to.Ptr[int32](10), - }, - Location: to.Ptr("AutoResolve"), - }, - }, - }, - }, - TimeToLive: to.Ptr[int32](60), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlowDebugSession_QueryByFactory.json -func ExampleDataFlowDebugSessionClient_NewQueryByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowDebugSessionClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewQueryByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlowDebugSession_AddDataFlow.json -func ExampleDataFlowDebugSessionClient_AddDataFlow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowDebugSessionClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AddDataFlow(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.DataFlowDebugPackage{ - DataFlow: &armdatafactory.DataFlowDebugResource{ - Name: to.Ptr("dataflow1"), - Properties: &armdatafactory.MappingDataFlow{ - Type: to.Ptr("MappingDataFlow"), - TypeProperties: &armdatafactory.MappingDataFlowTypeProperties{ - Script: to.Ptr("\n\nsource(output(\n Column_1 as string\n ),\n allowSchemaDrift: true,\n validateSchema: false) ~> source1"), - Sinks: []*armdatafactory.DataFlowSink{}, - Sources: []*armdatafactory.DataFlowSource{ - { - Name: to.Ptr("source1"), - Dataset: &armdatafactory.DatasetReference{ - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - ReferenceName: to.Ptr("DelimitedText2"), - }, - }}, - Transformations: []*armdatafactory.Transformation{}, - }, - }, - }, - Datasets: []*armdatafactory.DatasetDebugResource{ - { - Name: to.Ptr("dataset1"), - Properties: &armdatafactory.DelimitedTextDataset{ - Type: to.Ptr("DelimitedText"), - Schema: []interface{}{ - map[string]interface{}{ - "type": "String", - }, - }, - Annotations: []interface{}{}, - LinkedServiceName: &armdatafactory.LinkedServiceReference{ - Type: to.Ptr(armdatafactory.LinkedServiceReferenceTypeLinkedServiceReference), - ReferenceName: to.Ptr("linkedService5"), - }, - TypeProperties: &armdatafactory.DelimitedTextDatasetTypeProperties{ - ColumnDelimiter: ",", - EscapeChar: "\\", - FirstRowAsHeader: true, - Location: &armdatafactory.AzureBlobStorageLocation{ - Type: to.Ptr("AzureBlobStorageLocation"), - FileName: "Ansiencoding.csv", - Container: "dataflow-sample-data", - }, - QuoteChar: "\"", - }, - }, - }}, - DebugSettings: &armdatafactory.DataFlowDebugPackageDebugSettings{ - DatasetParameters: map[string]interface{}{ - "Movies": map[string]interface{}{ - "path": "abc", - }, - "Output": map[string]interface{}{ - "time": "def", - }, - }, - Parameters: map[string]interface{}{ - "sourcePath": "Toy", - }, - SourceSettings: []*armdatafactory.DataFlowSourceSetting{ - { - RowLimit: to.Ptr[int32](1000), - SourceName: to.Ptr("source1"), - }, - { - RowLimit: to.Ptr[int32](222), - SourceName: to.Ptr("source2"), - }}, - }, - LinkedServices: []*armdatafactory.LinkedServiceDebugResource{ - { - Name: to.Ptr("linkedService1"), - Properties: &armdatafactory.AzureBlobStorageLinkedService{ - Type: to.Ptr("AzureBlobStorage"), - Annotations: []interface{}{}, - TypeProperties: &armdatafactory.AzureBlobStorageLinkedServiceTypeProperties{ - ConnectionString: "DefaultEndpointsProtocol=https;AccountName=;EndpointSuffix=core.windows.net;", - EncryptedCredential: to.Ptr(""), - }, - }, - }}, - SessionID: to.Ptr("f06ed247-9d07-49b2-b05e-2cb4a2fc871e"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlowDebugSession_Delete.json -func ExampleDataFlowDebugSessionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowDebugSessionClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.DeleteDataFlowDebugSessionRequest{ - SessionID: to.Ptr("91fb57e0-8292-47be-89ff-c8f2d2bb2a7e"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlowDebugSession_ExecuteCommand.json -func ExampleDataFlowDebugSessionClient_BeginExecuteCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowDebugSessionClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExecuteCommand(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.DataFlowDebugCommandRequest{ - Command: to.Ptr(armdatafactory.DataFlowDebugCommandTypeExecutePreviewQuery), - CommandPayload: &armdatafactory.DataFlowDebugCommandPayload{ - RowLimits: to.Ptr[int32](100), - StreamName: to.Ptr("source1"), - }, - SessionID: to.Ptr("f06ed247-9d07-49b2-b05e-2cb4a2fc871e"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflows_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflows_client_test.go deleted file mode 100644 index a8fbbfe950f0..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_dataflows_client_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlows_Create.json -func ExampleDataFlowsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataFlow", - armdatafactory.DataFlowResource{ - Properties: &armdatafactory.MappingDataFlow{ - Type: to.Ptr("MappingDataFlow"), - Description: to.Ptr("Sample demo data flow to convert currencies showing usage of union, derive and conditional split transformation."), - TypeProperties: &armdatafactory.MappingDataFlowTypeProperties{ - Script: to.Ptr("source(output(PreviousConversionRate as double,Country as string,DateTime1 as string,CurrentConversionRate as double),allowSchemaDrift: false,validateSchema: false) ~> USDCurrency\nsource(output(PreviousConversionRate as double,Country as string,DateTime1 as string,CurrentConversionRate as double),allowSchemaDrift: true,validateSchema: false) ~> CADSource\nUSDCurrency, CADSource union(byName: true)~> Union\nUnion derive(NewCurrencyRate = round(CurrentConversionRate*1.25)) ~> NewCurrencyColumn\nNewCurrencyColumn split(Country == 'USD',Country == 'CAD',disjoint: false) ~> ConditionalSplit1@(USD, CAD)\nConditionalSplit1@USD sink(saveMode:'overwrite' ) ~> USDSink\nConditionalSplit1@CAD sink(saveMode:'overwrite' ) ~> CADSink"), - Sinks: []*armdatafactory.DataFlowSink{ - { - Name: to.Ptr("USDSink"), - Dataset: &armdatafactory.DatasetReference{ - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - ReferenceName: to.Ptr("USDOutput"), - }, - }, - { - Name: to.Ptr("CADSink"), - Dataset: &armdatafactory.DatasetReference{ - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - ReferenceName: to.Ptr("CADOutput"), - }, - }}, - Sources: []*armdatafactory.DataFlowSource{ - { - Name: to.Ptr("USDCurrency"), - Dataset: &armdatafactory.DatasetReference{ - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - ReferenceName: to.Ptr("CurrencyDatasetUSD"), - }, - }, - { - Name: to.Ptr("CADSource"), - Dataset: &armdatafactory.DatasetReference{ - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - ReferenceName: to.Ptr("CurrencyDatasetCAD"), - }, - }}, - }, - }, - }, - &armdatafactory.DataFlowsClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlows_Get.json -func ExampleDataFlowsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataFlow", - &armdatafactory.DataFlowsClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlows_Delete.json -func ExampleDataFlowsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataFlow", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DataFlows_ListByFactory.json -func ExampleDataFlowsClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDataFlowsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_datasets_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_datasets_client_test.go deleted file mode 100644 index 419d4aa87726..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_datasets_client_test.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Datasets_ListByFactory.json -func ExampleDatasetsClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDatasetsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Datasets_Create.json -func ExampleDatasetsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDatasetsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataset", - armdatafactory.DatasetResource{ - Properties: &armdatafactory.AzureBlobDataset{ - Type: to.Ptr("AzureBlob"), - LinkedServiceName: &armdatafactory.LinkedServiceReference{ - Type: to.Ptr(armdatafactory.LinkedServiceReferenceTypeLinkedServiceReference), - ReferenceName: to.Ptr("exampleLinkedService"), - }, - Parameters: map[string]*armdatafactory.ParameterSpecification{ - "MyFileName": { - Type: to.Ptr(armdatafactory.ParameterTypeString), - }, - "MyFolderPath": { - Type: to.Ptr(armdatafactory.ParameterTypeString), - }, - }, - TypeProperties: &armdatafactory.AzureBlobDatasetTypeProperties{ - Format: &armdatafactory.TextFormat{ - Type: to.Ptr("TextFormat"), - }, - FileName: map[string]interface{}{ - "type": "Expression", - "value": "@dataset().MyFileName", - }, - FolderPath: map[string]interface{}{ - "type": "Expression", - "value": "@dataset().MyFolderPath", - }, - }, - }, - }, - &armdatafactory.DatasetsClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Datasets_Get.json -func ExampleDatasetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDatasetsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataset", - &armdatafactory.DatasetsClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Datasets_Delete.json -func ExampleDatasetsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewDatasetsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleDataset", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_exposurecontrol_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_exposurecontrol_client_test.go deleted file mode 100644 index 9b9839d3e7f3..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_exposurecontrol_client_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ExposureControl_GetFeatureValue.json -func ExampleExposureControlClient_GetFeatureValue() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewExposureControlClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetFeatureValue(ctx, - "WestEurope", - armdatafactory.ExposureControlRequest{ - FeatureName: to.Ptr("ADFIntegrationRuntimeSharingRbac"), - FeatureType: to.Ptr("Feature"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ExposureControl_GetFeatureValueByFactory.json -func ExampleExposureControlClient_GetFeatureValueByFactory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewExposureControlClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetFeatureValueByFactory(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.ExposureControlRequest{ - FeatureName: to.Ptr("ADFIntegrationRuntimeSharingRbac"), - FeatureType: to.Ptr("Feature"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ExposureControl_QueryFeatureValuesByFactory.json -func ExampleExposureControlClient_QueryFeatureValuesByFactory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewExposureControlClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryFeatureValuesByFactory(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.ExposureControlBatchRequest{ - ExposureControlRequests: []*armdatafactory.ExposureControlRequest{ - { - FeatureName: to.Ptr("ADFIntegrationRuntimeSharingRbac"), - FeatureType: to.Ptr("Feature"), - }, - { - FeatureName: to.Ptr("ADFSampleFeature"), - FeatureType: to.Ptr("Feature"), - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_factories_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_factories_client_test.go deleted file mode 100644 index a56e42bfd9bd..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_factories_client_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_List.json -func ExampleFactoriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_ConfigureFactoryRepo.json -func ExampleFactoriesClient_ConfigureFactoryRepo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ConfigureFactoryRepo(ctx, - "East US", - armdatafactory.FactoryRepoUpdate{ - FactoryResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName"), - RepoConfiguration: &armdatafactory.FactoryVSTSConfiguration{ - Type: to.Ptr("FactoryVSTSConfiguration"), - AccountName: to.Ptr("ADF"), - CollaborationBranch: to.Ptr("master"), - LastCommitID: to.Ptr(""), - RepositoryName: to.Ptr("repo"), - RootFolder: to.Ptr("/"), - ProjectName: to.Ptr("project"), - TenantID: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_ListByResourceGroup.json -func ExampleFactoriesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("exampleResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_CreateOrUpdate.json -func ExampleFactoriesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.Factory{ - Location: to.Ptr("East US"), - }, - &armdatafactory.FactoriesClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_Update.json -func ExampleFactoriesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.FactoryUpdateParameters{ - Tags: map[string]*string{ - "exampleTag": to.Ptr("exampleValue"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_Get.json -func ExampleFactoriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - &armdatafactory.FactoriesClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_Delete.json -func ExampleFactoriesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_GetGitHubAccessToken.json -func ExampleFactoriesClient_GetGitHubAccessToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGitHubAccessToken(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.GitHubAccessTokenRequest{ - GitHubAccessCode: to.Ptr("some"), - GitHubAccessTokenBaseURL: to.Ptr("some"), - GitHubClientID: to.Ptr("some"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_GetDataPlaneAccess.json -func ExampleFactoriesClient_GetDataPlaneAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewFactoriesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDataPlaneAccess(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.UserAccessPolicy{ - AccessResourcePath: to.Ptr(""), - ExpireTime: to.Ptr("2018-11-10T09:46:20.2659347Z"), - Permissions: to.Ptr("r"), - ProfileName: to.Ptr("DefaultProfile"), - StartTime: to.Ptr("2018-11-10T02:46:20.2659347Z"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimenodes_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimenodes_client_test.go deleted file mode 100644 index 54f1d06f5c62..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimenodes_client_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimeNodes_Get.json -func ExampleIntegrationRuntimeNodesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimeNodesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - "Node_1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimeNodes_Delete.json -func ExampleIntegrationRuntimeNodesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimeNodesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - "Node_1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimeNodes_Update.json -func ExampleIntegrationRuntimeNodesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimeNodesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - "Node_1", - armdatafactory.UpdateIntegrationRuntimeNodeRequest{ - ConcurrentJobsLimit: to.Ptr[int32](2), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimeobjectmetadata_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimeobjectmetadata_client_test.go deleted file mode 100644 index 5e9f2d008f96..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimeobjectmetadata_client_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimeObjectMetadata_Refresh.json -func ExampleIntegrationRuntimeObjectMetadataClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimeObjectMetadataClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefresh(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "testactivityv2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimeObjectMetadata_Get.json -func ExampleIntegrationRuntimeObjectMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimeObjectMetadataClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "testactivityv2", - &armdatafactory.IntegrationRuntimeObjectMetadataClientGetOptions{GetMetadataRequest: &armdatafactory.GetSsisObjectMetadataRequest{ - MetadataPath: to.Ptr("ssisFolders"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimes_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimes_client_test.go deleted file mode 100644 index 3a37e4b1c100..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_integrationruntimes_client_test.go +++ /dev/null @@ -1,432 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_ListByFactory.json -func ExampleIntegrationRuntimesClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Create.json -func ExampleIntegrationRuntimesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - armdatafactory.IntegrationRuntimeResource{ - Properties: &armdatafactory.SelfHostedIntegrationRuntime{ - Type: to.Ptr(armdatafactory.IntegrationRuntimeTypeSelfHosted), - Description: to.Ptr("A selfhosted integration runtime"), - }, - }, - &armdatafactory.IntegrationRuntimesClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Get.json -func ExampleIntegrationRuntimesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - &armdatafactory.IntegrationRuntimesClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Update.json -func ExampleIntegrationRuntimesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - armdatafactory.UpdateIntegrationRuntimeRequest{ - AutoUpdate: to.Ptr(armdatafactory.IntegrationRuntimeAutoUpdateOff), - UpdateDelayOffset: to.Ptr("\"PT3H\""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Delete.json -func ExampleIntegrationRuntimesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_GetStatus.json -func ExampleIntegrationRuntimesClient_GetStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetStatus(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_ListOutboundNetworkDependenciesEndpoints.json -func ExampleIntegrationRuntimesClient_ListOutboundNetworkDependenciesEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("7ad7c73b-38b8-4df3-84ee-52ff91092f61", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListOutboundNetworkDependenciesEndpoints(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_GetConnectionInfo.json -func ExampleIntegrationRuntimesClient_GetConnectionInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetConnectionInfo(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_RegenerateAuthKey.json -func ExampleIntegrationRuntimesClient_RegenerateAuthKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateAuthKey(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - armdatafactory.IntegrationRuntimeRegenerateKeyParameters{ - KeyName: to.Ptr(armdatafactory.IntegrationRuntimeAuthKeyNameAuthKey2), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_ListAuthKeys.json -func ExampleIntegrationRuntimesClient_ListAuthKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListAuthKeys(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Start.json -func ExampleIntegrationRuntimesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Stop.json -func ExampleIntegrationRuntimesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_SyncCredentials.json -func ExampleIntegrationRuntimesClient_SyncCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SyncCredentials(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_GetMonitoringData.json -func ExampleIntegrationRuntimesClient_GetMonitoringData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMonitoringData(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_Upgrade.json -func ExampleIntegrationRuntimesClient_Upgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Upgrade(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_RemoveLinks.json -func ExampleIntegrationRuntimesClient_RemoveLinks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RemoveLinks(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - armdatafactory.LinkedIntegrationRuntimeRequest{ - LinkedFactoryName: to.Ptr("exampleFactoryName-linked"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/IntegrationRuntimes_CreateLinkedIntegrationRuntime.json -func ExampleIntegrationRuntimesClient_CreateLinkedIntegrationRuntime() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewIntegrationRuntimesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateLinkedIntegrationRuntime(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleIntegrationRuntime", - armdatafactory.CreateLinkedIntegrationRuntimeRequest{ - Name: to.Ptr("bfa92911-9fb6-4fbe-8f23-beae87bc1c83"), - DataFactoryLocation: to.Ptr("West US"), - DataFactoryName: to.Ptr("e9955d6d-56ea-4be3-841c-52a12c1a9981"), - SubscriptionID: to.Ptr("061774c7-4b5a-4159-a55b-365581830283"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_linkedservices_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_linkedservices_client_test.go deleted file mode 100644 index 5447d06cb62e..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_linkedservices_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/LinkedServices_ListByFactory.json -func ExampleLinkedServicesClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewLinkedServicesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/LinkedServices_Create.json -func ExampleLinkedServicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewLinkedServicesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleLinkedService", - armdatafactory.LinkedServiceResource{ - Properties: &armdatafactory.AzureStorageLinkedService{ - Type: to.Ptr("AzureStorage"), - TypeProperties: &armdatafactory.AzureStorageLinkedServiceTypeProperties{ - ConnectionString: map[string]interface{}{ - "type": "SecureString", - "value": "DefaultEndpointsProtocol=https;AccountName=examplestorageaccount;AccountKey=", - }, - }, - }, - }, - &armdatafactory.LinkedServicesClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/LinkedServices_Get.json -func ExampleLinkedServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewLinkedServicesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleLinkedService", - &armdatafactory.LinkedServicesClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/LinkedServices_Delete.json -func ExampleLinkedServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewLinkedServicesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleLinkedService", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedprivateendpoints_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedprivateendpoints_client_test.go deleted file mode 100644 index 6a0593d6adf1..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedprivateendpoints_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedPrivateEndpoints_ListByFactory.json -func ExampleManagedPrivateEndpointsClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedPrivateEndpoints_Create.json -func ExampleManagedPrivateEndpointsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - "exampleManagedPrivateEndpointName", - armdatafactory.ManagedPrivateEndpointResource{ - Properties: &armdatafactory.ManagedPrivateEndpoint{ - Fqdns: []*string{}, - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.Storage/storageAccounts/exampleBlobStorage"), - }, - }, - &armdatafactory.ManagedPrivateEndpointsClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedPrivateEndpoints_Get.json -func ExampleManagedPrivateEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - "exampleManagedPrivateEndpointName", - &armdatafactory.ManagedPrivateEndpointsClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedPrivateEndpoints_Delete.json -func ExampleManagedPrivateEndpointsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - "exampleManagedPrivateEndpointName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedvirtualnetworks_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedvirtualnetworks_client_test.go deleted file mode 100644 index 144f72d1289c..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_managedvirtualnetworks_client_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedVirtualNetworks_ListByFactory.json -func ExampleManagedVirtualNetworksClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedVirtualNetworksClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedVirtualNetworks_Create.json -func ExampleManagedVirtualNetworksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedVirtualNetworksClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - armdatafactory.ManagedVirtualNetworkResource{ - Properties: &armdatafactory.ManagedVirtualNetwork{}, - }, - &armdatafactory.ManagedVirtualNetworksClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ManagedVirtualNetworks_Get.json -func ExampleManagedVirtualNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewManagedVirtualNetworksClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleManagedVirtualNetworkName", - &armdatafactory.ManagedVirtualNetworksClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_operations_client_test.go deleted file mode 100644 index fb5c0f670330..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelineruns_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelineruns_client_test.go deleted file mode 100644 index aa07685bbd56..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelineruns_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/PipelineRuns_QueryByFactory.json -func ExamplePipelineRunsClient_QueryByFactory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelineRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryByFactory(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.RunFilterParameters{ - Filters: []*armdatafactory.RunQueryFilter{ - { - Operand: to.Ptr(armdatafactory.RunQueryFilterOperandPipelineName), - Operator: to.Ptr(armdatafactory.RunQueryFilterOperatorEquals), - Values: []*string{ - to.Ptr("examplePipeline")}, - }}, - LastUpdatedAfter: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:36:44.3345758Z"); return t }()), - LastUpdatedBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:49:48.3686473Z"); return t }()), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/PipelineRuns_Get.json -func ExamplePipelineRunsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelineRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "2f7fdb90-5df1-4b8e-ac2f-064cfa58202b", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/PipelineRuns_Cancel.json -func ExamplePipelineRunsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelineRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "16ac5348-ff82-4f95-a80d-638c1d47b721", - &armdatafactory.PipelineRunsClientCancelOptions{IsRecursive: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelines_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelines_client_test.go deleted file mode 100644 index bbd3a46b16c6..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_pipelines_client_test.go +++ /dev/null @@ -1,218 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Pipelines_ListByFactory.json -func ExamplePipelinesClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelinesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Pipelines_Create.json -func ExamplePipelinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelinesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "examplePipeline", - armdatafactory.PipelineResource{ - Properties: &armdatafactory.Pipeline{ - Activities: []armdatafactory.ActivityClassification{ - &armdatafactory.ForEachActivity{ - Name: to.Ptr("ExampleForeachActivity"), - Type: to.Ptr("ForEach"), - TypeProperties: &armdatafactory.ForEachActivityTypeProperties{ - Activities: []armdatafactory.ActivityClassification{ - &armdatafactory.CopyActivity{ - Name: to.Ptr("ExampleCopyActivity"), - Type: to.Ptr("Copy"), - Inputs: []*armdatafactory.DatasetReference{ - { - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - Parameters: map[string]interface{}{ - "MyFileName": "examplecontainer.csv", - "MyFolderPath": "examplecontainer", - }, - ReferenceName: to.Ptr("exampleDataset"), - }}, - Outputs: []*armdatafactory.DatasetReference{ - { - Type: to.Ptr(armdatafactory.DatasetReferenceTypeDatasetReference), - Parameters: map[string]interface{}{ - "MyFileName": map[string]interface{}{ - "type": "Expression", - "value": "@item()", - }, - "MyFolderPath": "examplecontainer", - }, - ReferenceName: to.Ptr("exampleDataset"), - }}, - TypeProperties: &armdatafactory.CopyActivityTypeProperties{ - DataIntegrationUnits: float64(32), - Sink: &armdatafactory.BlobSink{ - Type: to.Ptr("BlobSink"), - }, - Source: &armdatafactory.BlobSource{ - Type: to.Ptr("BlobSource"), - }, - }, - }}, - IsSequential: to.Ptr(true), - Items: &armdatafactory.Expression{ - Type: to.Ptr(armdatafactory.ExpressionTypeExpression), - Value: to.Ptr("@pipeline().parameters.OutputBlobNameList"), - }, - }, - }}, - Parameters: map[string]*armdatafactory.ParameterSpecification{ - "JobId": { - Type: to.Ptr(armdatafactory.ParameterTypeString), - }, - "OutputBlobNameList": { - Type: to.Ptr(armdatafactory.ParameterTypeArray), - }, - }, - Policy: &armdatafactory.PipelinePolicy{ - ElapsedTimeMetric: &armdatafactory.PipelineElapsedTimeMetricPolicy{ - Duration: "0.00:10:00", - }, - }, - RunDimensions: map[string]interface{}{ - "JobId": map[string]interface{}{ - "type": "Expression", - "value": "@pipeline().parameters.JobId", - }, - }, - Variables: map[string]*armdatafactory.VariableSpecification{ - "TestVariableArray": { - Type: to.Ptr(armdatafactory.VariableTypeArray), - }, - }, - }, - }, - &armdatafactory.PipelinesClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Pipelines_Get.json -func ExamplePipelinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelinesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "examplePipeline", - &armdatafactory.PipelinesClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Pipelines_Delete.json -func ExamplePipelinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelinesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "examplePipeline", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Pipelines_CreateRun.json -func ExamplePipelinesClient_CreateRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPipelinesClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateRun(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "examplePipeline", - &armdatafactory.PipelinesClientCreateRunOptions{ReferencePipelineRunID: nil, - IsRecovery: nil, - StartActivityName: nil, - StartFromFailure: nil, - Parameters: map[string]interface{}{ - "OutputBlobNameList": []interface{}{ - "exampleoutput.csv", - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnection_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnection_client_test.go deleted file mode 100644 index 17983653232b..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnection_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/ApproveRejectPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPrivateEndpointConnectionClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "connection", - armdatafactory.PrivateLinkConnectionApprovalRequestResource{ - Properties: &armdatafactory.PrivateLinkConnectionApprovalRequest{ - PrivateEndpoint: &armdatafactory.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/privateEndpoints/myPrivateEndpoint"), - }, - PrivateLinkServiceConnectionState: &armdatafactory.PrivateLinkConnectionState{ - Description: to.Ptr("Approved by admin."), - ActionsRequired: to.Ptr(""), - Status: to.Ptr("Approved"), - }, - }, - }, - &armdatafactory.PrivateEndpointConnectionClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPrivateEndpointConnectionClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "connection", - &armdatafactory.PrivateEndpointConnectionClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPrivateEndpointConnectionClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "connection", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index f111053b0ed7..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/PrivateEndPointConnections_ListByFactory.json -func ExamplePrivateEndPointConnectionsClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPrivateEndPointConnectionsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 8a53089ca6ee..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GetPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewPrivateLinkResourcesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggerruns_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggerruns_client_test.go deleted file mode 100644 index a98400707c89..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggerruns_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/TriggerRuns_Rerun.json -func ExampleTriggerRunsClient_Rerun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggerRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Rerun(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - "2f7fdb90-5df1-4b8e-ac2f-064cfa58202b", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/TriggerRuns_Cancel.json -func ExampleTriggerRunsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggerRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - "2f7fdb90-5df1-4b8e-ac2f-064cfa58202b", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/TriggerRuns_QueryByFactory.json -func ExampleTriggerRunsClient_QueryByFactory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggerRunsClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryByFactory(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.RunFilterParameters{ - Filters: []*armdatafactory.RunQueryFilter{ - { - Operand: to.Ptr(armdatafactory.RunQueryFilterOperandTriggerName), - Operator: to.Ptr(armdatafactory.RunQueryFilterOperatorEquals), - Values: []*string{ - to.Ptr("exampleTrigger")}, - }}, - LastUpdatedAfter: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:36:44.3345758Z"); return t }()), - LastUpdatedBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:49:48.3686473Z"); return t }()), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggers_client_test.go b/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggers_client_test.go deleted file mode 100644 index 497bf2eac251..000000000000 --- a/sdk/resourcemanager/datafactory/armdatafactory/ze_generated_example_triggers_client_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdatafactory_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_ListByFactory.json -func ExampleTriggersClient_NewListByFactoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFactoryPager("exampleResourceGroup", - "exampleFactoryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_QueryByFactory.json -func ExampleTriggersClient_QueryByFactory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryByFactory(ctx, - "exampleResourceGroup", - "exampleFactoryName", - armdatafactory.TriggerFilterParameters{ - ParentTriggerName: to.Ptr("exampleTrigger"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_Create.json -func ExampleTriggersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - armdatafactory.TriggerResource{ - Properties: &armdatafactory.ScheduleTrigger{ - Type: to.Ptr("ScheduleTrigger"), - Pipelines: []*armdatafactory.TriggerPipelineReference{ - { - Parameters: map[string]interface{}{ - "OutputBlobNameList": []interface{}{ - "exampleoutput.csv", - }, - }, - PipelineReference: &armdatafactory.PipelineReference{ - Type: to.Ptr(armdatafactory.PipelineReferenceTypePipelineReference), - ReferenceName: to.Ptr("examplePipeline"), - }, - }}, - TypeProperties: &armdatafactory.ScheduleTriggerTypeProperties{ - Recurrence: &armdatafactory.ScheduleTriggerRecurrence{ - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:55:13.8441801Z"); return t }()), - Frequency: to.Ptr(armdatafactory.RecurrenceFrequencyMinute), - Interval: to.Ptr[int32](4), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-16T00:39:13.8441801Z"); return t }()), - TimeZone: to.Ptr("UTC"), - }, - }, - }, - }, - &armdatafactory.TriggersClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_Get.json -func ExampleTriggersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - &armdatafactory.TriggersClientGetOptions{IfNoneMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_Delete.json -func ExampleTriggersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_SubscribeToEvents.json -func ExampleTriggersClient_BeginSubscribeToEvents() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSubscribeToEvents(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_GetEventSubscriptionStatus.json -func ExampleTriggersClient_GetEventSubscriptionStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetEventSubscriptionStatus(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_UnsubscribeFromEvents.json -func ExampleTriggersClient_BeginUnsubscribeFromEvents() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUnsubscribeFromEvents(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_Start.json -func ExampleTriggersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Triggers_Stop.json -func ExampleTriggersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdatafactory.NewTriggersClient("12345678-1234-1234-1234-12345678abc", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "exampleResourceGroup", - "exampleFactoryName", - "exampleTrigger", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_constants.go b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_constants.go index 73f63ea4cbef..63166ee10034 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_constants.go +++ b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_constants.go @@ -10,7 +10,7 @@ package armdatafactory const ( moduleName = "armdatafactory" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) type AmazonRdsForOraclePartitionOption string @@ -1259,6 +1259,7 @@ const ( RestServiceAuthenticationTypeAnonymous RestServiceAuthenticationType = "Anonymous" RestServiceAuthenticationTypeBasic RestServiceAuthenticationType = "Basic" RestServiceAuthenticationTypeManagedServiceIdentity RestServiceAuthenticationType = "ManagedServiceIdentity" + RestServiceAuthenticationTypeOAuth2ClientCredential RestServiceAuthenticationType = "OAuth2ClientCredential" ) // PossibleRestServiceAuthenticationTypeValues returns the possible values for the RestServiceAuthenticationType const type. @@ -1268,6 +1269,7 @@ func PossibleRestServiceAuthenticationTypeValues() []RestServiceAuthenticationTy RestServiceAuthenticationTypeAnonymous, RestServiceAuthenticationTypeBasic, RestServiceAuthenticationTypeManagedServiceIdentity, + RestServiceAuthenticationTypeOAuth2ClientCredential, } } diff --git a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_globalparameters_client.go b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_globalparameters_client.go new file mode 100644 index 000000000000..b0e16553bc20 --- /dev/null +++ b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_globalparameters_client.go @@ -0,0 +1,301 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatafactory + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GlobalParametersClient contains the methods for the GlobalParameters group. +// Don't use this type directly, use NewGlobalParametersClient() instead. +type GlobalParametersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGlobalParametersClient creates a new instance of GlobalParametersClient with the specified values. +// subscriptionID - The subscription identifier. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewGlobalParametersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalParametersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &GlobalParametersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a Global parameter +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2018-06-01 +// resourceGroupName - The resource group name. +// factoryName - The factory name. +// globalParameterName - The global parameter name. +// defaultParam - Global parameter resource definition. +// options - GlobalParametersClientCreateOrUpdateOptions contains the optional parameters for the GlobalParametersClient.CreateOrUpdate +// method. +func (client *GlobalParametersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, defaultParam GlobalParameterResource, options *GlobalParametersClientCreateOrUpdateOptions) (GlobalParametersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, factoryName, globalParameterName, defaultParam, options) + if err != nil { + return GlobalParametersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalParametersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalParametersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GlobalParametersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, defaultParam GlobalParameterResource, options *GlobalParametersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if factoryName == "" { + return nil, errors.New("parameter factoryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{factoryName}", url.PathEscape(factoryName)) + if globalParameterName == "" { + return nil, errors.New("parameter globalParameterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalParameterName}", url.PathEscape(globalParameterName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, defaultParam) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GlobalParametersClient) createOrUpdateHandleResponse(resp *http.Response) (GlobalParametersClientCreateOrUpdateResponse, error) { + result := GlobalParametersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalParameterResource); err != nil { + return GlobalParametersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a Global parameter +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2018-06-01 +// resourceGroupName - The resource group name. +// factoryName - The factory name. +// globalParameterName - The global parameter name. +// options - GlobalParametersClientDeleteOptions contains the optional parameters for the GlobalParametersClient.Delete method. +func (client *GlobalParametersClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, options *GlobalParametersClientDeleteOptions) (GlobalParametersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, factoryName, globalParameterName, options) + if err != nil { + return GlobalParametersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalParametersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return GlobalParametersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return GlobalParametersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GlobalParametersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, options *GlobalParametersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if factoryName == "" { + return nil, errors.New("parameter factoryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{factoryName}", url.PathEscape(factoryName)) + if globalParameterName == "" { + return nil, errors.New("parameter globalParameterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalParameterName}", url.PathEscape(globalParameterName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a Global parameter +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2018-06-01 +// resourceGroupName - The resource group name. +// factoryName - The factory name. +// globalParameterName - The global parameter name. +// options - GlobalParametersClientGetOptions contains the optional parameters for the GlobalParametersClient.Get method. +func (client *GlobalParametersClient) Get(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, options *GlobalParametersClientGetOptions) (GlobalParametersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, factoryName, globalParameterName, options) + if err != nil { + return GlobalParametersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalParametersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalParametersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GlobalParametersClient) getCreateRequest(ctx context.Context, resourceGroupName string, factoryName string, globalParameterName string, options *GlobalParametersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if factoryName == "" { + return nil, errors.New("parameter factoryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{factoryName}", url.PathEscape(factoryName)) + if globalParameterName == "" { + return nil, errors.New("parameter globalParameterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalParameterName}", url.PathEscape(globalParameterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GlobalParametersClient) getHandleResponse(resp *http.Response) (GlobalParametersClientGetResponse, error) { + result := GlobalParametersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalParameterResource); err != nil { + return GlobalParametersClientGetResponse{}, err + } + return result, nil +} + +// NewListByFactoryPager - Lists Global parameters +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2018-06-01 +// resourceGroupName - The resource group name. +// factoryName - The factory name. +// options - GlobalParametersClientListByFactoryOptions contains the optional parameters for the GlobalParametersClient.ListByFactory +// method. +func (client *GlobalParametersClient) NewListByFactoryPager(resourceGroupName string, factoryName string, options *GlobalParametersClientListByFactoryOptions) *runtime.Pager[GlobalParametersClientListByFactoryResponse] { + return runtime.NewPager(runtime.PagingHandler[GlobalParametersClientListByFactoryResponse]{ + More: func(page GlobalParametersClientListByFactoryResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GlobalParametersClientListByFactoryResponse) (GlobalParametersClientListByFactoryResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByFactoryCreateRequest(ctx, resourceGroupName, factoryName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GlobalParametersClientListByFactoryResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalParametersClientListByFactoryResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalParametersClientListByFactoryResponse{}, runtime.NewResponseError(resp) + } + return client.listByFactoryHandleResponse(resp) + }, + }) +} + +// listByFactoryCreateRequest creates the ListByFactory request. +func (client *GlobalParametersClient) listByFactoryCreateRequest(ctx context.Context, resourceGroupName string, factoryName string, options *GlobalParametersClientListByFactoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if factoryName == "" { + return nil, errors.New("parameter factoryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{factoryName}", url.PathEscape(factoryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByFactoryHandleResponse handles the ListByFactory response. +func (client *GlobalParametersClient) listByFactoryHandleResponse(resp *http.Response) (GlobalParametersClientListByFactoryResponse, error) { + result := GlobalParametersClientListByFactoryResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalParameterListResponse); err != nil { + return GlobalParametersClientListByFactoryResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models.go b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models.go index dda111fce7da..5af417a87cae 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models.go +++ b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models.go @@ -12441,6 +12441,33 @@ type GitHubClientSecret struct { ByoaSecretName *string `json:"byoaSecretName,omitempty"` } +// GlobalParameterListResponse - A list of Global parameters. +type GlobalParameterListResponse struct { + // REQUIRED; List of global parameters. + Value []*GlobalParameterResource `json:"value,omitempty"` + + // The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// GlobalParameterResource - Global parameters resource type. +type GlobalParameterResource struct { + // REQUIRED; Properties of the global parameter. + Properties map[string]*GlobalParameterSpecification `json:"properties,omitempty"` + + // READ-ONLY; Etag identifies change in the resource. + Etag *string `json:"etag,omitempty" azure:"ro"` + + // READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + // GlobalParameterSpecification - Definition of a single parameter for an entity. type GlobalParameterSpecification struct { // REQUIRED; Global Parameter type. @@ -12450,6 +12477,28 @@ type GlobalParameterSpecification struct { Value interface{} `json:"value,omitempty"` } +// GlobalParametersClientCreateOrUpdateOptions contains the optional parameters for the GlobalParametersClient.CreateOrUpdate +// method. +type GlobalParametersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// GlobalParametersClientDeleteOptions contains the optional parameters for the GlobalParametersClient.Delete method. +type GlobalParametersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GlobalParametersClientGetOptions contains the optional parameters for the GlobalParametersClient.Get method. +type GlobalParametersClientGetOptions struct { + // placeholder for future optional parameters +} + +// GlobalParametersClientListByFactoryOptions contains the optional parameters for the GlobalParametersClient.ListByFactory +// method. +type GlobalParametersClientListByFactoryOptions struct { + // placeholder for future optional parameters +} + // GoogleAdWordsLinkedService - Google AdWords service linked service. type GoogleAdWordsLinkedService struct { // REQUIRED; Type of linked service. @@ -22193,6 +22242,12 @@ type RestServiceLinkedServiceTypeProperties struct { // string (or Expression with resultType string). AzureCloudType interface{} `json:"azureCloudType,omitempty"` + // The client ID associated with your application. Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` + + // The client secret associated with your application. + ClientSecret SecretBaseClassification `json:"clientSecret,omitempty"` + // The credential reference containing authentication information. Credential *CredentialReference `json:"credential,omitempty"` @@ -22207,6 +22262,13 @@ type RestServiceLinkedServiceTypeProperties struct { // The password used in Basic authentication type. Password SecretBaseClassification `json:"password,omitempty"` + // The target service or resource to which the access will be requested. Type: string (or Expression with resultType string). + Resource interface{} `json:"resource,omitempty"` + + // The scope of the access required. It describes what kind of access will be requested. Type: string (or Expression with + // resultType string). + Scope interface{} `json:"scope,omitempty"` + // The application's client ID used in AadServicePrincipal authentication type. ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` @@ -22217,6 +22279,9 @@ type RestServiceLinkedServiceTypeProperties struct { // resides. Tenant interface{} `json:"tenant,omitempty"` + // The token endpoint of the authorization server to acquire access token. Type: string (or Expression with resultType string). + TokenEndpoint interface{} `json:"tokenEndpoint,omitempty"` + // The user name used in Basic authentication type. UserName interface{} `json:"userName,omitempty"` } diff --git a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models_serde.go b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models_serde.go index 85b53abfe2f1..54907bcda588 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models_serde.go +++ b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_models_serde.go @@ -17742,6 +17742,17 @@ func (g *GetMetadataActivityTypeProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GlobalParameterResource. +func (g GlobalParameterResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", g.Etag) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type GoogleAdWordsLinkedService. func (g GoogleAdWordsLinkedService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -31167,13 +31178,18 @@ func (r RestServiceLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "authHeaders", &r.AuthHeaders) populate(objectMap, "authenticationType", r.AuthenticationType) populate(objectMap, "azureCloudType", &r.AzureCloudType) + populate(objectMap, "clientId", &r.ClientID) + populate(objectMap, "clientSecret", r.ClientSecret) populate(objectMap, "credential", r.Credential) populate(objectMap, "enableServerCertificateValidation", &r.EnableServerCertificateValidation) populate(objectMap, "encryptedCredential", &r.EncryptedCredential) populate(objectMap, "password", r.Password) + populate(objectMap, "resource", &r.Resource) + populate(objectMap, "scope", &r.Scope) populate(objectMap, "servicePrincipalId", &r.ServicePrincipalID) populate(objectMap, "servicePrincipalKey", r.ServicePrincipalKey) populate(objectMap, "tenant", &r.Tenant) + populate(objectMap, "tokenEndpoint", &r.TokenEndpoint) populate(objectMap, "url", &r.URL) populate(objectMap, "userName", &r.UserName) return json.Marshal(objectMap) @@ -31200,6 +31216,12 @@ func (r *RestServiceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) erro case "azureCloudType": err = unpopulate(val, "AzureCloudType", &r.AzureCloudType) delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &r.ClientID) + delete(rawMsg, key) + case "clientSecret": + r.ClientSecret, err = unmarshalSecretBaseClassification(val) + delete(rawMsg, key) case "credential": err = unpopulate(val, "Credential", &r.Credential) delete(rawMsg, key) @@ -31212,6 +31234,12 @@ func (r *RestServiceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) erro case "password": r.Password, err = unmarshalSecretBaseClassification(val) delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &r.Resource) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &r.Scope) + delete(rawMsg, key) case "servicePrincipalId": err = unpopulate(val, "ServicePrincipalID", &r.ServicePrincipalID) delete(rawMsg, key) @@ -31221,6 +31249,9 @@ func (r *RestServiceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) erro case "tenant": err = unpopulate(val, "Tenant", &r.Tenant) delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &r.TokenEndpoint) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &r.URL) delete(rawMsg, key) diff --git a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_response_types.go b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_response_types.go index 4c8901a7f852..6717209a185d 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_response_types.go +++ b/sdk/resourcemanager/datafactory/armdatafactory/zz_generated_response_types.go @@ -138,6 +138,26 @@ type FactoriesClientUpdateResponse struct { Factory } +// GlobalParametersClientCreateOrUpdateResponse contains the response from method GlobalParametersClient.CreateOrUpdate. +type GlobalParametersClientCreateOrUpdateResponse struct { + GlobalParameterResource +} + +// GlobalParametersClientDeleteResponse contains the response from method GlobalParametersClient.Delete. +type GlobalParametersClientDeleteResponse struct { + // placeholder for future response values +} + +// GlobalParametersClientGetResponse contains the response from method GlobalParametersClient.Get. +type GlobalParametersClientGetResponse struct { + GlobalParameterResource +} + +// GlobalParametersClientListByFactoryResponse contains the response from method GlobalParametersClient.ListByFactory. +type GlobalParametersClientListByFactoryResponse struct { + GlobalParameterListResponse +} + // IntegrationRuntimeNodesClientDeleteResponse contains the response from method IntegrationRuntimeNodesClient.Delete. type IntegrationRuntimeNodesClientDeleteResponse struct { // placeholder for future response values