diff --git a/packages/typespec-go/.scripts/tspcompile.js b/packages/typespec-go/.scripts/tspcompile.js index dd1945de8..72e7ad889 100644 --- a/packages/typespec-go/.scripts/tspcompile.js +++ b/packages/typespec-go/.scripts/tspcompile.js @@ -186,6 +186,7 @@ function generate(moduleName, input, outputDir, perTestOptions) { ]; // these options _can_ be changed per test + // TODO: disabled examples by default https://github.com/Azure/autorest.go/issues/1441 const defaultOptions = [ 'module-version=0.1.0', 'generate-fakes=true', @@ -194,7 +195,7 @@ function generate(moduleName, input, outputDir, perTestOptions) { 'remove-unreferenced-types=true', 'fix-const-stuttering=true', `examples-directory=${input}/examples`, - 'generate-examples=true' + 'generate-examples=false' ]; let allOptions = fixedOptions; diff --git a/packages/typespec-go/src/tcgcadapter/clients.ts b/packages/typespec-go/src/tcgcadapter/clients.ts index bb7778480..55d24c26b 100644 --- a/packages/typespec-go/src/tcgcadapter/clients.ts +++ b/packages/typespec-go/src/tcgcadapter/clients.ts @@ -269,7 +269,9 @@ export class clientAdapter { // we must do this after adapting method params as it can add optional params this.ta.codeModel.paramGroups.push(this.adaptParameterGroup(method.optionalParamsGroup)); - this.adaptHttpOperationExamples(sdkMethod, method, paramMapping); + if (this.ta.codeModel.options.generateExamples) { + this.adaptHttpOperationExamples(sdkMethod, method, paramMapping); + } } private adaptMethodParameters(sdkMethod: tcgc.SdkServiceMethod, method: go.Method | go.NextPageMethod): Map> { diff --git a/packages/typespec-go/test/armapicenter/go.mod b/packages/typespec-go/test/armapicenter/go.mod index 0084d4dad..62881338c 100644 --- a/packages/typespec-go/test/armapicenter/go.mod +++ b/packages/typespec-go/test/armapicenter/go.mod @@ -2,20 +2,10 @@ module armapicenter go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armapicenter/go.sum b/packages/typespec-go/test/armapicenter/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armapicenter/go.sum +++ b/packages/typespec-go/test/armapicenter/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armapicenter/zz_apidefinitions_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_apidefinitions_client_example_test.go deleted file mode 100644 index 314c716cc..000000000 --- a/packages/typespec-go/test/armapicenter/zz_apidefinitions_client_example_test.go +++ /dev/null @@ -1,251 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_CreateOrUpdate.json -func ExampleAPIDefinitionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "openapi", "2023-01-01", "openapi", armapicenter.APIDefinition{ - Properties: &armapicenter.APIDefinitionProperties{ - Title: to.Ptr("OpenAPI"), - Description: to.Ptr("Default spec"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientCreateOrUpdateResponse{ - // APIDefinition: &armapicenter.APIDefinition{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // Name: to.Ptr("openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Title: to.Ptr("OpenAPI"), - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_Delete.json -func ExampleAPIDefinitionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_ExportSpecification.json -func ExampleAPIDefinitionsClient_BeginExportSpecification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIDefinitionsClient().BeginExportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientExportSpecificationResponse{ - // APISpecExportResult: &armapicenter.APISpecExportResult{ - // Format: to.Ptr(armapicenter.APISpecExportResultFormatInline), - // Value: to.Ptr("{ ... }"), - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_Get.json -func ExampleAPIDefinitionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientGetResponse{ - // APIDefinition: &armapicenter.APIDefinition{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // Name: to.Ptr("openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Title: to.Ptr("OpenAPI"), - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_Head.json -func ExampleAPIDefinitionsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_ImportSpecification.json -func ExampleAPIDefinitionsClient_BeginImportSpecification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIDefinitionsClient().BeginImportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", armapicenter.APISpecImportRequest{ - Format: to.Ptr(armapicenter.APISpecImportSourceFormatLink), - Value: to.Ptr("https://..."), - Specification: &armapicenter.APISpecImportRequestSpecification{ - Name: to.Ptr("openapi"), - Version: to.Ptr("3.0.1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIDefinitionsClientImportSpecificationResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiDefinitions_List.json -func ExampleAPIDefinitionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIDefinitionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.APIDefinitionsClientListResponse{ - // APIDefinitionListResult: armapicenter.APIDefinitionListResult{ - // Value: []*armapicenter.APIDefinition{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // Name: to.Ptr("openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Title: to.Ptr("OpenAPI"), - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_apis_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_apis_client_example_test.go deleted file mode 100644 index 0e38d921f..000000000 --- a/packages/typespec-go/test/armapicenter/zz_apis_client_example_test.go +++ /dev/null @@ -1,239 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/Apis_CreateOrUpdate.json -func ExampleApisClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", armapicenter.API{ - Properties: &armapicenter.APIProperties{ - Title: to.Ptr("Echo API"), - Description: to.Ptr("A simple HTTP request/response service."), - LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - Kind: to.Ptr(armapicenter.APIKindRest), - TermsOfService: &armapicenter.TermsOfService{ - URL: to.Ptr("https://contoso.com/terms-of-service"), - }, - License: &armapicenter.License{ - URL: to.Ptr("https://contoso.com/license"), - }, - ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - { - Title: to.Ptr("Onboarding docs"), - URL: to.Ptr("https://docs.contoso.com"), - }, - }, - CustomProperties: &armapicenter.CustomProperties{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ApisClientCreateOrUpdateResponse{ - // API: &armapicenter.API{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // Name: to.Ptr("echo-api"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Title: to.Ptr("Echo API"), - // Description: to.Ptr("A simple HTTP request/response service."), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // Kind: to.Ptr(armapicenter.APIKindRest), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }, - // }, - // CustomProperties: &armapicenter.CustomProperties{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Apis_Delete.json -func ExampleApisClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ApisClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Apis_Get.json -func ExampleApisClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ApisClientGetResponse{ - // API: &armapicenter.API{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Title: to.Ptr("Echo API"), - // Description: to.Ptr("A simple HTTP request/response service."), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // Kind: to.Ptr(armapicenter.APIKindRest), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }, - // }, - // CustomProperties: &armapicenter.CustomProperties{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Apis_Head.json -func ExampleApisClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ApisClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Apis_List.json -func ExampleApisClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApisClient().NewListPager("contoso-resources", "contoso", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.ApisClientListResponse{ - // APIListResult: armapicenter.APIListResult{ - // Value: []*armapicenter.API{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // Name: to.Ptr("echo-api"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Title: to.Ptr("Echo API"), - // Description: to.Ptr("A simple HTTP request/response service."), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // Kind: to.Ptr(armapicenter.APIKindRest), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }, - // }, - // CustomProperties: &armapicenter.CustomProperties{ - // }, - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_apiversions_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_apiversions_client_example_test.go deleted file mode 100644 index ee1a67bb6..000000000 --- a/packages/typespec-go/test/armapicenter/zz_apiversions_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/ApiVersions_CreateOrUpdate.json -func ExampleAPIVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", armapicenter.APIVersion{ - Properties: &armapicenter.APIVersionProperties{ - Title: to.Ptr("2023-01-01"), - LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIVersionsClientCreateOrUpdateResponse{ - // APIVersion: &armapicenter.APIVersion{ - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // Name: to.Ptr("2023-01-01"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // Title: to.Ptr("2023-01-01"), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiVersions_Delete.json -func ExampleAPIVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIVersionsClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiVersions_Get.json -func ExampleAPIVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIVersionsClientGetResponse{ - // APIVersion: &armapicenter.APIVersion{ - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // Name: to.Ptr("2023-01-01"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // Title: to.Ptr("2023-01-01"), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiVersions_Head.json -func ExampleAPIVersionsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.APIVersionsClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/ApiVersions_List.json -func ExampleAPIVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIVersionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.APIVersionsClientListResponse{ - // APIVersionListResult: armapicenter.APIVersionListResult{ - // Value: []*armapicenter.APIVersion{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // Title: to.Ptr("2023-01-01"), - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_deletedservices_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_deletedservices_client_example_test.go deleted file mode 100644 index a9b4f9da4..000000000 --- a/packages/typespec-go/test/armapicenter/zz_deletedservices_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/DeletedServices_Delete.json -func ExampleDeletedServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeletedServicesClient().Delete(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeletedServicesClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/DeletedServices_Get.json -func ExampleDeletedServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeletedServicesClient().Get(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeletedServicesClientGetResponse{ - // DeletedService: &armapicenter.DeletedService{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/deletedServices"), - // Properties: &armapicenter.DeletedServiceProperties{ - // SoftDeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T22:15:58.348Z"); return t}()), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-01T22:15:58.348Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/DeletedServices_ListBySubscription.json -func ExampleDeletedServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedServicesClient().NewListPager("contoso-resources", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.DeletedServicesClientListResponse{ - // DeletedServiceListResult: armapicenter.DeletedServiceListResult{ - // Value: []*armapicenter.DeletedService{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/deletedServices"), - // Properties: &armapicenter.DeletedServiceProperties{ - // SoftDeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T22:15:58.348Z"); return t}()), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-01T22:15:58.348Z"); return t}()), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-03-15-preview/DeletedServices_List.json -func ExampleDeletedServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedServicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.DeletedServicesClientListBySubscriptionResponse{ - // DeletedServiceListResult: armapicenter.DeletedServiceListResult{ - // Value: []*armapicenter.DeletedService{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/deletedServices"), - // Properties: &armapicenter.DeletedServiceProperties{ - // SoftDeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T22:15:58.348Z"); return t}()), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-05-01T22:15:58.348Z"); return t}()), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_deployments_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_deployments_client_example_test.go deleted file mode 100644 index 2dc78f185..000000000 --- a/packages/typespec-go/test/armapicenter/zz_deployments_client_example_test.go +++ /dev/null @@ -1,208 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/Deployments_CreateOrUpdate.json -func ExampleDeploymentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", armapicenter.Deployment{ - Properties: &armapicenter.DeploymentProperties{ - Title: to.Ptr("Production deployment"), - Description: to.Ptr("Public cloud production deployment."), - EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - State: to.Ptr(armapicenter.DeploymentStateActive), - Server: &armapicenter.DeploymentServer{ - RuntimeURI: []*string{ - to.Ptr("https://api.contoso.com"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeploymentsClientCreateOrUpdateResponse{ - // Deployment: &armapicenter.Deployment{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // Name: to.Ptr("production"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Title: to.Ptr("Production deployment"), - // Description: to.Ptr("Public cloud production deployment."), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Deployments_Delete.json -func ExampleDeploymentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeploymentsClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Deployments_Get.json -func ExampleDeploymentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeploymentsClientGetResponse{ - // Deployment: &armapicenter.Deployment{ - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Title: to.Ptr("Production deployment"), - // Description: to.Ptr("Public cloud production deployment."), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Deployments_Head.json -func ExampleDeploymentsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.DeploymentsClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Deployments_List.json -func ExampleDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeploymentsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.DeploymentsClientListResponse{ - // DeploymentListResult: armapicenter.DeploymentListResult{ - // Value: []*armapicenter.Deployment{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Title: to.Ptr("Development"), - // Description: to.Ptr("Public cloud production deployment."), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com"), - // }, - // }, - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_environments_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_environments_client_example_test.go deleted file mode 100644 index 3c7617e97..000000000 --- a/packages/typespec-go/test/armapicenter/zz_environments_client_example_test.go +++ /dev/null @@ -1,225 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/Environments_CreateOrUpdate.json -func ExampleEnvironmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "public", armapicenter.Environment{ - Properties: &armapicenter.EnvironmentProperties{ - Title: to.Ptr("Contoso Europe Azure API Management"), - Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), - Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - Server: &armapicenter.EnvironmentServer{ - Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - ManagementPortalURI: []*string{ - to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso"), - }, - }, - Onboarding: &armapicenter.Onboarding{ - Instructions: to.Ptr("Sign in or sign up in the specified developer portal to request API access. You must complete the internal privacy training for your account to be approved."), - DeveloperPortalURI: []*string{ - to.Ptr("https://developer.contoso.com"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.EnvironmentsClientCreateOrUpdateResponse{ - // Environment: &armapicenter.Environment{ - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/environments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // Title: to.Ptr("Contoso Europe Azure API Management"), - // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso"), - // }, - // }, - // Onboarding: &armapicenter.Onboarding{ - // Instructions: to.Ptr("Sign in or sign up in the specified developer portal to request API access. You must complete the internal privacy training for your account to be approved."), - // DeveloperPortalURI: []*string{ - // to.Ptr("https://developer.contoso.com"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Environments_Delete.json -func ExampleEnvironmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "public", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.EnvironmentsClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Environments_Get.json -func ExampleEnvironmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().Get(ctx, "contoso-resources", "contoso", "default", "public", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.EnvironmentsClientGetResponse{ - // Environment: &armapicenter.Environment{ - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // Title: to.Ptr("Public"), - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // }, - // }, - // Onboarding: &armapicenter.Onboarding{ - // DeveloperPortalURI: []*string{ - // }, - // }, - // CustomProperties: &armapicenter.CustomProperties{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Environments_Head.json -func ExampleEnvironmentsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().Head(ctx, "contoso-resources", "contoso", "default", "public", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.EnvironmentsClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Environments_List.json -func ExampleEnvironmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEnvironmentsClient().NewListPager("contoso-resources", "contoso", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.EnvironmentsClientListResponse{ - // EnvironmentListResult: armapicenter.EnvironmentListResult{ - // Value: []*armapicenter.Environment{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // Name: to.Ptr("public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // Title: to.Ptr("Contoso Europe Azure API Management"), - // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // }, - // }, - // Onboarding: &armapicenter.Onboarding{ - // DeveloperPortalURI: []*string{ - // }, - // }, - // CustomProperties: &armapicenter.CustomProperties{ - // }, - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_metadataschemas_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_metadataschemas_client_example_test.go deleted file mode 100644 index 2092b8343..000000000 --- a/packages/typespec-go/test/armapicenter/zz_metadataschemas_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/MetadataSchemas_CreateOrUpdate.json -func ExampleMetadataSchemasClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "author", armapicenter.MetadataSchema{ - Properties: &armapicenter.MetadataSchemaProperties{ - AssignedTo: []*armapicenter.MetadataAssignment{ - { - Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - Deprecated: to.Ptr(true), - }, - }, - Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.MetadataSchemasClientCreateOrUpdateResponse{ - // MetadataSchema: &armapicenter.MetadataSchema{ - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // Name: to.Ptr("author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // Deprecated: to.Ptr(true), - // }, - // }, - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/MetadataSchemas_Delete.json -func ExampleMetadataSchemasClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().Delete(ctx, "contoso-resources", "contoso", "author", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.MetadataSchemasClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/MetadataSchemas_Get.json -func ExampleMetadataSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().Get(ctx, "contoso-resources", "contoso", "lastName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.MetadataSchemasClientGetResponse{ - // MetadataSchema: &armapicenter.MetadataSchema{ - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // Name: to.Ptr("author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // Deprecated: to.Ptr(true), - // }, - // }, - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/MetadataSchemas_Head.json -func ExampleMetadataSchemasClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().Head(ctx, "contoso-resources", "contoso", "author", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.MetadataSchemasClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/MetadataSchemas_List.json -func ExampleMetadataSchemasClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMetadataSchemasClient().NewListPager("contoso-resources", "contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.MetadataSchemasClientListResponse{ - // MetadataSchemaListResult: armapicenter.MetadataSchemaListResult{ - // Value: []*armapicenter.MetadataSchema{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // Name: to.Ptr("author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // Deprecated: to.Ptr(true), - // }, - // }, - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_operations_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_operations_client_example_test.go deleted file mode 100644 index 49a2105ea..000000000 --- a/packages/typespec-go/test/armapicenter/zz_operations_client_example_test.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/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() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.OperationsClientListResponse{ - // OperationListResult: armapicenter.OperationListResult{ - // Value: []*armapicenter.Operation{ - // { - // Name: to.Ptr("Microsoft.ApiCenter/services/read"), - // IsDataAction: to.Ptr(false), - // Display: &armapicenter.OperationDisplay{ - // Provider: to.Ptr("Microsoft.ApiCenter"), - // Resource: to.Ptr("services"), - // Operation: to.Ptr("Lists services"), - // Description: to.Ptr("Lists registered services"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armapicenter/zz_services_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_services_client_example_test.go deleted file mode 100644 index 03672366e..000000000 --- a/packages/typespec-go/test/armapicenter/zz_services_client_example_test.go +++ /dev/null @@ -1,315 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/Services_CreateOrUpdate.json -func ExampleServicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", armapicenter.Service{ - Properties: &armapicenter.ServiceProperties{}, - Tags: map[string]*string{}, - Location: to.Ptr("East US"), - Identity: &armapicenter.ManagedServiceIdentity{ - UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ServicesClientCreateOrUpdateResponse{ - // Service: &armapicenter.Service{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // Name: to.Ptr("contoso"), - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East US"), - // Identity: &armapicenter.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Services_Delete.json -func ExampleServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Delete(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ServicesClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Services_ExportMetadataSchema.json -func ExampleServicesClient_BeginExportMetadataSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginExportMetadataSchema(ctx, "contoso-resources", "contoso", armapicenter.MetadataSchemaExportRequest{ - AssignedTo: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ServicesClientExportMetadataSchemaResponse{ - // MetadataSchemaExportResult: &armapicenter.MetadataSchemaExportResult{ - // Value: to.Ptr("{\"type\":\"object\",\"properties\":{ ... }}"), - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Services_Get.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ServicesClientGetResponse{ - // Service: &armapicenter.Service{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // Name: to.Ptr("contoso"), - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East US"), - // Identity: &armapicenter.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Services_ListByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("contoso-resources", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.ServicesClientListByResourceGroupResponse{ - // ServiceListResult: armapicenter.ServiceListResult{ - // Value: []*armapicenter.Service{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // Name: to.Ptr("contoso"), - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East US"), - // Identity: &armapicenter.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-03-15-preview/Services_ListBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.ServicesClientListBySubscriptionResponse{ - // ServiceListResult: armapicenter.ServiceListResult{ - // Value: []*armapicenter.Service{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // Name: to.Ptr("contoso"), - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East US"), - // Identity: &armapicenter.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-03-15-preview/Services_Update.json -func ExampleServicesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "contoso-resources", "contoso", armapicenter.Service{ - Tags: map[string]*string{}, - Identity: &armapicenter.ManagedServiceIdentity{ - UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.ServicesClientUpdateResponse{ - // Service: &armapicenter.Service{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // Name: to.Ptr("contoso"), - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East US"), - // Identity: &armapicenter.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // }, - // } -} diff --git a/packages/typespec-go/test/armapicenter/zz_workspaces_client_example_test.go b/packages/typespec-go/test/armapicenter/zz_workspaces_client_example_test.go deleted file mode 100644 index c2ad609fd..000000000 --- a/packages/typespec-go/test/armapicenter/zz_workspaces_client_example_test.go +++ /dev/null @@ -1,172 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armapicenter_test - -import ( - "armapicenter" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-15-preview/Workspaces_CreateOrUpdate.json -func ExampleWorkspacesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", armapicenter.Workspace{ - Properties: &armapicenter.WorkspaceProperties{ - Title: to.Ptr("default"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.WorkspacesClientCreateOrUpdateResponse{ - // Workspace: &armapicenter.Workspace{ - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // Name: to.Ptr("default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Workspaces_Delete.json -func ExampleWorkspacesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Delete(ctx, "contoso-resources", "contoso", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.WorkspacesClientDeleteResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Workspaces_Get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "contoso-resources", "contoso", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.WorkspacesClientGetResponse{ - // Workspace: &armapicenter.Workspace{ - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // Name: to.Ptr("default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-15-preview/Workspaces_Head.json -func ExampleWorkspacesClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Head(ctx, "contoso-resources", "contoso", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armapicenter.WorkspacesClientHeadResponse{ - // } -} - -// Generated from example definition: 2024-03-15-preview/Workspaces_List.json -func ExampleWorkspacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListPager("contoso-resources", "contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armapicenter.WorkspacesClientListResponse{ - // WorkspaceListResult: armapicenter.WorkspaceListResult{ - // Value: []*armapicenter.Workspace{ - // { - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // Name: to.Ptr("default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128871Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.1288716Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armcodesigning/go.mod b/packages/typespec-go/test/armcodesigning/go.mod index 434e9b5a9..139d98b8a 100644 --- a/packages/typespec-go/test/armcodesigning/go.mod +++ b/packages/typespec-go/test/armcodesigning/go.mod @@ -2,20 +2,10 @@ module armcodesigning go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armcodesigning/go.sum b/packages/typespec-go/test/armcodesigning/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armcodesigning/go.sum +++ b/packages/typespec-go/test/armcodesigning/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armcodesigning/zz_accounts_client_example_test.go b/packages/typespec-go/test/armcodesigning/zz_accounts_client_example_test.go deleted file mode 100644 index 0d8f8fac4..000000000 --- a/packages/typespec-go/test/armcodesigning/zz_accounts_client_example_test.go +++ /dev/null @@ -1,280 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armcodesigning_test - -import ( - "armcodesigning" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_CheckNameAvailability.json -func ExampleAccountsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().CheckNameAvailability(ctx, armcodesigning.CheckNameAvailability{ - Name: to.Ptr("sample-account"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.AccountsClientCheckNameAvailabilityResponse{ - // CheckNameAvailabilityResult: &armcodesigning.CheckNameAvailabilityResult{ - // NameAvailable: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_Create.json -func ExampleAccountsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginCreate(ctx, "MyResourceGroup", "MyAccount", armcodesigning.Account{ - Location: to.Ptr("westus"), - Properties: &armcodesigning.AccountProperties{ - SKU: &armcodesigning.AccountSKU{ - Name: to.Ptr(armcodesigning.SKUNameBasic), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.AccountsClientCreateResponse{ - // Account: &armcodesigning.Account{ - // Name: to.Ptr("MyAccount"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts"), - // ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount"), - // Location: to.Ptr("westus"), - // Properties: &armcodesigning.AccountProperties{ - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // SKU: &armcodesigning.AccountSKU{ - // Name: to.Ptr(armcodesigning.SKUNameBasic), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_Delete.json -func ExampleAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginDelete(ctx, "MyResourceGroup", "MyAccount", 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: 2024-02-05-preview/CodeSigningAccounts_Get.json -func ExampleAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Get(ctx, "MyResourceGroup", "MyAccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.AccountsClientGetResponse{ - // Account: &armcodesigning.Account{ - // Name: to.Ptr("MyAccount"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount"), - // Location: to.Ptr("westus"), - // Properties: &armcodesigning.AccountProperties{ - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // SKU: &armcodesigning.AccountSKU{ - // Name: to.Ptr(armcodesigning.SKUNameBasic), - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_ListByResourceGroup.json -func ExampleAccountsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListByResourceGroupPager("MyResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armcodesigning.AccountsClientListByResourceGroupResponse{ - // AccountListResult: armcodesigning.AccountListResult{ - // Value: []*armcodesigning.Account{ - // { - // Name: to.Ptr("alpha"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount"), - // Location: to.Ptr("westcentralus"), - // Properties: &armcodesigning.AccountProperties{ - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // SKU: &armcodesigning.AccountSKU{ - // Name: to.Ptr(armcodesigning.SKUNameBasic), - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_ListBySubscription.json -func ExampleAccountsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armcodesigning.AccountsClientListBySubscriptionResponse{ - // AccountListResult: armcodesigning.AccountListResult{ - // Value: []*armcodesigning.Account{ - // { - // Name: to.Ptr("alpha"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount"), - // Location: to.Ptr("westus"), - // Properties: &armcodesigning.AccountProperties{ - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // SKU: &armcodesigning.AccountSKU{ - // Name: to.Ptr(armcodesigning.SKUNameBasic), - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-02-05-preview/CodeSigningAccounts_Update.json -func ExampleAccountsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "MyResourceGroup", "MyAccount", armcodesigning.AccountPatch{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.AccountsClientUpdateResponse{ - // Account: &armcodesigning.Account{ - // Name: to.Ptr("MyAccount"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount"), - // Location: to.Ptr("westus"), - // Properties: &armcodesigning.AccountProperties{ - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // SKU: &armcodesigning.AccountSKU{ - // Name: to.Ptr(armcodesigning.SKUNameBasic), - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // }, - // } -} diff --git a/packages/typespec-go/test/armcodesigning/zz_certificateprofiles_client_example_test.go b/packages/typespec-go/test/armcodesigning/zz_certificateprofiles_client_example_test.go deleted file mode 100644 index 118905db9..000000000 --- a/packages/typespec-go/test/armcodesigning/zz_certificateprofiles_client_example_test.go +++ /dev/null @@ -1,246 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armcodesigning_test - -import ( - "armcodesigning" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" - "time" -) - -// Generated from example definition: 2024-02-05-preview/CertificateProfiles_Create.json -func ExampleCertificateProfilesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateProfilesClient().BeginCreate(ctx, "MyResourceGroup", "MyAccount", "profileA", armcodesigning.CertificateProfile{ - Properties: &armcodesigning.CertificateProfileProperties{ - ProfileType: to.Ptr(armcodesigning.ProfileTypePublicTrust), - IdentityValidationID: to.Ptr("00000000-1234-5678-3333-444444444444"), - IncludePostalCode: to.Ptr(true), - IncludeStreetAddress: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.CertificateProfilesClientCreateResponse{ - // CertificateProfile: &armcodesigning.CertificateProfile{ - // Name: to.Ptr("profileA"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/certificateProfiles"), - // ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA"), - // Properties: &armcodesigning.CertificateProfileProperties{ - // Certificates: []*armcodesigning.Certificate{ - // { - // CreatedDate: to.Ptr("3/14/2023 5:27:49 PM"), - // ExpiryDate: to.Ptr("3/17/2023 5:27:49 PM"), - // SerialNumber: to.Ptr("xxxxxxxxxxxxxxxxxx"), - // Status: to.Ptr(armcodesigning.CertificateStatusActive), - // SubjectName: to.Ptr("CN=Contoso Inc, O=Contoso Inc, L=New York, S=New York, C=US"), - // Thumbprint: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // }, - // }, - // City: to.Ptr("Dallas"), - // CommonName: to.Ptr("Contoso Inc"), - // Country: to.Ptr("US"), - // EnhancedKeyUsage: to.Ptr("1.3.6.1.4.1.311.yy.xxxxxxxx.xxxxxxxx.xxxxxxxxx.xxxxxxxx"), - // IdentityValidationID: to.Ptr("00000000-1234-5678-3333-444444444444"), - // IncludeCity: to.Ptr(false), - // IncludeCountry: to.Ptr(false), - // IncludePostalCode: to.Ptr(true), - // IncludeState: to.Ptr(false), - // IncludeStreetAddress: to.Ptr(false), - // Organization: to.Ptr("Contoso Inc"), - // PostalCode: to.Ptr("560090"), - // ProfileType: to.Ptr(armcodesigning.ProfileTypePublicTrust), - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // State: to.Ptr("Texas"), - // Status: to.Ptr(armcodesigning.CertificateProfileStatusActive), - // StreetAddress: to.Ptr("123 Bluebonnet"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-02-05-preview/CertificateProfiles_Delete.json -func ExampleCertificateProfilesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateProfilesClient().BeginDelete(ctx, "MyResourceGroup", "MyAccount", "profileA", 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: 2024-02-05-preview/CertificateProfiles_Get.json -func ExampleCertificateProfilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateProfilesClient().Get(ctx, "MyResourceGroup", "MyAccount", "profileA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armcodesigning.CertificateProfilesClientGetResponse{ - // CertificateProfile: &armcodesigning.CertificateProfile{ - // Name: to.Ptr("profileA"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/certificateProfiles"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA"), - // Properties: &armcodesigning.CertificateProfileProperties{ - // Certificates: []*armcodesigning.Certificate{ - // { - // CreatedDate: to.Ptr("3/14/2023 5:27:49 PM"), - // ExpiryDate: to.Ptr("3/17/2023 5:27:49 PM"), - // SerialNumber: to.Ptr("xxxxxxxxxxxxxxxxxx"), - // Status: to.Ptr(armcodesigning.CertificateStatusActive), - // SubjectName: to.Ptr("CN=Contoso Inc, O=Contoso Inc, L=New York, S=New York, C=US"), - // Thumbprint: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // }, - // }, - // City: to.Ptr("Dallas"), - // CommonName: to.Ptr("Contoso Inc"), - // Country: to.Ptr("US"), - // EnhancedKeyUsage: to.Ptr("1.3.6.1.4.1.311.yy.xxxxxxxx.xxxxxxxx.xxxxxxxxx.xxxxxxxx"), - // IdentityValidationID: to.Ptr("123456"), - // IncludeCity: to.Ptr(false), - // IncludeCountry: to.Ptr(false), - // IncludePostalCode: to.Ptr(true), - // IncludeState: to.Ptr(false), - // IncludeStreetAddress: to.Ptr(false), - // Organization: to.Ptr("Contoso Inc"), - // PostalCode: to.Ptr("560090"), - // ProfileType: to.Ptr(armcodesigning.ProfileTypePublicTrust), - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // State: to.Ptr("Texas"), - // Status: to.Ptr(armcodesigning.CertificateProfileStatusActive), - // StreetAddress: to.Ptr("123 Bluebonnet"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-02-05-preview/CertificateProfiles_ListByCodeSigningAccount.json -func ExampleCertificateProfilesClient_NewListByCodeSigningAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateProfilesClient().NewListByCodeSigningAccountPager("MyResourceGroup", "MyAccount", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armcodesigning.CertificateProfilesClientListByCodeSigningAccountResponse{ - // CertificateProfileListResult: armcodesigning.CertificateProfileListResult{ - // Value: []*armcodesigning.CertificateProfile{ - // { - // Name: to.Ptr("profileA"), - // Type: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/certificateProfiles"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.CodeSigning/codeSigningAccounts/profileA"), - // Properties: &armcodesigning.CertificateProfileProperties{ - // Certificates: []*armcodesigning.Certificate{ - // { - // CreatedDate: to.Ptr("3/14/2023 5:27:49 PM"), - // ExpiryDate: to.Ptr("3/17/2023 5:27:49 PM"), - // SerialNumber: to.Ptr("xxxxxxxxxxxxxxxxxx"), - // Status: to.Ptr(armcodesigning.CertificateStatusActive), - // SubjectName: to.Ptr("CN=Contoso Inc, O=Contoso Inc, L=New York, S=New York, C=US"), - // Thumbprint: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // }, - // }, - // City: to.Ptr("Dallas"), - // CommonName: to.Ptr("Microsoft Corporation"), - // Country: to.Ptr("US"), - // EnhancedKeyUsage: to.Ptr("1.3.6.1.4.1.311.yy.xxxxxxxx.xxxxxxxx.xxxxxxxxx.xxxxxxxx"), - // IdentityValidationID: to.Ptr("123456"), - // IncludeCity: to.Ptr(false), - // IncludeCountry: to.Ptr(false), - // IncludePostalCode: to.Ptr(true), - // IncludeState: to.Ptr(false), - // IncludeStreetAddress: to.Ptr(false), - // Organization: to.Ptr("Microsoft Corporation"), - // PostalCode: to.Ptr("560090"), - // ProfileType: to.Ptr(armcodesigning.ProfileTypePublicTrust), - // ProvisioningState: to.Ptr(armcodesigning.ProvisioningStateSucceeded), - // State: to.Ptr("Texas"), - // Status: to.Ptr(armcodesigning.CertificateProfileStatusActive), - // StreetAddress: to.Ptr("123 Bluebonnet"), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-02-05-preview/CertificateProfiles_RevokeCertificate.json -func ExampleCertificateProfilesClient_RevokeCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcodesigning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCertificateProfilesClient().RevokeCertificate(ctx, "MyResourceGroup", "MyAccount", "profileA", armcodesigning.RevokeCertificate{ - EffectiveAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-12T23:40:25+00:00"); return t }()), - Reason: to.Ptr("KeyCompromised"), - Remarks: to.Ptr("test"), - SerialNumber: to.Ptr("xxxxxxxxxxxxxxxxxx"), - Thumbprint: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/packages/typespec-go/test/armcodesigning/zz_operations_client_example_test.go b/packages/typespec-go/test/armcodesigning/zz_operations_client_example_test.go deleted file mode 100644 index 72eae2ce1..000000000 --- a/packages/typespec-go/test/armcodesigning/zz_operations_client_example_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armcodesigning_test - -import ( - "armcodesigning" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-02-05-preview/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() - clientFactory, err := armcodesigning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armcodesigning.OperationsClientListResponse{ - // OperationListResult: armcodesigning.OperationListResult{ - // Value: []*armcodesigning.Operation{ - // { - // Name: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/write"), - // Display: &armcodesigning.OperationDisplay{ - // Provider: to.Ptr("Microsoft.CodeSigning"), - // Resource: to.Ptr("codeSigningAccounts"), - // Operation: to.Ptr("Create CodeSigningAccount"), - // Description: to.Ptr("Create any CodeSigningAccount"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/read"), - // Display: &armcodesigning.OperationDisplay{ - // Provider: to.Ptr("Microsoft.CodeSigning"), - // Resource: to.Ptr("codeSigningAccounts"), - // Operation: to.Ptr("Get CodeSigningAccount"), - // Description: to.Ptr("Get any CodeSigningAccount"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.CodeSigning/codeSigningAccounts/delete"), - // Display: &armcodesigning.OperationDisplay{ - // Provider: to.Ptr("Microsoft.CodeSigning"), - // Resource: to.Ptr("codeSigningAccounts"), - // Operation: to.Ptr("Delete CodeSigningAccount"), - // Description: to.Ptr("Delete any CodeSigningAccount"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armdatabasewatcher/go.mod b/packages/typespec-go/test/armdatabasewatcher/go.mod index 8ccbd0c61..4e836a5f9 100644 --- a/packages/typespec-go/test/armdatabasewatcher/go.mod +++ b/packages/typespec-go/test/armdatabasewatcher/go.mod @@ -2,20 +2,10 @@ module armdatabasewatcher go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armdatabasewatcher/go.sum b/packages/typespec-go/test/armdatabasewatcher/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armdatabasewatcher/go.sum +++ b/packages/typespec-go/test/armdatabasewatcher/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armdatabasewatcher/zz_operations_client_example_test.go b/packages/typespec-go/test/armdatabasewatcher/zz_operations_client_example_test.go deleted file mode 100644 index 01c35a1ca..000000000 --- a/packages/typespec-go/test/armdatabasewatcher/zz_operations_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armdatabasewatcher_test - -import ( - "armdatabasewatcher" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2023-09-01-preview/Operations_List_200.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armdatabasewatcher.OperationsClientListResponse{ - // OperationListResult: armdatabasewatcher.OperationListResult{ - // Value: []*armdatabasewatcher.Operation{ - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armdatabasewatcher/zz_sharedprivatelinkresources_client_example_test.go b/packages/typespec-go/test/armdatabasewatcher/zz_sharedprivatelinkresources_client_example_test.go deleted file mode 100644 index 6a8e3ea0b..000000000 --- a/packages/typespec-go/test/armdatabasewatcher/zz_sharedprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armdatabasewatcher_test - -import ( - "armdatabasewatcher" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2023-09-01-preview/SharedPrivateLinkResources_Create_200.json -func ExampleSharedPrivateLinkResourcesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginCreate(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", armdatabasewatcher.SharedPrivateLinkResource{ - Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{ - PrivateLinkResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), - GroupID: to.Ptr("vault"), - RequestMessage: to.Ptr("request message"), - DNSZone: to.Ptr("ec3ae9d410ba"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse{ - // SharedPrivateLinkResource: &armdatabasewatcher.SharedPrivateLinkResource{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"), - // Name: to.Ptr("monitoringh22eed"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"), - // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{ - // PrivateLinkResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), - // GroupID: to.Ptr("vault"), - // RequestMessage: to.Ptr("request message"), - // DNSZone: to.Ptr("ec3ae9d410ba"), - // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/SharedPrivateLinkResources_Delete_200.json -func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", 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: 2023-09-01-preview/SharedPrivateLinkResources_Get_200.json -func ExampleSharedPrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.SharedPrivateLinkResourcesClientGetResponse{ - // SharedPrivateLinkResource: &armdatabasewatcher.SharedPrivateLinkResource{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"), - // Name: to.Ptr("monitoringh22eed"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"), - // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{ - // PrivateLinkResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), - // GroupID: to.Ptr("vault"), - // RequestMessage: to.Ptr("request message"), - // DNSZone: to.Ptr("ec3ae9d410ba"), - // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/SharedPrivateLinkResources_ListByWatcher_200.json -func ExampleSharedPrivateLinkResourcesClient_NewListByWatcherPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedPrivateLinkResourcesClient().NewListByWatcherPager("apiTest-ddat4p", "databasemo3ej9ih", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armdatabasewatcher.SharedPrivateLinkResourcesClientListByWatcherResponse{ - // SharedPrivateLinkResourceListResult: armdatabasewatcher.SharedPrivateLinkResourceListResult{ - // Value: []*armdatabasewatcher.SharedPrivateLinkResource{ - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/sharedPrivateLinkResources/monitoringh22eed"), - // Name: to.Ptr("monitoringh22eed"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/sharedPrivateLinkResources"), - // Properties: &armdatabasewatcher.SharedPrivateLinkResourceProperties{ - // PrivateLinkResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.KeyVault/vaults/kvmo3ej9ih"), - // GroupID: to.Ptr("vault"), - // RequestMessage: to.Ptr("request message"), - // DNSZone: to.Ptr("ec3ae9d410ba"), - // Status: to.Ptr(armdatabasewatcher.SharedPrivateLinkResourceStatusPending), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armdatabasewatcher/zz_targets_client_example_test.go b/packages/typespec-go/test/armdatabasewatcher/zz_targets_client_example_test.go deleted file mode 100644 index 74a25178b..000000000 --- a/packages/typespec-go/test/armdatabasewatcher/zz_targets_client_example_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armdatabasewatcher_test - -import ( - "armdatabasewatcher" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2023-09-01-preview/Targets_CreateOrUpdate_200.json -func ExampleTargetsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTargetsClient().CreateOrUpdate(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", armdatabasewatcher.Target{ - Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{ - TargetType: to.Ptr("SqlDb"), - TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD), - ConnectionServerName: to.Ptr("sqlServero1ihe2"), - SQLDbResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.TargetsClientCreateOrUpdateResponse{ - // Target: &armdatabasewatcher.Target{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/targets/monitoringh22eed"), - // Name: to.Ptr("monitoringh22eed"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"), - // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{ - // TargetType: to.Ptr("SqlDb"), - // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD), - // ConnectionServerName: to.Ptr("sqlServero1ihe2"), - // SQLDbResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Targets_Delete_200.json -func ExampleTargetsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTargetsClient().Delete(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.TargetsClientDeleteResponse{ - // } -} - -// Generated from example definition: 2023-09-01-preview/Targets_Get_200.json -func ExampleTargetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTargetsClient().Get(ctx, "apiTest-ddat4p", "databasemo3ej9ih", "monitoringh22eed", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.TargetsClientGetResponse{ - // Target: &armdatabasewatcher.Target{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/targets/monitoringh22eed"), - // Name: to.Ptr("monitoringh22eed"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"), - // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{ - // TargetType: to.Ptr("SqlDb"), - // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD), - // ConnectionServerName: to.Ptr("sqlServero1ihe2"), - // SQLDbResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Targets_ListByWatcher_200.json -func ExampleTargetsClient_NewListByWatcherPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTargetsClient().NewListByWatcherPager("apiTest-ddat4p", "databasemo3ej9ih", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armdatabasewatcher.TargetsClientListByWatcherResponse{ - // TargetListResult: armdatabasewatcher.TargetListResult{ - // Value: []*armdatabasewatcher.Target{ - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-px9ma7/providers/Microsoft.DatabaseWatcher/watchers/databasemo3d9sgt/targets/monitoringzkndgm"), - // Name: to.Ptr("monitoringzkndgm"), - // Type: to.Ptr("microsoft.databasewatcher/watchers/targets"), - // Properties: &armdatabasewatcher.SQLDbSingleDatabaseTargetProperties{ - // TargetType: to.Ptr("SqlDb"), - // TargetAuthenticationType: to.Ptr(armdatabasewatcher.TargetAuthenticationTypeAAD), - // ConnectionServerName: to.Ptr("sqlServero1ihe2"), - // SQLDbResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armdatabasewatcher/zz_watchers_client_example_test.go b/packages/typespec-go/test/armdatabasewatcher/zz_watchers_client_example_test.go deleted file mode 100644 index 598b6460b..000000000 --- a/packages/typespec-go/test/armdatabasewatcher/zz_watchers_client_example_test.go +++ /dev/null @@ -1,377 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armdatabasewatcher_test - -import ( - "armdatabasewatcher" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2023-09-01-preview/Watchers_CreateOrUpdate_200.json -func ExampleWatchersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginCreateOrUpdate(ctx, "apiTest-ddat4p", "databasemo3ej9ih", armdatabasewatcher.Watcher{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.WatchersClientCreateOrUpdateResponse{ - // Watcher: &armdatabasewatcher.Watcher{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_Delete_200.json -func ExampleWatchersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginDelete(ctx, "apiTest-ddat4p", "databasemo3ej9ih", 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: 2023-09-01-preview/Watchers_Get_200.json -func ExampleWatchersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWatchersClient().Get(ctx, "apiTest-ddat4p", "databasemo3ej9ih", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.WatchersClientGetResponse{ - // Watcher: &armdatabasewatcher.Watcher{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_ListByResourceGroup_200.json -func ExampleWatchersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWatchersClient().NewListByResourceGroupPager("apiTest-ddat4p", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armdatabasewatcher.WatchersClientListByResourceGroupResponse{ - // WatcherListResult: armdatabasewatcher.WatcherListResult{ - // Value: []*armdatabasewatcher.Watcher{ - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_ListBySubscription_200.json -func ExampleWatchersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWatchersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armdatabasewatcher.WatchersClientListBySubscriptionResponse{ - // WatcherListResult: armdatabasewatcher.WatcherListResult{ - // Value: []*armdatabasewatcher.Watcher{ - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/dummyrg/providers/Microsoft.DatabaseWatcher/watchers/myWatcher"), - // Name: to.Ptr("myWatcher"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Identity: &armdatabasewatcher.ManagedServiceIdentity{ - // Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned), - // }, - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-4sz1jg/providers/Microsoft.DatabaseWatcher/watchers/databasemo4o4zdf"), - // Name: to.Ptr("databasemo4o4zdf"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-d77ftn/providers/Microsoft.DatabaseWatcher/watchers/databasemosn3h6l"), - // Name: to.Ptr("databasemosn3h6l"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-nyb4gm/providers/Microsoft.DatabaseWatcher/watchers/databasemoyb6iar"), - // Name: to.Ptr("databasemoyb6iar"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-llis4j/providers/Microsoft.DatabaseWatcher/watchers/databasemoi04xst"), - // Name: to.Ptr("databasemoi04xst"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-thy6zd/providers/Microsoft.DatabaseWatcher/watchers/databasemonpyl24"), - // Name: to.Ptr("databasemonpyl24"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // SystemData: &armdatabasewatcher.SystemData{ - // }, - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_Start_200.json -func ExampleWatchersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginStart(ctx, "apiTest-ddat4p", "databasemo3ej9ih", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.WatchersClientStartResponse{ - // Watcher: &armdatabasewatcher.Watcher{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_Stop_200.json -func ExampleWatchersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginStop(ctx, "apiTest-ddat4p", "databasemo3ej9ih", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.WatchersClientStopResponse{ - // Watcher: &armdatabasewatcher.Watcher{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih"), - // Name: to.Ptr("databasemo3ej9ih"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // }, - // }, - // } -} - -// Generated from example definition: 2023-09-01-preview/Watchers_Update_200.json -func ExampleWatchersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabasewatcher.NewClientFactory("6f53185c-ea09-4fc3-9075-318dec805303", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginUpdate(ctx, "apiTest-lzect6", "databasemohkp6fn", armdatabasewatcher.Watcher{ - Identity: &armdatabasewatcher.ManagedServiceIdentity{ - Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned), - }, - Properties: &armdatabasewatcher.WatcherProperties{ - Datastore: &armdatabasewatcher.Datastore{ - AdxClusterResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"), - KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"), - KustoClusterDisplayName: to.Ptr("kustoUri-adx"), - KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"), - KustoDatabaseName: to.Ptr("kustoDatabaseName1"), - KustoManagementURL: to.Ptr("https://portal.azure.com/"), - KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdatabasewatcher.WatchersClientUpdateResponse{ - // Watcher: &armdatabasewatcher.Watcher{ - // ID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest-lzect6/providers/Microsoft.DatabaseWatcher/watchers/databasemohkp6fn"), - // Name: to.Ptr("databasemohkp6fn"), - // Type: to.Ptr("microsoft.databasewatcher/watchers"), - // Location: to.Ptr("westus"), - // SystemData: &armdatabasewatcher.SystemData{ - // }, - // Identity: &armdatabasewatcher.ManagedServiceIdentity{ - // Type: to.Ptr(armdatabasewatcher.ManagedServiceIdentityTypeSystemAssigned), - // }, - // Properties: &armdatabasewatcher.WatcherProperties{ - // ProvisioningState: to.Ptr(armdatabasewatcher.DatabaseWatcherProvisioningStateSucceeded), - // Datastore: &armdatabasewatcher.Datastore{ - // AdxClusterResourceID: to.Ptr("/subscriptions/6f53185c-ea09-4fc3-9075-318dec805303/resourceGroups/apiTest/providers/Microsoft.Kusto/clusters/apiTestKusto"), - // KustoClusterURI: to.Ptr("https://kustouri-adx.eastus.kusto.windows.net"), - // KustoClusterDisplayName: to.Ptr("kustoUri-adx"), - // KustoDataIngestionURI: to.Ptr("https://ingest-kustouri-adx.eastus.kusto.windows.net"), - // KustoDatabaseName: to.Ptr("kustoDatabaseName1"), - // KustoManagementURL: to.Ptr("https://portal.azure.com/"), - // KustoOfferingType: to.Ptr(armdatabasewatcher.KustoOfferingTypeAdx), - // }, - // }, - // }, - // } -} diff --git a/packages/typespec-go/test/armlargeinstance/go.mod b/packages/typespec-go/test/armlargeinstance/go.mod index 70be79137..c1efb047d 100644 --- a/packages/typespec-go/test/armlargeinstance/go.mod +++ b/packages/typespec-go/test/armlargeinstance/go.mod @@ -2,20 +2,10 @@ module armlargeinstance go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armlargeinstance/go.sum b/packages/typespec-go/test/armlargeinstance/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armlargeinstance/go.sum +++ b/packages/typespec-go/test/armlargeinstance/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armlargeinstance/zz_operations_client_example_test.go b/packages/typespec-go/test/armlargeinstance/zz_operations_client_example_test.go deleted file mode 100644 index 0815b4725..000000000 --- a/packages/typespec-go/test/armlargeinstance/zz_operations_client_example_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armlargeinstance_test - -import ( - "armlargeinstance" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2023-07-20-preview/AzureLargeInstanceOperations_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() - clientFactory, err := armlargeinstance.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armlargeinstance.OperationsClientListResponse{ - // OperationListResult: armlargeinstance.OperationListResult{ - // Value: []*armlargeinstance.Operation{ - // { - // Name: to.Ptr("Microsoft.AzureLargeInstance/read"), - // Display: &armlargeinstance.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Large Instance"), - // Resource: to.Ptr("AzureLargeInstance"), - // Operation: to.Ptr("Read AzureLargeInstance"), - // Description: to.Ptr("Read any AzureLargeInstance"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureLargeInstance"), - // Display: &armlargeinstance.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Large Instance"), - // Resource: to.Ptr("AzureLargeInstance"), - // Operation: to.Ptr("Start AzureLargeInstance"), - // Description: to.Ptr("Start any AzureLargeInstance"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armloadtestservice/go.mod b/packages/typespec-go/test/armloadtestservice/go.mod index d02f5db72..23282dcce 100644 --- a/packages/typespec-go/test/armloadtestservice/go.mod +++ b/packages/typespec-go/test/armloadtestservice/go.mod @@ -2,20 +2,10 @@ module armloadtestservice go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armloadtestservice/go.sum b/packages/typespec-go/test/armloadtestservice/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armloadtestservice/go.sum +++ b/packages/typespec-go/test/armloadtestservice/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armloadtestservice/zz_loadtests_client_example_test.go b/packages/typespec-go/test/armloadtestservice/zz_loadtests_client_example_test.go deleted file mode 100644 index 48551555c..000000000 --- a/packages/typespec-go/test/armloadtestservice/zz_loadtests_client_example_test.go +++ /dev/null @@ -1,482 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armloadtestservice_test - -import ( - "armloadtestservice" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2022-12-01/LoadTests_CreateOrUpdate.json -func ExampleLoadTestsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadTestsClient().BeginCreateOrUpdate(ctx, "dummyrg", "myLoadTest", armloadtestservice.LoadTestResource{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "Team": to.Ptr("Dev Exp"), - }, - Identity: &armloadtestservice.ManagedServiceIdentity{ - Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAndUserAssigned), - UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtestservice.UserAssignedIdentity{}, - }, - }, - Properties: &armloadtestservice.LoadTestProperties{ - Description: to.Ptr("This is new load test resource"), - Encryption: &armloadtestservice.EncryptionProperties{ - Identity: &armloadtestservice.EncryptionPropertiesIdentity{ - Type: to.Ptr(armloadtestservice.TypeUserAssigned), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armloadtestservice.LoadTestsClientCreateOrUpdateResponse{ - // LoadTestResource: &armloadtestservice.LoadTestResource{ - // Location: to.Ptr("westus"), - // Identity: &armloadtestservice.ManagedServiceIdentity{ - // Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAndUserAssigned), - // PrincipalID: to.Ptr("12345678-1234-1234-1234-123456789012"), - // TenantID: to.Ptr("12345678-1234-1234-4321-123456789012"), - // UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtestservice.UserAssignedIdentity{ - // PrincipalID: to.Ptr("12345678-1234-4321-1234-123456789012"), - // ClientID: to.Ptr("12345678-4321-1234-1234-123456789012"), - // }, - // }, - // }, - // Properties: &armloadtestservice.LoadTestProperties{ - // Description: to.Ptr("This is new load test resource"), - // DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"), - // ProvisioningState: to.Ptr(armloadtestservice.ResourceStateSucceeded), - // Encryption: &armloadtestservice.EncryptionProperties{ - // Identity: &armloadtestservice.EncryptionPropertiesIdentity{ - // Type: to.Ptr(armloadtestservice.TypeUserAssigned), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - // }, - // KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"), - // }, - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"), - // Name: to.Ptr("myLoadTest"), - // Type: to.Ptr("Microsoft.LoadTestService/loadTests"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // SystemData: &armloadtestservice.SystemData{ - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: 2022-12-01/LoadTests_Delete.json -func ExampleLoadTestsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadTestsClient().BeginDelete(ctx, "dummyrg", "myLoadTest", 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: 2022-12-01/LoadTests_Get.json -func ExampleLoadTestsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadTestsClient().Get(ctx, "dummyrg", "myLoadTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armloadtestservice.LoadTestsClientGetResponse{ - // LoadTestResource: &armloadtestservice.LoadTestResource{ - // Location: to.Ptr("westus"), - // Properties: &armloadtestservice.LoadTestProperties{ - // Description: to.Ptr("This is new load test resource"), - // DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"), - // ProvisioningState: to.Ptr(armloadtestservice.ResourceStateSucceeded), - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"), - // Name: to.Ptr("myLoadTest"), - // Type: to.Ptr("Microsoft.LoadTestService/loadTests"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // SystemData: &armloadtestservice.SystemData{ - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: 2022-12-01/LoadTests_ListByResourceGroup.json -func ExampleLoadTestsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadTestsClient().NewListByResourceGroupPager("dummyrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armloadtestservice.LoadTestsClientListByResourceGroupResponse{ - // LoadTestResourceListResult: armloadtestservice.LoadTestResourceListResult{ - // Value: []*armloadtestservice.LoadTestResource{ - // { - // Location: to.Ptr("westus"), - // Properties: &armloadtestservice.LoadTestProperties{ - // Description: to.Ptr("This is new load test resource"), - // DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"), - // ProvisioningState: to.Ptr(armloadtestservice.ResourceStateSucceeded), - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"), - // Name: to.Ptr("myLoadTest"), - // Type: to.Ptr("Microsoft.LoadTestService/loadTests"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // SystemData: &armloadtestservice.SystemData{ - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2022-12-01/LoadTests_ListBySubscription.json -func ExampleLoadTestsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadTestsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armloadtestservice.LoadTestsClientListBySubscriptionResponse{ - // LoadTestResourceListResult: armloadtestservice.LoadTestResourceListResult{ - // Value: []*armloadtestservice.LoadTestResource{ - // { - // Location: to.Ptr("westus"), - // Properties: &armloadtestservice.LoadTestProperties{ - // Description: to.Ptr("This is new load test resource"), - // DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"), - // ProvisioningState: to.Ptr(armloadtestservice.ResourceStateSucceeded), - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"), - // Name: to.Ptr("myLoadTest"), - // Type: to.Ptr("Microsoft.LoadTestService/loadTests"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // SystemData: &armloadtestservice.SystemData{ - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2022-12-01/LoadTests_ListOutboundNetworkDependenciesEndpoints.json -func ExampleLoadTestsClient_NewOutboundNetworkDependenciesEndpointsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadTestsClient().NewOutboundNetworkDependenciesEndpointsPager("default-azureloadtest-japaneast", "sampleloadtest", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armloadtestservice.LoadTestsClientOutboundNetworkDependenciesEndpointsResponse{ - // OutboundEnvironmentEndpointCollection: armloadtestservice.OutboundEnvironmentEndpointCollection{ - // Value: []*armloadtestservice.OutboundEnvironmentEndpoint{ - // { - // Category: to.Ptr("Azure Batch"), - // Endpoints: []*armloadtestservice.EndpointDependency{ - // { - // DomainName: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // Description: to.Ptr("Applicable to job manager tasks, tasks that use job scoped authentication, or any task that makes calls to Batch."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // { - // DomainName: to.Ptr("japaneast.service.batch.azure.com"), - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // }, - // }, - // { - // Category: to.Ptr("Azure Storage"), - // Endpoints: []*armloadtestservice.EndpointDependency{ - // { - // DomainName: to.Ptr("autostorageaccountname.blob.core.windows.net"), - // Description: to.Ptr("AutoStorage endpoint for this Batch account. Applicable to all Azure Batch pools under this account."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // { - // DomainName: to.Ptr("*.blob.core.windows.net"), - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // { - // DomainName: to.Ptr("*.table.core.windows.net"), - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // { - // DomainName: to.Ptr("*.queue.core.windows.net"), - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // }, - // }, - // { - // Category: to.Ptr("Microsoft Package Repository"), - // Endpoints: []*armloadtestservice.EndpointDependency{ - // { - // DomainName: to.Ptr("packages.microsoft.com"), - // Description: to.Ptr("Only applicable to pools containing a Mount Configuration. Learn about Mount Configurations in Batch at https://docs.microsoft.com/azure/batch/virtual-file-mount."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // }, - // }, - // { - // Category: to.Ptr("Azure Key Vault"), - // Endpoints: []*armloadtestservice.EndpointDependency{ - // { - // DomainName: to.Ptr("*.vault.azure.net"), - // Description: to.Ptr("Only applicable to pools containing a Disk Encryption Configuration and whose VM size does not support encryption at host. Learn more about disk encryption in Azure Batch at https://docs.microsoft.com/azure/batch/disk-encryption. Learn more about encryption at host and supported VM sizes at https://docs.microsoft.com/azure/virtual-machines/disks-enable-host-based-encryption-portal."), - // EndpointDetails: []*armloadtestservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }, - // }, - // }, - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2022-12-01/LoadTests_Update.json -func ExampleLoadTestsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadTestsClient().BeginUpdate(ctx, "dummyrg", "myLoadTest", armloadtestservice.LoadTestResource{ - Tags: map[string]*string{ - "Team": to.Ptr("Dev Exp"), - "Division": to.Ptr("LT"), - }, - Identity: &armloadtestservice.ManagedServiceIdentity{ - Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAndUserAssigned), - UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtestservice.UserAssignedIdentity{}, - }, - }, - Properties: &armloadtestservice.LoadTestProperties{ - Description: to.Ptr("This is new load test resource"), - Encryption: &armloadtestservice.EncryptionProperties{ - Identity: &armloadtestservice.EncryptionPropertiesIdentity{ - Type: to.Ptr(armloadtestservice.TypeSystemAssigned), - ResourceID: nil, - }, - KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armloadtestservice.LoadTestsClientUpdateResponse{ - // LoadTestResource: &armloadtestservice.LoadTestResource{ - // Location: to.Ptr("westus"), - // Identity: &armloadtestservice.ManagedServiceIdentity{ - // Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAndUserAssigned), - // PrincipalID: to.Ptr("12345678-1234-1234-1234-123456789012"), - // TenantID: to.Ptr("12345678-1234-1234-4321-123456789012"), - // UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtestservice.UserAssignedIdentity{ - // PrincipalID: to.Ptr("12345678-1234-4321-1234-123456789012"), - // ClientID: to.Ptr("12345678-4321-1234-1234-123456789012"), - // }, - // }, - // }, - // Properties: &armloadtestservice.LoadTestProperties{ - // Description: to.Ptr("This is new load test resource"), - // DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"), - // ProvisioningState: to.Ptr(armloadtestservice.ResourceStateSucceeded), - // Encryption: &armloadtestservice.EncryptionProperties{ - // Identity: &armloadtestservice.EncryptionPropertiesIdentity{ - // Type: to.Ptr(armloadtestservice.TypeSystemAssigned), - // ResourceID: nil, - // }, - // KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"), - // }, - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"), - // Name: to.Ptr("myLoadTest"), - // Type: to.Ptr("Microsoft.LoadTestService/loadTests"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // "Division": to.Ptr("LT"), - // }, - // SystemData: &armloadtestservice.SystemData{ - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armloadtestservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33Z"); return t}()), - // }, - // }, - // } -} diff --git a/packages/typespec-go/test/armloadtestservice/zz_operations_client_example_test.go b/packages/typespec-go/test/armloadtestservice/zz_operations_client_example_test.go deleted file mode 100644 index 019450502..000000000 --- a/packages/typespec-go/test/armloadtestservice/zz_operations_client_example_test.go +++ /dev/null @@ -1,73 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armloadtestservice_test - -import ( - "armloadtestservice" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2022-12-01/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() - clientFactory, err := armloadtestservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armloadtestservice.OperationsClientListResponse{ - // OperationListResult: armloadtestservice.OperationListResult{ - // Value: []*armloadtestservice.Operation{ - // { - // Name: to.Ptr("Microsoft.LoadTestService/loadTests/Write"), - // IsDataAction: to.Ptr(false), - // Display: &armloadtestservice.OperationDisplay{ - // Provider: to.Ptr("Microsoft.LoadTestService"), - // Resource: to.Ptr("loadTests"), - // Operation: to.Ptr("Creates or updates the LoadTests"), - // Description: to.Ptr("Set LoadTests"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.LoadTestService/loadTests/Delete"), - // IsDataAction: to.Ptr(false), - // Display: &armloadtestservice.OperationDisplay{ - // Provider: to.Ptr("Microsoft.LoadTestService"), - // Resource: to.Ptr("loadTests"), - // Operation: to.Ptr("Deletes the LoadTests"), - // Description: to.Ptr("Delete LoadTests"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.LoadTestService/loadTests/Read"), - // IsDataAction: to.Ptr(false), - // Display: &armloadtestservice.OperationDisplay{ - // Provider: to.Ptr("Microsoft.LoadTestService"), - // Resource: to.Ptr("loadTests"), - // Operation: to.Ptr("Reads the LoadTests"), - // Description: to.Ptr("Read LoadTests"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armloadtestservice/zz_quotas_client_example_test.go b/packages/typespec-go/test/armloadtestservice/zz_quotas_client_example_test.go deleted file mode 100644 index 0d53bbd0c..000000000 --- a/packages/typespec-go/test/armloadtestservice/zz_quotas_client_example_test.go +++ /dev/null @@ -1,125 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armloadtestservice_test - -import ( - "armloadtestservice" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2022-12-01/Quotas_CheckAvailability.json -func ExampleQuotasClient_CheckAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQuotasClient().CheckAvailability(ctx, "westus", "testQuotaBucket", armloadtestservice.QuotaBucketRequest{ - Properties: &armloadtestservice.QuotaBucketRequestProperties{ - CurrentUsage: to.Ptr[int32](20), - CurrentQuota: to.Ptr[int32](40), - NewQuota: to.Ptr[int32](50), - Dimensions: &armloadtestservice.QuotaBucketRequestPropertiesDimensions{ - SubscriptionID: to.Ptr("testsubscriptionId"), - Location: to.Ptr("westus"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armloadtestservice.QuotasClientCheckAvailabilityResponse{ - // CheckQuotaAvailabilityResponse: &armloadtestservice.CheckQuotaAvailabilityResponse{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"), - // Name: to.Ptr("testQuotaBucket"), - // Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"), - // Properties: &armloadtestservice.CheckQuotaAvailabilityResponseProperties{ - // IsAvailable: to.Ptr(false), - // AvailabilityStatus: to.Ptr("The requested quota is currently unavailable. Please request for different quota, or upgrade subscription offer type and try again later."), - // }, - // }, - // } -} - -// Generated from example definition: 2022-12-01/Quotas_Get.json -func ExampleQuotasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQuotasClient().Get(ctx, "westus", "testQuotaBucket", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armloadtestservice.QuotasClientGetResponse{ - // QuotaResource: &armloadtestservice.QuotaResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"), - // Name: to.Ptr("testQuotaBucket"), - // Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"), - // Properties: &armloadtestservice.QuotaResourceProperties{ - // Limit: to.Ptr[int32](50), - // Usage: to.Ptr[int32](20), - // }, - // }, - // } -} - -// Generated from example definition: 2022-12-01/Quotas_List.json -func ExampleQuotasClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armloadtestservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQuotasClient().NewListPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armloadtestservice.QuotasClientListResponse{ - // QuotaResourceListResult: armloadtestservice.QuotaResourceListResult{ - // Value: []*armloadtestservice.QuotaResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"), - // Name: to.Ptr("testQuotaBucket"), - // Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"), - // Properties: &armloadtestservice.QuotaResourceProperties{ - // Limit: to.Ptr[int32](50), - // Usage: to.Ptr[int32](20), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armmongocluster/go.mod b/packages/typespec-go/test/armmongocluster/go.mod index 962131b3e..f08c329b4 100644 --- a/packages/typespec-go/test/armmongocluster/go.mod +++ b/packages/typespec-go/test/armmongocluster/go.mod @@ -2,20 +2,10 @@ module armmongocluster go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/packages/typespec-go/test/armmongocluster/go.sum b/packages/typespec-go/test/armmongocluster/go.sum index 0f58a50c0..fb5e8f74b 100644 --- a/packages/typespec-go/test/armmongocluster/go.sum +++ b/packages/typespec-go/test/armmongocluster/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/packages/typespec-go/test/armmongocluster/zz_firewallrules_client_example_test.go b/packages/typespec-go/test/armmongocluster/zz_firewallrules_client_example_test.go deleted file mode 100644 index 31a732beb..000000000 --- a/packages/typespec-go/test/armmongocluster/zz_firewallrules_client_example_test.go +++ /dev/null @@ -1,190 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armmongocluster_test - -import ( - "armmongocluster" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-01-preview/MongoClusters_FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "myMongoCluster", "rule1", armmongocluster.FirewallRule{ - Properties: &armmongocluster.FirewallRuleProperties{ - StartIPAddress: to.Ptr("0.0.0.0"), - EndIPAddress: to.Ptr("255.255.255.255"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.FirewallRulesClientCreateOrUpdateResponse{ - // FirewallRule: &armmongocluster.FirewallRule{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.FirewallRuleProperties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // EndIPAddress: to.Ptr("255.255.255.255"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "myMongoCluster", "rule1", 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: 2024-03-01-preview/MongoClusters_FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "myMongoCluster", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.FirewallRulesClientGetResponse{ - // FirewallRule: &armmongocluster.FirewallRule{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.FirewallRuleProperties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // EndIPAddress: to.Ptr("255.255.255.255"), - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_FirewallRuleList.json -func ExampleFirewallRulesClient_NewListByMongoClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.FirewallRulesClientListByMongoClusterResponse{ - // FirewallRuleListResult: armmongocluster.FirewallRuleListResult{ - // Value: []*armmongocluster.FirewallRule{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.FirewallRuleProperties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("0.0.0.0"), - // EndIPAddress: to.Ptr("255.255.255.255"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule2"), - // Name: to.Ptr("rule2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.FirewallRuleProperties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // StartIPAddress: to.Ptr("1.0.0.0"), - // EndIPAddress: to.Ptr("255.0.0.0"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armmongocluster/zz_mongoclusters_client_example_test.go b/packages/typespec-go/test/armmongocluster/zz_mongoclusters_client_example_test.go deleted file mode 100644 index d4113cbf2..000000000 --- a/packages/typespec-go/test/armmongocluster/zz_mongoclusters_client_example_test.go +++ /dev/null @@ -1,738 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armmongocluster_test - -import ( - "armmongocluster" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" - "time" -) - -// Generated from example definition: 2024-03-01-preview/MongoClusters_NameAvailability.json -func ExampleMongoClustersClient_CheckNameAvailability_checksAndConfirmsTheMongoClusterNameIsAvailabilityForUse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armmongocluster.CheckNameAvailabilityRequest{ - Name: to.Ptr("newmongocluster"), - Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientCheckNameAvailabilityResponse{ - // CheckNameAvailabilityResponse: &armmongocluster.CheckNameAvailabilityResponse{ - // NameAvailable: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_NameAvailability_AlreadyExists.json -func ExampleMongoClustersClient_CheckNameAvailability_checksAndReturnsThatTheMongoClusterNameIsAlreadyInUse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armmongocluster.CheckNameAvailabilityRequest{ - Name: to.Ptr("existingmongocluster"), - Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientCheckNameAvailabilityResponse{ - // CheckNameAvailabilityResponse: &armmongocluster.CheckNameAvailabilityResponse{ - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armmongocluster.CheckNameAvailabilityReasonAlreadyExists), - // Message: to.Ptr("Cluster name 'existingmongocluster' is already in use."), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_Create.json -func ExampleMongoClustersClient_BeginCreateOrUpdate_createsANewMongoClusterResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.MongoCluster{ - Location: to.Ptr("westus2"), - Properties: &armmongocluster.Properties{ - AdministratorLogin: to.Ptr("mongoAdmin"), - AdministratorLoginPassword: to.Ptr("password"), - ServerVersion: to.Ptr("5.0"), - NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - { - Kind: to.Ptr(armmongocluster.NodeKindShard), - SKU: to.Ptr("M30"), - DiskSizeGB: to.Ptr[int64](128), - EnableHa: to.Ptr(true), - NodeCount: to.Ptr[int32](1), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientCreateOrUpdateResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](3), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_CreatePITR.json -func ExampleMongoClustersClient_BeginCreateOrUpdate_createsAMongoClusterResourceFromAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.MongoCluster{ - Location: to.Ptr("westus2"), - Properties: &armmongocluster.Properties{ - CreateMode: to.Ptr(armmongocluster.CreateModePointInTimeRestore), - RestoreParameters: &armmongocluster.RestoreParameters{ - PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-13T20:07:35Z"); return t }()), - SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myOtherMongoCluster"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientCreateOrUpdateResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](3), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_Delete.json -func ExampleMongoClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginDelete(ctx, "TestResourceGroup", "myMongoCluster", 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: 2024-03-01-preview/MongoClusters_Get.json -func ExampleMongoClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().Get(ctx, "TestResourceGroup", "myMongoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientGetResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_List.json -func ExampleMongoClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoClustersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.MongoClustersClientListResponse{ - // ListResult: armmongocluster.ListResult{ - // Value: []*armmongocluster.MongoCluster{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"), - // Name: to.Ptr("myMongoCluster2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // }, - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user2"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M40"), - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](2), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"), - // }, - // Location: to.Ptr("eastus"), - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_ListByResourceGroup.json -func ExampleMongoClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMongoClustersClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.MongoClustersClientListByResourceGroupResponse{ - // ListResult: armmongocluster.ListResult{ - // Value: []*armmongocluster.MongoCluster{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](128), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"), - // Name: to.Ptr("myMongoCluster2"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // }, - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user2"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M40"), - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](2), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster2.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"), - // }, - // Location: to.Ptr("eastus"), - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_ListConnectionStrings.json -func ExampleMongoClustersClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMongoClustersClient().ListConnectionStrings(ctx, "TestGroup", "myMongoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientListConnectionStringsResponse{ - // ListConnectionStringsResult: &armmongocluster.ListConnectionStringsResult{ - // ConnectionStrings: []*armmongocluster.ConnectionString{ - // { - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // Description: to.Ptr("default connection string"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PatchDiskSize.json -func ExampleMongoClustersClient_BeginUpdate_updatesTheDiskSizeOnAMongoClusterResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.MongoCluster{ - Properties: &armmongocluster.Properties{ - NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - { - Kind: to.Ptr(armmongocluster.NodeKindShard), - DiskSizeGB: to.Ptr[int64](256), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientUpdateResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PatchPrivateNetworkAccess.json -func ExampleMongoClustersClient_BeginUpdate_disablesPublicNetworkAccessOnAMongoClusterResourceWithAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.MongoCluster{ - Properties: &armmongocluster.Properties{ - PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientUpdateResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M30"), - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PrivateEndpointConnections: []*armmongocluster.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/mymongocluster-pe.ffffffff-ffff-ffff-ffff-ffffffffffff"), - // SystemData: &armmongocluster.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-06T04:00:25.0509765Z"); return t}()), - // CreatedBy: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-06T04:00:25.0509765Z"); return t}()), - // LastModifiedBy: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // }, - // Properties: &armmongocluster.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmongocluster.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.Network/privateEndpoints/mymongocluster-pe"), - // }, - // GroupIDs: []*string{ - // to.Ptr("MongoCluster"), - // }, - // PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved), - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // }, - // }, - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessDisabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_Update.json -func ExampleMongoClustersClient_BeginUpdate_updatesAMongoClusterResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armmongocluster.MongoCluster{ - Properties: &armmongocluster.Properties{ - AdministratorLogin: to.Ptr("mongoAdmin"), - AdministratorLoginPassword: to.Ptr("password"), - ServerVersion: to.Ptr("5.0"), - NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - { - Kind: to.Ptr(armmongocluster.NodeKindShard), - SKU: to.Ptr("M50"), - DiskSizeGB: to.Ptr[int64](256), - EnableHa: to.Ptr(true), - NodeCount: to.Ptr[int32](1), - }, - }, - PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.MongoClustersClientUpdateResponse{ - // MongoCluster: &armmongocluster.MongoCluster{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"), - // Name: to.Ptr("myMongoCluster"), - // Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"), - // SystemData: &armmongocluster.SystemData{ - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // }, - // Properties: &armmongocluster.Properties{ - // ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded), - // AdministratorLogin: to.Ptr("mongoAdmin"), - // ServerVersion: to.Ptr("5.0"), - // NodeGroupSpecs: []*armmongocluster.NodeGroupSpec{ - // { - // Kind: to.Ptr(armmongocluster.NodeKindShard), - // SKU: to.Ptr("M50"), - // DiskSizeGB: to.Ptr[int64](256), - // EnableHa: to.Ptr(true), - // NodeCount: to.Ptr[int32](4), - // }, - // }, - // PublicNetworkAccess: to.Ptr(armmongocluster.PublicNetworkAccessEnabled), - // ConnectionString: to.Ptr("mongodb+srv://:@myMongoCluster.mongocluster.cosmos.azure.com"), - // EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"), - // }, - // Location: to.Ptr("westus2"), - // }, - // } -} diff --git a/packages/typespec-go/test/armmongocluster/zz_operations_client_example_test.go b/packages/typespec-go/test/armmongocluster/zz_operations_client_example_test.go deleted file mode 100644 index 13672579a..000000000 --- a/packages/typespec-go/test/armmongocluster/zz_operations_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armmongocluster_test - -import ( - "armmongocluster" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-01-preview/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() - clientFactory, err := armmongocluster.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.OperationsClientListResponse{ - // OperationListResult: armmongocluster.OperationListResult{ - // Value: []*armmongocluster.Operation{ - // { - // Name: to.Ptr("Microsoft.DocumentDB/mongoClusters/read"), - // Display: &armmongocluster.OperationDisplay{ - // Provider: to.Ptr("Microsoft.DocumentDB"), - // Resource: to.Ptr("Mongo Cluster"), - // Operation: to.Ptr("Read Mongo Clusters"), - // Description: to.Ptr("Reads a Mongo Cluster or list all Mongo Clusters."), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DocumentDB/mongoClusters/write"), - // Display: &armmongocluster.OperationDisplay{ - // Provider: to.Ptr("Microsoft.DocumentDB"), - // Resource: to.Ptr("Mongo Cluster"), - // Operation: to.Ptr("Create or Update Mongo Cluster"), - // Description: to.Ptr("Create or Update the properties or tags of the specified Mongo Cluster."), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armmongocluster/zz_privateendpointconnections_client_example_test.go b/packages/typespec-go/test/armmongocluster/zz_privateendpointconnections_client_example_test.go deleted file mode 100644 index 074291c53..000000000 --- a/packages/typespec-go/test/armmongocluster/zz_privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,201 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armmongocluster_test - -import ( - "armmongocluster" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PrivateEndpointConnectionPut.json -func ExamplePrivateEndpointConnectionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreate(ctx, "TestGroup", "myMongoCluster", "pecTest", armmongocluster.PrivateEndpointConnectionResource{ - Properties: &armmongocluster.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{ - Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved), - Description: to.Ptr("Auto-Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.PrivateEndpointConnectionsClientCreateResponse{ - // PrivateEndpointConnectionResource: &armmongocluster.PrivateEndpointConnectionResource{ - // Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"), - // SystemData: &armmongocluster.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // }, - // Properties: &armmongocluster.PrivateEndpointConnectionProperties{ - // ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded), - // PrivateEndpoint: &armmongocluster.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"), - // }, - // GroupIDs: []*string{ - // to.Ptr("MongoCluster"), - // }, - // PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved), - // Description: to.Ptr("Approved by admin"), - // ActionsRequired: to.Ptr("None"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "TestGroup", "myMongoCluster", "pecTest.5d393f64-ef64-46d0-9959-308321c44ac0", 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: 2024-03-01-preview/MongoClusters_PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "TestGroup", "myMongoCluster", "pecTest.5d393f64-ef64-46d0-9959-308321c44ac0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmongocluster.PrivateEndpointConnectionsClientGetResponse{ - // PrivateEndpointConnectionResource: &armmongocluster.PrivateEndpointConnectionResource{ - // Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"), - // SystemData: &armmongocluster.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // }, - // Properties: &armmongocluster.PrivateEndpointConnectionProperties{ - // ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded), - // PrivateEndpoint: &armmongocluster.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"), - // }, - // GroupIDs: []*string{ - // to.Ptr("MongoCluster"), - // }, - // PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved), - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByMongoClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.PrivateEndpointConnectionsClientListByMongoClusterResponse{ - // PrivateEndpointConnectionResourceListResult: armmongocluster.PrivateEndpointConnectionResourceListResult{ - // Value: []*armmongocluster.PrivateEndpointConnectionResource{ - // { - // Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"), - // Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"), - // SystemData: &armmongocluster.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()), - // LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"), - // LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication), - // }, - // Properties: &armmongocluster.PrivateEndpointConnectionProperties{ - // ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded), - // PrivateEndpoint: &armmongocluster.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"), - // }, - // GroupIDs: []*string{ - // to.Ptr("MongoCluster"), - // }, - // PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved), - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // }, - // }, - // }, - // }, - // }, - // } - } -} diff --git a/packages/typespec-go/test/armmongocluster/zz_privatelinks_client_example_test.go b/packages/typespec-go/test/armmongocluster/zz_privatelinks_client_example_test.go deleted file mode 100644 index 3ba1db289..000000000 --- a/packages/typespec-go/test/armmongocluster/zz_privatelinks_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package armmongocluster_test - -import ( - "armmongocluster" - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "log" -) - -// Generated from example definition: 2024-03-01-preview/MongoClusters_PrivateLinkResourceList.json -func ExamplePrivateLinksClient_NewListByMongoClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinksClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page = armmongocluster.PrivateLinksClientListByMongoClusterResponse{ - // PrivateLinkResourceListResult: armmongocluster.PrivateLinkResourceListResult{ - // Value: []*armmongocluster.PrivateLinkResource{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateLinkResources/MongoCluster"), - // Name: to.Ptr("MongoCluster"), - // Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateLinkResources"), - // Properties: &armmongocluster.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("MongoCluster"), - // RequiredMembers: []*string{ - // to.Ptr("c.p7ex3v2euquypn"), - // }, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.mongocluster.cosmos.azure.com"), - // }, - // }, - // }, - // }, - // }, - // } - } -}