diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md index bd0c34b7f51f..ca339f84a76f 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2024-07-30) +### Other Changes + + ## 1.0.0 (2024-06-21) ### Breaking Changes diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md index 184d755b1053..413c07da9e6f 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appcomplianceautomation/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appcomplianceautomation/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2024-06 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go index 8669e3642a58..0a4e159d5e8c 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go @@ -10,7 +10,7 @@ package armappcomplianceautomation const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go deleted file mode 100644 index 253b2cf2fe1e..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_ListByReport.json -func ExampleEvidenceClient_NewListByReportPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEvidenceClient().NewListByReportPager("reportName", &armappcomplianceautomation.EvidenceClientListByReportOptions{SkipToken: nil, - Top: nil, - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: nil, - ReportCreatorTenantID: 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.EvidenceResourceListResult = armappcomplianceautomation.EvidenceResourceListResult{ - // Value: []*armappcomplianceautomation.EvidenceResource{ - // { - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json -func ExampleEvidenceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().Get(ctx, "testReportName", "evidence1", 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.EvidenceResource = armappcomplianceautomation.EvidenceResource{ - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_CreateOrUpdate.json -func ExampleEvidenceClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().CreateOrUpdate(ctx, "testReportName", "evidence1", armappcomplianceautomation.EvidenceResource{}, &armappcomplianceautomation.EvidenceClientCreateOrUpdateOptions{OfferGUID: nil, - ReportCreatorTenantID: 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.EvidenceResource = armappcomplianceautomation.EvidenceResource{ - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Delete.json -func ExampleEvidenceClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEvidenceClient().Delete(ctx, "testReportName", "evidence1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Download.json -func ExampleEvidenceClient_Download() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().Download(ctx, "testReportName", "evidence1", armappcomplianceautomation.EvidenceFileDownloadRequest{}, 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.EvidenceFileDownloadResponse = armappcomplianceautomation.EvidenceFileDownloadResponse{ - // EvidenceFile: &armappcomplianceautomation.EvidenceFileDownloadResponseEvidenceFile{ - // URL: to.Ptr("this is a url"), - // }, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod index 8b2b0d6e3f47..e4e7d558d758 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautoma go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.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/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.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/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go deleted file mode 100644 index 7b2492f0a03f..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.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.OperationListResult = armappcomplianceautomation.OperationListResult{ - // Value: []*armappcomplianceautomation.Operation{ - // { - // Name: to.Ptr("Microsoft.AppComplianceAutomation/reports/write"), - // Display: &armappcomplianceautomation.OperationDisplay{ - // Description: to.Ptr("Create new reports."), - // Operation: to.Ptr("Microsoft.AppComplianceAutomation/reports/write"), - // Provider: to.Ptr("Microsoft AppComplianceAutomation"), - // Resource: to.Ptr("Microsoft.AppComplianceAutomation/reports"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go deleted file mode 100644 index a2f22ce4e86d..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CheckNameAvailability.json -func ExampleProviderActionsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().CheckNameAvailability(ctx, armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An report named 'reportABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetCollectionCount.json -func ExampleProviderActionsClient_GetCollectionCount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().GetCollectionCount(ctx, armappcomplianceautomation.GetCollectionCountRequest{}, 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.GetCollectionCountResponse = armappcomplianceautomation.GetCollectionCountResponse{ - // Count: to.Ptr[int32](100), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetOverviewStatus.json -func ExampleProviderActionsClient_GetOverviewStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().GetOverviewStatus(ctx, armappcomplianceautomation.GetOverviewStatusRequest{}, 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.GetOverviewStatusResponse = armappcomplianceautomation.GetOverviewStatusResponse{ - // StatusList: []*armappcomplianceautomation.StatusItem{ - // { - // StatusName: to.Ptr("Active"), - // StatusValue: to.Ptr("100"), - // }, - // { - // StatusName: to.Ptr("Failed"), - // StatusValue: to.Ptr("0"), - // }, - // { - // StatusName: to.Ptr("Disabled"), - // StatusValue: to.Ptr("0"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithSubscriptions.json -func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithSubscriptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{ - // StorageAccountList: []*armappcomplianceautomation.StorageInfo{ - // { - // AccountName: to.Ptr("SA_name1"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }, - // { - // AccountName: to.Ptr("SA_name2"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithoutSubscriptions.json -func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithoutSubscriptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{ - // StorageAccountList: []*armappcomplianceautomation.StorageInfo{ - // { - // AccountName: to.Ptr("SA_name1"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }, - // { - // AccountName: to.Ptr("SA_name2"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Onboard.json -func ExampleProviderActionsClient_BeginOnboard() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProviderActionsClient().BeginOnboard(ctx, armappcomplianceautomation.OnboardRequest{}, 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.OnboardResponse = armappcomplianceautomation.OnboardResponse{ - // SubscriptionIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000"), - // to.Ptr("00000000-0000-0000-0000-000000000001")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/TriggerEvaluation.json -func ExampleProviderActionsClient_BeginTriggerEvaluation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProviderActionsClient().BeginTriggerEvaluation(ctx, armappcomplianceautomation.TriggerEvaluationRequest{}, 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.TriggerEvaluationResponse = armappcomplianceautomation.TriggerEvaluationResponse{ - // Properties: &armappcomplianceautomation.TriggerEvaluationProperty{ - // EvaluationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:10:00.000Z"); return t}()), - // QuickAssessments: []*armappcomplianceautomation.QuickAssessment{ - // { - // Description: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."), - // DisplayName: to.Ptr("Storage accounts should restrict network access using virtual network rules"), - // RemediationLink: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusHealthy), - // ResponsibilityID: to.Ptr("/providers/microsoft.authorization/policydefinitions/2a1a9cdf-e04d-429a-8416-3bfb72a1b26f"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }, - // { - // Description: to.Ptr(""), - // DisplayName: to.Ptr("Secure transfer to storage accounts should be enabled"), - // RemediationLink: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResponsibilityID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }}, - // ResourceIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm")}, - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go deleted file mode 100644 index 87bec1aea3a6..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go +++ /dev/null @@ -1,648 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_List.json -func ExampleReportClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReportClient().NewListPager(&armappcomplianceautomation.ReportClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - ReportCreatorTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }) - 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.ReportResourceListResult = armappcomplianceautomation.ReportResourceListResult{ - // Value: []*armappcomplianceautomation.ReportResource{ - // { - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // NotApplicableCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // PendingCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json -func ExampleReportClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().Get(ctx, "testReport", 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // to.Ptr("resource-inaccessible")}, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusFailed), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CreateOrUpdate.json -func ExampleReportClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginCreateOrUpdate(ctx, "testReportName", armappcomplianceautomation.ReportResource{}, 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Update.json -func ExampleReportClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginUpdate(ctx, "testReportName", armappcomplianceautomation.ReportResourcePatch{}, 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Delete.json -func ExampleReportClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginDelete(ctx, "testReportName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Evidence_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportEvidenceCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An evidence named 'evidenceABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Snapshot_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportSnapshotCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An snapshot named 'snapshotABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Webhook_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportWebhookCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An webhook named 'webhookABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Fix.json -func ExampleReportClient_BeginFix() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginFix(ctx, "testReport", 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.ReportFixResult = armappcomplianceautomation.ReportFixResult{ - // Reason: to.Ptr(""), - // Result: to.Ptr(armappcomplianceautomation.ResultSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetScopingQuestions.json -func ExampleReportClient_GetScopingQuestions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().GetScopingQuestions(ctx, "testReportName", 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.ScopingQuestions = armappcomplianceautomation.ScopingQuestions{ - // Questions: []*armappcomplianceautomation.ScopingQuestion{ - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeBoolean), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // ShowSubQuestionsValue: to.Ptr("true"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeText), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G04_graphPermissionData"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired), - // to.Ptr(armappcomplianceautomation.RuleCharLength)}, - // SuperiorQuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeBoolean), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // ShowSubQuestionsValue: to.Ptr("true"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeText), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G05_graphPermissionInfo"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired), - // to.Ptr(armappcomplianceautomation.RuleCharLength), - // to.Ptr(armappcomplianceautomation.RulePreventNonEnglishChar)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeMultiSelectDropdown), - // OptionIDs: []*string{ - // to.Ptr("Croatia"), - // to.Ptr("Cuba"), - // to.Ptr("Curaçao"), - // to.Ptr("Cyprus"), - // to.Ptr("Czechia"), - // to.Ptr("Côte d'Ivoire"), - // to.Ptr("Denmark"), - // to.Ptr("Djibouti"), - // to.Ptr("Dominica"), - // to.Ptr("Dominican Republic (the)"), - // to.Ptr("Ecuador"), - // to.Ptr("Egypt")}, - // QuestionID: to.Ptr("DHP_G08_storageLocation"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputType("SingleSelectEnum")), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("LEG03_complianceDataTermination"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_SyncCertRecord.json -func ExampleReportClient_BeginSyncCertRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginSyncCertRecord(ctx, "testReportName", armappcomplianceautomation.SyncCertRecordRequest{}, 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.SyncCertRecordResponse = armappcomplianceautomation.SyncCertRecordResponse{ - // CertRecord: &armappcomplianceautomation.CertSyncRecord{ - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // }, - // IngestionStatus: to.Ptr("InitialDocumentResubmitted"), - // OfferGUID: to.Ptr("addb13fc-64bf-4005-b693-4c2f094e2187"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Verify.json -func ExampleReportClient_BeginVerify() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginVerify(ctx, "testReport", 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.ReportVerificationResult = armappcomplianceautomation.ReportVerificationResult{ - // Reason: to.Ptr(""), - // Result: to.Ptr(armappcomplianceautomation.ResultSucceeded), - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go deleted file mode 100644 index d1776617c95f..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_List.json -func ExampleScopingConfigurationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScopingConfigurationClient().NewListPager("testReportName", 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.ScopingConfigurationResourceListResult = armappcomplianceautomation.ScopingConfigurationResourceListResult{ - // Value: []*armappcomplianceautomation.ScopingConfigurationResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json -func ExampleScopingConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopingConfigurationClient().Get(ctx, "testReportName", "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.ScopingConfigurationResource = armappcomplianceautomation.ScopingConfigurationResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_CreateOrUpdate.json -func ExampleScopingConfigurationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopingConfigurationClient().CreateOrUpdate(ctx, "testReportName", "default", armappcomplianceautomation.ScopingConfigurationResource{}, 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.ScopingConfigurationResource = armappcomplianceautomation.ScopingConfigurationResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Delete.json -func ExampleScopingConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScopingConfigurationClient().Delete(ctx, "testReportName", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go deleted file mode 100644 index 59f00b07c210..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go +++ /dev/null @@ -1,520 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_List.json -func ExampleSnapshotClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotClient().NewListPager("testReportName", &armappcomplianceautomation.SnapshotClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - ReportCreatorTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }) - 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.SnapshotResourceListResult = armappcomplianceautomation.SnapshotResourceListResult{ - // Value: []*armappcomplianceautomation.SnapshotResource{ - // { - // Name: to.Ptr("testSnapshot"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/snapshots"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testSnapshot"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.SnapshotProperties{ - // ComplianceResults: []*armappcomplianceautomation.ComplianceResult{ - // { - // Categories: []*armappcomplianceautomation.Category{ - // { - // CategoryName: to.Ptr("Operational Security"), - // CategoryStatus: to.Ptr(armappcomplianceautomation.CategoryStatusPassed), - // ControlFamilies: []*armappcomplianceautomation.ControlFamily{ - // { - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlFamilyStatus: to.Ptr(armappcomplianceautomation.ControlFamilyStatusPassed), - // Controls: []*armappcomplianceautomation.Control{ - // { - // ControlDescription: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlDescriptionHyperLink: to.Ptr("https://aka.ms/acat/m365cert/operational/control73"), - // ControlFullName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // Responsibilities: []*armappcomplianceautomation.Responsibility{ - // { - // EvidenceFiles: []*string{ - // to.Ptr("https://management.azure.com/providers/Microsoft.AppComplianceAutomation/reports/reportABC/fileName?api-version=2024-06-27")}, - // FailedResourceCount: to.Ptr[int32](0), - // Guidance: to.Ptr("Please upload the screen capture file to ACAT service."), - // Justification: to.Ptr("Here is my evidence files"), - // RecommendationList: []*armappcomplianceautomation.Recommendation{ - // { - // RecommendationID: to.Ptr("failed_reason_1"), - // RecommendationShortName: to.Ptr("Invalid TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Setting minimal TLS version to 1.2 improves security by ensuring your SQL Managed Instance can only be accessed from clients using TLS 1.2. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities"), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }, - // { - // RecommendationID: to.Ptr("failed_reason_2"), - // RecommendationShortName: to.Ptr("Invalid AWS TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Open the AWS related service, and set its TLS version to 1.2 or higher version."), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }}, - // ResourceList: []*armappcomplianceautomation.ResponsibilityResource{ - // { - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_1")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_2")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("iam.user"), - // }}, - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityEnvironment: to.Ptr(armappcomplianceautomation.ResponsibilityEnvironmentAzure), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // ResponsibilitySeverity: to.Ptr(armappcomplianceautomation.ResponsibilitySeverityHigh), - // ResponsibilityStatus: to.Ptr(armappcomplianceautomation.ResponsibilityStatusPassed), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // ResponsibilityType: to.Ptr(armappcomplianceautomation.ResponsibilityTypeAutomated), - // TotalResourceCount: to.Ptr[int32](1), - // }}, - // }}, - // }}, - // }}, - // ComplianceName: to.Ptr("M365"), - // }}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:33:59.160Z"); return t}()), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ReportProperties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // NotApplicableCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // PendingCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // }, - // ReportSystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // SnapshotName: to.Ptr("testSnapshot"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json -func ExampleSnapshotClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotClient().Get(ctx, "testReportName", "testSnapshot", 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.SnapshotResource = armappcomplianceautomation.SnapshotResource{ - // Name: to.Ptr("testSnapshot"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/snapshots"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testSnapshot"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.SnapshotProperties{ - // ComplianceResults: []*armappcomplianceautomation.ComplianceResult{ - // { - // Categories: []*armappcomplianceautomation.Category{ - // { - // CategoryName: to.Ptr("Operational Security"), - // CategoryStatus: to.Ptr(armappcomplianceautomation.CategoryStatusPassed), - // ControlFamilies: []*armappcomplianceautomation.ControlFamily{ - // { - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlFamilyStatus: to.Ptr(armappcomplianceautomation.ControlFamilyStatusPassed), - // Controls: []*armappcomplianceautomation.Control{ - // { - // ControlDescription: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlDescriptionHyperLink: to.Ptr("https://aka.ms/acat/m365cert/operational/control73"), - // ControlFullName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // Responsibilities: []*armappcomplianceautomation.Responsibility{ - // { - // EvidenceFiles: []*string{ - // to.Ptr("https://management.azure.com/providers/Microsoft.AppComplianceAutomation/reports/reportABC/fileName?api-version=2024-06-27")}, - // FailedResourceCount: to.Ptr[int32](0), - // Guidance: to.Ptr("Please upload the screen capture file to ACAT service."), - // Justification: to.Ptr("Here is my evidence files"), - // RecommendationList: []*armappcomplianceautomation.Recommendation{ - // { - // RecommendationID: to.Ptr("failed_reason_1"), - // RecommendationShortName: to.Ptr("Invalid TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Setting minimal TLS version to 1.2 improves security by ensuring your SQL Managed Instance can only be accessed from clients using TLS 1.2. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities"), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }, - // { - // RecommendationID: to.Ptr("failed_reason_2"), - // RecommendationShortName: to.Ptr("Invalid AWS TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Open the AWS related service, and set its TLS version to 1.2 or higher version."), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }}, - // ResourceList: []*armappcomplianceautomation.ResponsibilityResource{ - // { - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_1")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_2")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("iam.user"), - // }}, - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityEnvironment: to.Ptr(armappcomplianceautomation.ResponsibilityEnvironmentAzure), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // ResponsibilitySeverity: to.Ptr(armappcomplianceautomation.ResponsibilitySeverityHigh), - // ResponsibilityStatus: to.Ptr(armappcomplianceautomation.ResponsibilityStatusPassed), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // ResponsibilityType: to.Ptr(armappcomplianceautomation.ResponsibilityTypeAutomated), - // TotalResourceCount: to.Ptr[int32](1), - // }}, - // }}, - // }}, - // }}, - // ComplianceName: to.Ptr("M365"), - // }}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:33:59.160Z"); return t}()), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ReportProperties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // }, - // ReportSystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // SnapshotName: to.Ptr("testSnapshot"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Detailed_Pdf_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadComplianceDetailedPdfReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ComplianceDetailedPDFReport: &armappcomplianceautomation.DownloadResponseComplianceDetailedPDFReport{ - // SasURI: to.Ptr("this is a uri"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Pdf_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadCompliancePdfReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // CompliancePDFReport: &armappcomplianceautomation.DownloadResponseCompliancePDFReport{ - // SasURI: to.Ptr("this is uri of report"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadComplianceReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ComplianceReport: []*armappcomplianceautomation.ComplianceReportItem{ - // { - // CategoryName: to.Ptr("Data Security & Privacy"), - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusHealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Resource_List.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadResourceList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ResourceList: []*armappcomplianceautomation.ResourceItem{ - // { - // ResourceGroup: to.Ptr("myResourceGroup"), - // ResourceID: to.Ptr("mySignalRService"), - // ResourceType: to.Ptr("SignalR"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go deleted file mode 100644 index 5583577e6dad..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go +++ /dev/null @@ -1,239 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_List.json -func ExampleWebhookClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebhookClient().NewListPager("testReportName", &armappcomplianceautomation.WebhookClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: nil, - ReportCreatorTenantID: 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.WebhookResourceListResult = armappcomplianceautomation.WebhookResourceListResult{ - // Value: []*armappcomplianceautomation.WebhookResource{ - // { - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledFalse), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json -func ExampleWebhookClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().Get(ctx, "testReportName", "testWebhookName", 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/webhooks/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_CreateOrUpdate.json -func ExampleWebhookClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().CreateOrUpdate(ctx, "testReportName", "testWebhookName", armappcomplianceautomation.WebhookResource{}, 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/webhooks/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Update.json -func ExampleWebhookClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().Update(ctx, "testReportName", "testWebhookName", armappcomplianceautomation.WebhookResourcePatch{}, 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Delete.json -func ExampleWebhookClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWebhookClient().Delete(ctx, "testReportName", "testWebhookName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}