From 22beaf2017042d8e17530561e5184d3f5d81dde6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 6 May 2022 02:31:40 +0000 Subject: [PATCH] CodeGen from PR 17811 in Azure/azure-rest-api-specs Guest Configuration: Add new API version - 2022-01-25 for SET scenario (#17811) * Add blockchain to latest profile * Add additional types * Add GET all methods for resource group and subscription * Fix Linter Validation issue * Fix Swagger Correctness S360 items * Fix swagger validation comments * Fix model validaiton * Fix Lint errors * Fix model validation for examples * IoT Central Public API 1.1-preview Oct Release (#16514) * Add new 2.0-preview.1 version for IoT Central * fix typo on enum value * rollback 1.0 changes, applied 2.0-preview.1 * fix typo * remove non-used examples * fix style * update version from 2.0-preview.1 to 1.1-preview * update code review comments, fix patch consumes with json-patch support, fix examples for fileupload * add nextLink to collection of orgs * fix typo * fix wrong position of paging * fix the paging * add . to description * update default to use enum for api-version * add oct release with query, cde v2, device filter, device template filter, relationship, edge template, simplified template patching * update examples * fix lint error, model validation * fix missing type in examples, remove url format * fix ID case * fix id case * fix ID case * add iotc query language reference * fix typo * Make ConfigurationSetting read-only property * Fix Swagger S360 issues * Remove the unknown file * Fix prettier check * Changing the vmssResourceId to camelCasing * Revert the readOnly tag on name property * Guest Configuration - Add new API version 2022-01-25 for SET Scenario * fix LinDiff errors * Run prettier check * Fix review comments * Keep the parameter sequence same as before * Update GO SDK read me file * Fix LinttDiff errors * Fix Prettier check * adding assignmentSource field * fixing lint issues raised by current PR * fixing pageable placement * making nextLink null * fixing policheck error to replace whitelisted Co-authored-by: Mark Cowlishaw Co-authored-by: Aashish Rajaram Salokhe Co-authored-by: Johnson Yang Co-authored-by: Anika Tabassum Sardar Neela --- .../armguestconfiguration/CHANGELOG.md | 25 ++ .../armguestconfiguration/autorest.md | 6 +- .../armguestconfiguration/go.mod | 16 +- .../armguestconfiguration/go.sum | 33 +-- ...figurationassignmentreports_client_test.go | 64 ----- ...estconfigurationassignments_client_test.go | 182 -------------- ...rationhcrpassignmentreports_client_test.go | 64 ----- ...onfigurationhcrpassignments_client_test.go | 131 ---------- ...enerated_example_operations_client_test.go | 42 ---- .../zz_generated_assignmentreports_client.go | 4 +- ..._generated_assignmentreportsvmss_client.go | 190 ++++++++++++++ .../zz_generated_assignments_client.go | 12 +- .../zz_generated_assignmentsvmss_client.go | 238 ++++++++++++++++++ .../zz_generated_constants.go | 22 +- ..._generated_hcrpassignmentreports_client.go | 4 +- .../zz_generated_hcrpassignments_client.go | 8 +- .../zz_generated_models.go | 90 +++++-- .../zz_generated_models_serde.go | 48 ++++ .../zz_generated_operations_client.go | 2 +- .../zz_generated_response_types.go | 25 ++ 20 files changed, 645 insertions(+), 561 deletions(-) delete mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go delete mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go delete mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go delete mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go delete mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go create mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go create mode 100644 sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md index ec3fbdcc9dcd..74c7b56db39f 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md @@ -1,5 +1,30 @@ # Release History +## 0.5.0 (2022-05-06) +### Features Added + +- New const `CreatedByTypeUser` +- New const `CreatedByTypeApplication` +- New const `CreatedByTypeManagedIdentity` +- New const `CreatedByTypeKey` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New struct `AssignmentReportsVMSSClientGetOptions` +- New struct `AssignmentReportsVMSSClientGetResponse` +- New struct `AssignmentReportsVMSSClientListOptions` +- New struct `AssignmentReportsVMSSClientListResponse` +- New struct `AssignmentsVMSSClientDeleteOptions` +- New struct `AssignmentsVMSSClientDeleteResponse` +- New struct `AssignmentsVMSSClientGetOptions` +- New struct `AssignmentsVMSSClientGetResponse` +- New struct `AssignmentsVMSSClientListOptions` +- New struct `AssignmentsVMSSClientListResponse` +- New struct `SystemData` +- New field `SystemData` in struct `Assignment` +- New field `AssignmentSource` in struct `Navigation` + + ## 0.4.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md index 0980a00ae7b3..98774b51bdd9 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/guestconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/guestconfiguration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/guestconfiguration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/guestconfiguration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod index 0f70dd784dbd..b604149c2645 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/ go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum index 56d1c32628ae..a7eaa30576c1 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,26 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go deleted file mode 100644 index 7296688cb3aa..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listAllGuestConfigurationAssignmentReports.json -func ExampleAssignmentReportsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/getGuestConfigurationAssignmentReportById.json -func ExampleAssignmentReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go deleted file mode 100644 index d69901ddc047..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_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/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/createOrUpdateGuestConfigurationAssignment.json -func ExampleAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - armguestconfiguration.Assignment{ - Name: to.Ptr(""), - Location: to.Ptr(""), - Properties: &armguestconfiguration.AssignmentProperties{ - Context: to.Ptr(""), - GuestConfiguration: &armguestconfiguration.Navigation{ - Name: to.Ptr(""), - AssignmentType: to.Ptr(armguestconfiguration.AssignmentTypeApplyAndAutoCorrect), - ConfigurationParameter: []*armguestconfiguration.ConfigurationParameter{ - { - Name: to.Ptr(""), - Value: to.Ptr(""), - }}, - ContentHash: to.Ptr(""), - ContentURI: to.Ptr(""), - Version: to.Ptr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/getGuestConfigurationAssignment.json -func ExampleAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/deleteGuestConfigurationAssignment.json -func ExampleAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listSubGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewSubscriptionListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewSubscriptionListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listRGGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewRGListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewRGListPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go deleted file mode 100644 index a33e3d4cc029..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listAllGuestConfigurationHCRPAssignmentReports.json -func ExampleHCRPAssignmentReportsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentReportsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/getGuestConfigurationHCRPAssignmentReportById.json -func ExampleHCRPAssignmentReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentReportsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go deleted file mode 100644 index e41486b00e4d..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_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/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/createOrUpdateGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - armguestconfiguration.Assignment{ - Name: to.Ptr(""), - Location: to.Ptr(""), - Properties: &armguestconfiguration.AssignmentProperties{ - Context: to.Ptr(""), - GuestConfiguration: &armguestconfiguration.Navigation{ - Name: to.Ptr(""), - AssignmentType: to.Ptr(armguestconfiguration.AssignmentTypeApplyAndAutoCorrect), - ConfigurationParameter: []*armguestconfiguration.ConfigurationParameter{ - { - Name: to.Ptr(""), - Value: to.Ptr(""), - }}, - ContentHash: to.Ptr(""), - ContentURI: to.Ptr(""), - Version: to.Ptr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/getGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/deleteGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listGuestConfigurationHCRPAssignments.json -func ExampleHCRPAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go deleted file mode 100644 index 5f1839cc6b8b..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2020-06-25/examples/listOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go index e61f734f31a6..1e107f312136 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go @@ -105,7 +105,7 @@ func (client *AssignmentReportsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -165,7 +165,7 @@ func (client *AssignmentReportsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go new file mode 100644 index 000000000000..e1d7a0cf515d --- /dev/null +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go @@ -0,0 +1,190 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armguestconfiguration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AssignmentReportsVMSSClient contains the methods for the GuestConfigurationAssignmentReportsVMSS group. +// Don't use this type directly, use NewAssignmentReportsVMSSClient() instead. +type AssignmentReportsVMSSClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAssignmentReportsVMSSClient creates a new instance of AssignmentReportsVMSSClient with the specified values. +// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewAssignmentReportsVMSSClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentReportsVMSSClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &AssignmentReportsVMSSClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Get a report for the VMSS guest configuration assignment, by reportId. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// vmssName - The name of the virtual machine scale set. +// name - The guest configuration assignment name. +// id - The GUID for the guest configuration assignment report. +// options - AssignmentReportsVMSSClientGetOptions contains the optional parameters for the AssignmentReportsVMSSClient.Get +// method. +func (client *AssignmentReportsVMSSClient) Get(ctx context.Context, resourceGroupName string, vmssName string, name string, id string, options *AssignmentReportsVMSSClientGetOptions) (AssignmentReportsVMSSClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vmssName, name, id, options) + if err != nil { + return AssignmentReportsVMSSClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentReportsVMSSClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AssignmentReportsVMSSClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AssignmentReportsVMSSClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, name string, id string, options *AssignmentReportsVMSSClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}/reports/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AssignmentReportsVMSSClient) getHandleResponse(resp *http.Response) (AssignmentReportsVMSSClientGetResponse, error) { + result := AssignmentReportsVMSSClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AssignmentReport); err != nil { + return AssignmentReportsVMSSClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all reports for the VMSS guest configuration assignment, latest report first. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// vmssName - The name of the virtual machine scale set. +// name - The guest configuration assignment name. +// options - AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.List +// method. +func (client *AssignmentReportsVMSSClient) NewListPager(resourceGroupName string, vmssName string, name string, options *AssignmentReportsVMSSClientListOptions) *runtime.Pager[AssignmentReportsVMSSClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AssignmentReportsVMSSClientListResponse]{ + More: func(page AssignmentReportsVMSSClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *AssignmentReportsVMSSClientListResponse) (AssignmentReportsVMSSClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, vmssName, name, options) + if err != nil { + return AssignmentReportsVMSSClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentReportsVMSSClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AssignmentReportsVMSSClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AssignmentReportsVMSSClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentReportsVMSSClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}/reports" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AssignmentReportsVMSSClient) listHandleResponse(resp *http.Response) (AssignmentReportsVMSSClientListResponse, error) { + result := AssignmentReportsVMSSClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AssignmentReportList); err != nil { + return AssignmentReportsVMSSClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go index eba3e4a31346..bb3f6d2153a2 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go @@ -102,7 +102,7 @@ func (client *AssignmentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -162,7 +162,7 @@ func (client *AssignmentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -213,7 +213,7 @@ func (client *AssignmentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -275,7 +275,7 @@ func (client *AssignmentsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -332,7 +332,7 @@ func (client *AssignmentsClient) rgListCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -385,7 +385,7 @@ func (client *AssignmentsClient) subscriptionListCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go new file mode 100644 index 000000000000..7b5548394cef --- /dev/null +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go @@ -0,0 +1,238 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armguestconfiguration + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AssignmentsVMSSClient contains the methods for the GuestConfigurationAssignmentsVMSS group. +// Don't use this type directly, use NewAssignmentsVMSSClient() instead. +type AssignmentsVMSSClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAssignmentsVMSSClient creates a new instance of AssignmentsVMSSClient with the specified values. +// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewAssignmentsVMSSClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentsVMSSClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &AssignmentsVMSSClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Delete - Delete a guest configuration assignment for VMSS +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// vmssName - The name of the virtual machine scale set. +// name - The guest configuration assignment name. +// options - AssignmentsVMSSClientDeleteOptions contains the optional parameters for the AssignmentsVMSSClient.Delete method. +func (client *AssignmentsVMSSClient) Delete(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientDeleteOptions) (AssignmentsVMSSClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmssName, name, options) + if err != nil { + return AssignmentsVMSSClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentsVMSSClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AssignmentsVMSSClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return client.deleteHandleResponse(resp) +} + +// deleteCreateRequest creates the Delete request. +func (client *AssignmentsVMSSClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleResponse handles the Delete response. +func (client *AssignmentsVMSSClient) deleteHandleResponse(resp *http.Response) (AssignmentsVMSSClientDeleteResponse, error) { + result := AssignmentsVMSSClientDeleteResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Assignment); err != nil { + return AssignmentsVMSSClientDeleteResponse{}, err + } + return result, nil +} + +// Get - Get information about a guest configuration assignment for VMSS +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// vmssName - The name of the virtual machine scale set. +// name - The guest configuration assignment name. +// options - AssignmentsVMSSClientGetOptions contains the optional parameters for the AssignmentsVMSSClient.Get method. +func (client *AssignmentsVMSSClient) Get(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientGetOptions) (AssignmentsVMSSClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vmssName, name, options) + if err != nil { + return AssignmentsVMSSClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentsVMSSClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AssignmentsVMSSClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AssignmentsVMSSClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AssignmentsVMSSClient) getHandleResponse(resp *http.Response) (AssignmentsVMSSClientGetResponse, error) { + result := AssignmentsVMSSClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Assignment); err != nil { + return AssignmentsVMSSClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all guest configuration assignments for VMSS. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// vmssName - The name of the virtual machine scale set. +// options - AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.List method. +func (client *AssignmentsVMSSClient) NewListPager(resourceGroupName string, vmssName string, options *AssignmentsVMSSClientListOptions) *runtime.Pager[AssignmentsVMSSClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AssignmentsVMSSClientListResponse]{ + More: func(page AssignmentsVMSSClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *AssignmentsVMSSClientListResponse) (AssignmentsVMSSClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, vmssName, options) + if err != nil { + return AssignmentsVMSSClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentsVMSSClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AssignmentsVMSSClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AssignmentsVMSSClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, options *AssignmentsVMSSClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AssignmentsVMSSClient) listHandleResponse(resp *http.Response) (AssignmentsVMSSClientListResponse, error) { + result := AssignmentsVMSSClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AssignmentList); err != nil { + return AssignmentsVMSSClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go index 02f92c4ccba9..61ed9f5fc288 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go @@ -10,7 +10,7 @@ package armguestconfiguration const ( moduleName = "armguestconfiguration" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) // ActionAfterReboot - Specifies what happens after a reboot during the application of a configuration. The possible values @@ -88,6 +88,26 @@ func PossibleConfigurationModeValues() []ConfigurationMode { } } +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + // Kind - Kind of the guest configuration. For example:DSC type Kind string diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go index b829dd31caa4..01d279dbb3bc 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go @@ -106,7 +106,7 @@ func (client *HCRPAssignmentReportsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -167,7 +167,7 @@ func (client *HCRPAssignmentReportsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go index 6e0bb58cc8cb..6da5171235ec 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go @@ -102,7 +102,7 @@ func (client *HCRPAssignmentsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -162,7 +162,7 @@ func (client *HCRPAssignmentsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -213,7 +213,7 @@ func (client *HCRPAssignmentsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -275,7 +275,7 @@ func (client *HCRPAssignmentsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go index 674871057ce1..105482fed828 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go @@ -24,6 +24,9 @@ type Assignment struct { // READ-ONLY; ARM resource id of the guest configuration assignment. ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The type of the resource. Type *string `json:"type,omitempty" azure:"ro"` } @@ -184,6 +187,16 @@ type AssignmentReportsClientListOptions struct { // placeholder for future optional parameters } +// AssignmentReportsVMSSClientGetOptions contains the optional parameters for the AssignmentReportsVMSSClient.Get method. +type AssignmentReportsVMSSClientGetOptions struct { + // placeholder for future optional parameters +} + +// AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.List method. +type AssignmentReportsVMSSClientListOptions struct { + // placeholder for future optional parameters +} + // AssignmentsClientCreateOrUpdateOptions contains the optional parameters for the AssignmentsClient.CreateOrUpdate method. type AssignmentsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -214,6 +227,21 @@ type AssignmentsClientSubscriptionListOptions struct { // placeholder for future optional parameters } +// AssignmentsVMSSClientDeleteOptions contains the optional parameters for the AssignmentsVMSSClient.Delete method. +type AssignmentsVMSSClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AssignmentsVMSSClientGetOptions contains the optional parameters for the AssignmentsVMSSClient.Get method. +type AssignmentsVMSSClientGetOptions struct { + // placeholder for future optional parameters +} + +// AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.List method. +type AssignmentsVMSSClientListOptions struct { + // placeholder for future optional parameters +} + type CommonAssignmentReport struct { // Configuration details of the guest configuration assignment. Assignment *AssignmentInfo `json:"assignment,omitempty"` @@ -263,31 +291,31 @@ type ConfigurationParameter struct { // ConfigurationSetting - Configuration setting of LCM (Local Configuration Manager). type ConfigurationSetting struct { - // Specifies what happens after a reboot during the application of a configuration. The possible values are ContinueConfiguration + // READ-ONLY; Specifies what happens after a reboot during the application of a configuration. The possible values are ContinueConfiguration // and StopConfiguration - ActionAfterReboot *ActionAfterReboot `json:"actionAfterReboot,omitempty"` + ActionAfterReboot *ActionAfterReboot `json:"actionAfterReboot,omitempty" azure:"ro"` - // If true - new configurations downloaded from the pull service are allowed to overwrite the old ones on the target node. - // Otherwise, false - AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` + // READ-ONLY; If true - new configurations downloaded from the pull service are allowed to overwrite the old ones on the target + // node. Otherwise, false + AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty" azure:"ro"` - // Specifies how the LCM(Local Configuration Manager) actually applies the configuration to the target nodes. Possible values - // are ApplyOnly, ApplyAndMonitor, and ApplyAndAutoCorrect. - ConfigurationMode *ConfigurationMode `json:"configurationMode,omitempty"` + // READ-ONLY; Specifies how the LCM(Local Configuration Manager) actually applies the configuration to the target nodes. Possible + // values are ApplyOnly, ApplyAndMonitor, and ApplyAndAutoCorrect. + ConfigurationMode *ConfigurationMode `json:"configurationMode,omitempty" azure:"ro"` - // How often, in minutes, the current configuration is checked and applied. This property is ignored if the ConfigurationMode + // READ-ONLY; How often, in minutes, the current configuration is checked and applied. This property is ignored if the ConfigurationMode // property is set to ApplyOnly. The default value is 15. - ConfigurationModeFrequencyMins *float32 `json:"configurationModeFrequencyMins,omitempty"` + ConfigurationModeFrequencyMins *float32 `json:"configurationModeFrequencyMins,omitempty" azure:"ro"` - // Set this to true to automatically reboot the node after a configuration that requires reboot is applied. Otherwise, you - // will have to manually reboot the node for any configuration that requires it. + // READ-ONLY; Set this to true to automatically reboot the node after a configuration that requires reboot is applied. Otherwise, + // you will have to manually reboot the node for any configuration that requires it. // The default value is false. To use this setting when a reboot condition is enacted by something other than DSC (such as // Windows Installer), combine this setting with the xPendingReboot module. - RebootIfNeeded *bool `json:"rebootIfNeeded,omitempty"` + RebootIfNeeded *bool `json:"rebootIfNeeded,omitempty" azure:"ro"` - // The time interval, in minutes, at which the LCM checks a pull service to get updated configurations. This value is ignored - // if the LCM is not configured in pull mode. The default value is 30. - RefreshFrequencyMins *float32 `json:"refreshFrequencyMins,omitempty"` + // READ-ONLY; The time interval, in minutes, at which the LCM checks a pull service to get updated configurations. This value + // is ignored if the LCM is not configured in pull mode. The default value is 30. + RefreshFrequencyMins *float32 `json:"refreshFrequencyMins,omitempty" azure:"ro"` } // ErrorResponse - Error response of an operation failure @@ -348,9 +376,6 @@ type Navigation struct { // The protected configuration parameters for the guest configuration. ConfigurationProtectedParameter []*ConfigurationParameter `json:"configurationProtectedParameter,omitempty"` - // The configuration setting for the guest configuration. - ConfigurationSetting *ConfigurationSetting `json:"configurationSetting,omitempty"` - // Combined hash of the guest configuration package and configuration parameters. ContentHash *string `json:"contentHash,omitempty"` @@ -366,6 +391,12 @@ type Navigation struct { // Version of the guest configuration. Version *string `json:"version,omitempty"` + // READ-ONLY; Specifies the origin of the configuration. + AssignmentSource *string `json:"assignmentSource,omitempty" azure:"ro"` + + // READ-ONLY; The configuration setting for the guest configuration. + ConfigurationSetting *ConfigurationSetting `json:"configurationSetting,omitempty" azure:"ro"` + // READ-ONLY; Specifies the content type of the configuration. Possible values could be Builtin or Custom. ContentType *string `json:"contentType,omitempty" azure:"ro"` } @@ -444,6 +475,27 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + // VMInfo - Information about the VM. type VMInfo struct { // READ-ONLY; Azure resource Id of the VM. diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go index 3f2a65a698b8..99ad47287327 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go @@ -273,6 +273,7 @@ func (c *CommonAssignmentReport) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Navigation. func (n Navigation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "assignmentSource", n.AssignmentSource) populate(objectMap, "assignmentType", n.AssignmentType) populate(objectMap, "configurationParameter", n.ConfigurationParameter) populate(objectMap, "configurationProtectedParameter", n.ConfigurationProtectedParameter) @@ -293,6 +294,53 @@ func (o OperationList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VMSSVMInfo. func (v VMSSVMInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go index 268b4340e835..91bc896be3c6 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go @@ -81,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-06-25") + reqQP.Set("api-version", "2022-01-25") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go index c1081846324a..79b444da5352 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go @@ -18,6 +18,16 @@ type AssignmentReportsClientListResponse struct { AssignmentReportList } +// AssignmentReportsVMSSClientGetResponse contains the response from method AssignmentReportsVMSSClient.Get. +type AssignmentReportsVMSSClientGetResponse struct { + AssignmentReport +} + +// AssignmentReportsVMSSClientListResponse contains the response from method AssignmentReportsVMSSClient.List. +type AssignmentReportsVMSSClientListResponse struct { + AssignmentReportList +} + // AssignmentsClientCreateOrUpdateResponse contains the response from method AssignmentsClient.CreateOrUpdate. type AssignmentsClientCreateOrUpdateResponse struct { Assignment @@ -48,6 +58,21 @@ type AssignmentsClientSubscriptionListResponse struct { AssignmentList } +// AssignmentsVMSSClientDeleteResponse contains the response from method AssignmentsVMSSClient.Delete. +type AssignmentsVMSSClientDeleteResponse struct { + Assignment +} + +// AssignmentsVMSSClientGetResponse contains the response from method AssignmentsVMSSClient.Get. +type AssignmentsVMSSClientGetResponse struct { + Assignment +} + +// AssignmentsVMSSClientListResponse contains the response from method AssignmentsVMSSClient.List. +type AssignmentsVMSSClientListResponse struct { + AssignmentList +} + // HCRPAssignmentReportsClientGetResponse contains the response from method HCRPAssignmentReportsClient.Get. type HCRPAssignmentReportsClientGetResponse struct { AssignmentReport