diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md index f748f5048203..7bf55f46c349 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md @@ -1,5 +1,51 @@ # Release History +## 0.5.0 (2022-05-17) +### Breaking Changes + +- Function `*PrivateEndpointConnectionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` to `(*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- Function `*MachineExtensionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[MachineExtensionsClientDeleteResponse], error)` to `(*runtime.Poller[MachineExtensionsClientDeleteResponse], error)` +- Function `*PrivateLinkScopesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[PrivateLinkScopesClientDeleteResponse], error)` to `(*runtime.Poller[PrivateLinkScopesClientDeleteResponse], error)` +- Function `*MachineExtensionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[MachineExtensionsClientUpdateResponse], error)` to `(*runtime.Poller[MachineExtensionsClientUpdateResponse], error)` +- Function `*MachineExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[MachineExtensionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[MachineExtensionsClientCreateOrUpdateResponse], error)` +- Function `*ManagementClient.BeginUpgradeExtensions` return value(s) have been changed from `(*armruntime.Poller[ManagementClientUpgradeExtensionsResponse], error)` to `(*runtime.Poller[ManagementClientUpgradeExtensionsResponse], error)` +- Function `*PrivateEndpointConnectionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)` +- Type of `PatchSettings.AssessmentMode` has been changed from `*string` to `*AssessmentModeTypes` +- Type of `PatchSettings.PatchMode` has been changed from `*string` to `*PatchModeTypes` +- Function `PrivateLinkScopeValidationDetails.MarshalJSON` has been removed +- Function `PrivateEndpointConnectionListResult.MarshalJSON` has been removed +- Function `MachineExtensionsListResult.MarshalJSON` has been removed +- Function `MachineListResult.MarshalJSON` has been removed +- Function `PrivateLinkScopeListResult.MarshalJSON` has been removed +- Function `OperationListResult.MarshalJSON` has been removed +- Function `PrivateLinkResourceListResult.MarshalJSON` has been removed + +### Features Added + +- New const `PatchModeTypesAutomaticByOS` +- New const `PatchModeTypesManual` +- New const `AssessmentModeTypesImageDefault` +- New const `PatchModeTypesImageDefault` +- New const `PatchModeTypesAutomaticByPlatform` +- New const `AssessmentModeTypesAutomaticByPlatform` +- New function `PrivateEndpointConnectionProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleAssessmentModeTypesValues() []AssessmentModeTypes` +- New function `PossiblePatchModeTypesValues() []PatchModeTypes` +- New struct `ConfigurationExtension` +- New struct `ServiceStatus` +- New struct `ServiceStatuses` +- New field `ExtensionsAllowList` in struct `AgentConfiguration` +- New field `ExtensionsBlockList` in struct `AgentConfiguration` +- New field `ExtensionsEnabled` in struct `AgentConfiguration` +- New field `GuestConfigurationEnabled` in struct `AgentConfiguration` +- New field `ProxyBypass` in struct `AgentConfiguration` +- New field `Resources` in struct `Machine` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `EnableAutomaticUpgrade` in struct `MachineExtensionUpdateProperties` +- New field `IsDataAction` in struct `OperationValue` +- New field `ServiceStatuses` in struct `MachineProperties` + + ## 0.4.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md index 89325d2cc288..542593e650b8 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/hybridcompute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/hybridcompute/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/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/hybridcompute/armhybridcompute/go.mod b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod index c2f64880ad05..552f3b43192a 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhy 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 v1.0.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 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum index 56d1c32628ae..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum @@ -1,53 +1,12 @@ -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/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/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -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/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/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_hybridcomputemanagementclient_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_hybridcomputemanagementclient_client_test.go deleted file mode 100644 index 1576f0943548..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_hybridcomputemanagementclient_client_test.go +++ /dev/null @@ -1,54 +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 armhybridcompute_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Extensions_Upgrade.json -func ExampleManagementClient_BeginUpgradeExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewManagementClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpgradeExtensions(ctx, - "", - "", - armhybridcompute.MachineExtensionUpgrade{ - ExtensionTargets: map[string]*armhybridcompute.ExtensionTargetProperties{ - "Microsoft.Azure.Monitoring": { - TargetVersion: to.Ptr(""), - }, - "Microsoft.Compute.CustomScriptExtension": { - TargetVersion: to.Ptr(""), - }, - }, - }, - &armhybridcompute.ManagementClientBeginUpgradeExtensionsOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_machineextensions_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_machineextensions_client_test.go deleted file mode 100644 index c7958f6b57e0..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_machineextensions_client_test.go +++ /dev/null @@ -1,170 +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 armhybridcompute_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PUTExtension.json -func ExampleMachineExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachineExtensionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armhybridcompute.MachineExtension{ - Location: to.Ptr(""), - Properties: &armhybridcompute.MachineExtensionProperties{ - Type: to.Ptr(""), - Publisher: to.Ptr(""), - Settings: map[string]interface{}{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - }, - TypeHandlerVersion: to.Ptr(""), - }, - }, - &armhybridcompute.MachineExtensionsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/UpdateExtension.json -func ExampleMachineExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachineExtensionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "", - "", - "", - armhybridcompute.MachineExtensionUpdate{ - Properties: &armhybridcompute.MachineExtensionUpdateProperties{ - Type: to.Ptr(""), - Publisher: to.Ptr(""), - Settings: map[string]interface{}{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"", - }, - TypeHandlerVersion: to.Ptr(""), - }, - }, - &armhybridcompute.MachineExtensionsClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/DELETEExtension.json -func ExampleMachineExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachineExtensionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armhybridcompute.MachineExtensionsClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/GETExtension.json -func ExampleMachineExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachineExtensionsClient("", 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/LISTExtension.json -func ExampleMachineExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachineExtensionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - &armhybridcompute.MachineExtensionsClientListOptions{Expand: 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/hybridcompute/armhybridcompute/ze_generated_example_machines_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_machines_client_test.go deleted file mode 100644 index 7ca4ca42100a..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_machines_client_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. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_CreateOrUpdate.json -func ExampleMachinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armhybridcompute.Machine{ - Location: to.Ptr(""), - Identity: &armhybridcompute.Identity{ - Type: to.Ptr(""), - }, - Properties: &armhybridcompute.MachineProperties{ - ClientPublicKey: to.Ptr(""), - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr(""), - }, - ParentClusterResourceID: to.Ptr(""), - PrivateLinkScopeResourceID: to.Ptr(""), - VMID: 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_Update.json -func ExampleMachinesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - armhybridcompute.MachineUpdate{ - Identity: &armhybridcompute.Identity{ - Type: to.Ptr(""), - }, - Properties: &armhybridcompute.MachineUpdateProperties{ - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr(""), - }, - OSProfile: &armhybridcompute.OSProfile{ - LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(""), - PatchMode: to.Ptr(""), - }, - }, - WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(""), - PatchMode: to.Ptr(""), - }, - }, - }, - ParentClusterResourceID: to.Ptr(""), - PrivateLinkScopeResourceID: 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_Delete.json -func ExampleMachinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_Get.json -func ExampleMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - &armhybridcompute.MachinesClientGetOptions{Expand: 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_ListByResourceGroup.json -func ExampleMachinesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Machines_ListBySubscription.json -func ExampleMachinesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewMachinesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(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/hybridcompute/armhybridcompute/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_operations_client_test.go deleted file mode 100644 index 622c8dac3720..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/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 armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.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/hybridcompute/armhybridcompute/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index d45b88add12d..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,130 +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 armhybridcompute_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateEndpointConnectionsClient("", 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateEndpointConnectionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armhybridcompute.PrivateEndpointConnection{ - Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr(""), - Status: to.Ptr(""), - }, - }, - }, - &armhybridcompute.PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateEndpointConnectionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armhybridcompute.PrivateEndpointConnectionsClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateEndpointConnectionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPrivateLinkScopePager("", - "", - 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/hybridcompute/armhybridcompute/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 824c284e05b4..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,67 +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 armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json -func ExamplePrivateLinkResourcesClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkResourcesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPrivateLinkScopePager("", - "", - 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkResourcesClient("", 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/hybridcompute/armhybridcompute/ze_generated_example_privatelinkscopes_client_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privatelinkscopes_client_test.go deleted file mode 100644 index a9e702e8df58..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/ze_generated_example_privatelinkscopes_client_test.go +++ /dev/null @@ -1,214 +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 armhybridcompute_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesList.json -func ExamplePrivateLinkScopesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesListByResourceGroup.json -func ExamplePrivateLinkScopesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesDelete.json -func ExamplePrivateLinkScopesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - &armhybridcompute.PrivateLinkScopesClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesGet.json -func ExamplePrivateLinkScopesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesCreate.json -func ExamplePrivateLinkScopesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armhybridcompute.PrivateLinkScope{ - Location: 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesUpdateTagsOnly.json -func ExamplePrivateLinkScopesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "", - "", - armhybridcompute.TagsResource{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - "Tag2": to.Ptr("Value2"), - }, - }, - 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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesGetValidation.json -func ExamplePrivateLinkScopesClient_GetValidationDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetValidationDetails(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/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-12-10-preview/examples/PrivateLinkScopesGetValidationForMachine.json -func ExamplePrivateLinkScopesClient_GetValidationDetailsForMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcompute.NewPrivateLinkScopesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetValidationDetailsForMachine(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_constants.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_constants.go index c50177647a21..52ac37024ba4 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_constants.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_constants.go @@ -10,9 +10,25 @@ package armhybridcompute const ( moduleName = "armhybridcompute" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) +// AssessmentModeTypes - Specifies the assessment mode. +type AssessmentModeTypes string + +const ( + AssessmentModeTypesAutomaticByPlatform AssessmentModeTypes = "AutomaticByPlatform" + AssessmentModeTypesImageDefault AssessmentModeTypes = "ImageDefault" +) + +// PossibleAssessmentModeTypesValues returns the possible values for the AssessmentModeTypes const type. +func PossibleAssessmentModeTypesValues() []AssessmentModeTypes { + return []AssessmentModeTypes{ + AssessmentModeTypesAutomaticByPlatform, + AssessmentModeTypesImageDefault, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -46,6 +62,26 @@ func PossibleInstanceViewTypesValues() []InstanceViewTypes { } } +// PatchModeTypes - Specifies the patch mode. +type PatchModeTypes string + +const ( + PatchModeTypesAutomaticByOS PatchModeTypes = "AutomaticByOS" + PatchModeTypesAutomaticByPlatform PatchModeTypes = "AutomaticByPlatform" + PatchModeTypesImageDefault PatchModeTypes = "ImageDefault" + PatchModeTypesManual PatchModeTypes = "Manual" +) + +// PossiblePatchModeTypesValues returns the possible values for the PatchModeTypes const type. +func PossiblePatchModeTypesValues() []PatchModeTypes { + return []PatchModeTypes{ + PatchModeTypesAutomaticByOS, + PatchModeTypesAutomaticByPlatform, + PatchModeTypesImageDefault, + PatchModeTypesManual, + } +} + // PublicNetworkAccessType - The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. // Defaults to disabled (access to Azure Arc services only via private link). type PublicNetworkAccessType string diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machineextensions_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machineextensions_client.go index c0420ad991f9..46a8fddb65dd 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machineextensions_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machineextensions_client.go @@ -38,7 +38,7 @@ func NewMachineExtensionsClient(subscriptionID string, credential azcore.TokenCr if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,26 +56,28 @@ func NewMachineExtensionsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the machine where the extension should be created or updated. // extensionName - The name of the machine extension. // extensionParameters - Parameters supplied to the Create Machine Extension operation. // options - MachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginCreateOrUpdate // method. -func (client *MachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtension, options *MachineExtensionsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[MachineExtensionsClientCreateOrUpdateResponse], error) { +func (client *MachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtension, options *MachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[MachineExtensionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { return nil, err } - return armruntime.NewPoller[MachineExtensionsClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller[MachineExtensionsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[MachineExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MachineExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } } // CreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *MachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtension, options *MachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { @@ -115,33 +117,35 @@ func (client *MachineExtensionsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionParameters) } // BeginDelete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the machine where the extension should be deleted. // extensionName - The name of the machine extension. // options - MachineExtensionsClientBeginDeleteOptions contains the optional parameters for the MachineExtensionsClient.BeginDelete // method. -func (client *MachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientBeginDeleteOptions) (*armruntime.Poller[MachineExtensionsClientDeleteResponse], error) { +func (client *MachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[MachineExtensionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, machineName, extensionName, options) if err != nil { return nil, err } - return armruntime.NewPoller[MachineExtensionsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller[MachineExtensionsClientDeleteResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[MachineExtensionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MachineExtensionsClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *MachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, extensionName, options) if err != nil { @@ -181,14 +185,15 @@ func (client *MachineExtensionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - The operation to get the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the machine containing the extension. // extensionName - The name of the machine extension. @@ -232,9 +237,9 @@ func (client *MachineExtensionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -249,11 +254,12 @@ func (client *MachineExtensionsClient) getHandleResponse(resp *http.Response) (M // NewListPager - The operation to get all extensions of a non-Azure machine // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the machine containing the extension. // options - MachineExtensionsClientListOptions contains the optional parameters for the MachineExtensionsClient.List method. func (client *MachineExtensionsClient) NewListPager(resourceGroupName string, machineName string, options *MachineExtensionsClientListOptions) *runtime.Pager[MachineExtensionsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[MachineExtensionsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[MachineExtensionsClientListResponse]{ More: func(page MachineExtensionsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -303,9 +309,9 @@ func (client *MachineExtensionsClient) listCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -320,26 +326,28 @@ func (client *MachineExtensionsClient) listHandleResponse(resp *http.Response) ( // BeginUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the machine where the extension should be created or updated. // extensionName - The name of the machine extension. // extensionParameters - Parameters supplied to the Create Machine Extension operation. // options - MachineExtensionsClientBeginUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginUpdate // method. -func (client *MachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtensionUpdate, options *MachineExtensionsClientBeginUpdateOptions) (*armruntime.Poller[MachineExtensionsClientUpdateResponse], error) { +func (client *MachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtensionUpdate, options *MachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[MachineExtensionsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { return nil, err } - return armruntime.NewPoller[MachineExtensionsClientUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller[MachineExtensionsClientUpdateResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[MachineExtensionsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MachineExtensionsClientUpdateResponse](options.ResumeToken, client.pl, nil) } } // Update - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *MachineExtensionsClient) update(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtensionUpdate, options *MachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { @@ -379,8 +387,8 @@ func (client *MachineExtensionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionParameters) } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machines_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machines_client.go index 6755ea65c23a..424d98ef93e6 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machines_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_machines_client.go @@ -38,7 +38,7 @@ func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - The operation to create or update a hybrid machine resource identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the hybrid machine. // parameters - Parameters supplied to the Create hybrid machine operation. @@ -95,9 +96,9 @@ func (client *MachinesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -112,6 +113,7 @@ func (client *MachinesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - The operation to remove a hybrid machine identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the hybrid machine. // options - MachinesClientDeleteOptions contains the optional parameters for the MachinesClient.Delete method. @@ -150,14 +152,15 @@ func (client *MachinesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Retrieves information about the model view or the instance view of a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the hybrid machine. // options - MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. @@ -196,12 +199,12 @@ func (client *MachinesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -217,11 +220,12 @@ func (client *MachinesClient) getHandleResponse(resp *http.Response) (MachinesCl // NewListByResourceGroupPager - Lists all the hybrid machines in the specified resource group. Use the nextLink property // in the response to get the next page of hybrid machines. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.ListByResourceGroup // method. func (client *MachinesClient) NewListByResourceGroupPager(resourceGroupName string, options *MachinesClientListByResourceGroupOptions) *runtime.Pager[MachinesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[MachinesClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[MachinesClientListByResourceGroupResponse]{ More: func(page MachinesClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -264,9 +268,9 @@ func (client *MachinesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -282,10 +286,11 @@ func (client *MachinesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists all the hybrid machines in the specified subscription. Use the nextLink property in // the response to get the next page of hybrid machines. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // options - MachinesClientListBySubscriptionOptions contains the optional parameters for the MachinesClient.ListBySubscription // method. func (client *MachinesClient) NewListBySubscriptionPager(options *MachinesClientListBySubscriptionOptions) *runtime.Pager[MachinesClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PageProcessor[MachinesClientListBySubscriptionResponse]{ + return runtime.NewPager(runtime.PagingHandler[MachinesClientListBySubscriptionResponse]{ More: func(page MachinesClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -324,9 +329,9 @@ func (client *MachinesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -341,6 +346,7 @@ func (client *MachinesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - The operation to update a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the hybrid machine. // parameters - Parameters supplied to the Update hybrid machine operation. @@ -380,9 +386,9 @@ func (client *MachinesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_management_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_management_client.go index 96b78694ed55..ecb7e5d99135 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_management_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_management_client.go @@ -38,7 +38,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,25 +56,27 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // BeginUpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the hybrid machine. // extensionUpgradeParameters - Parameters supplied to the Upgrade Extensions operation. // options - ManagementClientBeginUpgradeExtensionsOptions contains the optional parameters for the ManagementClient.BeginUpgradeExtensions // method. -func (client *ManagementClient) BeginUpgradeExtensions(ctx context.Context, resourceGroupName string, machineName string, extensionUpgradeParameters MachineExtensionUpgrade, options *ManagementClientBeginUpgradeExtensionsOptions) (*armruntime.Poller[ManagementClientUpgradeExtensionsResponse], error) { +func (client *ManagementClient) BeginUpgradeExtensions(ctx context.Context, resourceGroupName string, machineName string, extensionUpgradeParameters MachineExtensionUpgrade, options *ManagementClientBeginUpgradeExtensionsOptions) (*runtime.Poller[ManagementClientUpgradeExtensionsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.upgradeExtensions(ctx, resourceGroupName, machineName, extensionUpgradeParameters, options) if err != nil { return nil, err } - return armruntime.NewPoller[ManagementClientUpgradeExtensionsResponse](resp, client.pl, nil) + return runtime.NewPoller[ManagementClientUpgradeExtensionsResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[ManagementClientUpgradeExtensionsResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[ManagementClientUpgradeExtensionsResponse](options.ResumeToken, client.pl, nil) } } // UpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *ManagementClient) upgradeExtensions(ctx context.Context, resourceGroupName string, machineName string, extensionUpgradeParameters MachineExtensionUpgrade, options *ManagementClientBeginUpgradeExtensionsOptions) (*http.Response, error) { req, err := client.upgradeExtensionsCreateRequest(ctx, resourceGroupName, machineName, extensionUpgradeParameters, options) if err != nil { @@ -110,8 +112,8 @@ func (client *ManagementClient) upgradeExtensionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionUpgradeParameters) } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models.go index 5f6896746fde..3a778bcedd93 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models.go @@ -13,9 +13,24 @@ import "time" // AgentConfiguration - Configurable properties that the user can set locally via the azcmagent config command, or remotely // via ARM. type AgentConfiguration struct { + // READ-ONLY; Array of extensions that are allowed to be installed or updated. + ExtensionsAllowList []*ConfigurationExtension `json:"extensionsAllowList,omitempty" azure:"ro"` + + // READ-ONLY; Array of extensions that are blocked (cannot be installed or updated) + ExtensionsBlockList []*ConfigurationExtension `json:"extensionsBlockList,omitempty" azure:"ro"` + + // READ-ONLY; Specifies whether the extension service is enabled or disabled. + ExtensionsEnabled *string `json:"extensionsEnabled,omitempty" azure:"ro"` + + // READ-ONLY; Specified whether the guest configuration service is enabled or disabled. + GuestConfigurationEnabled *string `json:"guestConfigurationEnabled,omitempty" azure:"ro"` + // READ-ONLY; Specifies the list of ports that the agent will be able to listen on. IncomingConnectionsPorts []*string `json:"incomingConnectionsPorts,omitempty" azure:"ro"` + // READ-ONLY; List of service names which should not use the specified proxy server. + ProxyBypass []*string `json:"proxyBypass,omitempty" azure:"ro"` + // READ-ONLY; Specifies the URL of the proxy to be used. ProxyURL *string `json:"proxyUrl,omitempty" azure:"ro"` } @@ -26,6 +41,15 @@ type CloudMetadata struct { Provider *string `json:"provider,omitempty" azure:"ro"` } +// ConfigurationExtension - Describes properties that can identify extensions. +type ConfigurationExtension struct { + // READ-ONLY; Publisher of the extension. + Publisher *string `json:"publisher,omitempty" azure:"ro"` + + // READ-ONLY; Type of the extension. + Type *string `json:"type,omitempty" azure:"ro"` +} + type ConnectionDetail struct { // READ-ONLY; The private endpoint connection group id GroupID *string `json:"groupId,omitempty" azure:"ro"` @@ -130,6 +154,9 @@ type Machine struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; The list of extensions affliated to the machine + Resources []*MachineExtension `json:"resources,omitempty" azure:"ro"` + // READ-ONLY; The system meta data relating to this resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` @@ -245,6 +272,9 @@ type MachineExtensionUpdateProperties struct { // with this property set to true. AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` @@ -322,9 +352,6 @@ type MachineListResult struct { // MachineProperties - Describes the properties of a hybrid machine. type MachineProperties struct { - // Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - AgentConfiguration *AgentConfiguration `json:"agentConfiguration,omitempty"` - // Public Key that the client provides to be used during initial resource onboarding ClientPublicKey *string `json:"clientPublicKey,omitempty"` @@ -352,12 +379,18 @@ type MachineProperties struct { // The resource id of the private link scope this machine is assigned to, if any. PrivateLinkScopeResourceID *string `json:"privateLinkScopeResourceId,omitempty"` + // Statuses of dependent services that are reported back to ARM. + ServiceStatuses *ServiceStatuses `json:"serviceStatuses,omitempty"` + // Specifies the hybrid machine unique ID. VMID *string `json:"vmId,omitempty"` // READ-ONLY; Specifies the AD fully qualified display name. AdFqdn *string `json:"adFqdn,omitempty" azure:"ro"` + // READ-ONLY; Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + AgentConfiguration *AgentConfiguration `json:"agentConfiguration,omitempty" azure:"ro"` + // READ-ONLY; The hybrid machine agent full version. AgentVersion *string `json:"agentVersion,omitempty" azure:"ro"` @@ -504,6 +537,9 @@ type OperationValue struct { // Display properties Display *OperationValueDisplay `json:"display,omitempty"` + // READ-ONLY; This property indicates if the operation is an action or a data action + IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + // READ-ONLY; The name of the compute operation. Name *string `json:"name,omitempty" azure:"ro"` @@ -534,10 +570,10 @@ type OperationsClientListOptions struct { // PatchSettings - Specifies the patch settings. type PatchSettings struct { // Specifies the assessment mode. - AssessmentMode *string `json:"assessmentMode,omitempty"` + AssessmentMode *AssessmentModeTypes `json:"assessmentMode,omitempty"` // Specifies the patch mode. - PatchMode *string `json:"patchMode,omitempty"` + PatchMode *PatchModeTypes `json:"patchMode,omitempty"` } // PrivateEndpointConnection - A private endpoint connection @@ -590,6 +626,9 @@ type PrivateEndpointConnectionProperties struct { // Connection state of the private endpoint connection. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // READ-ONLY; List of group IDs. + GroupIDs []*string `json:"groupIds,omitempty" azure:"ro"` + // READ-ONLY; State of the private endpoint connection. ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` } @@ -845,6 +884,24 @@ type ResourceUpdate struct { Tags map[string]*string `json:"tags,omitempty"` } +// ServiceStatus - Describes the status and behavior of a service. +type ServiceStatus struct { + // The behavior of the service when the Arc-enabled machine starts up. + StartupType *string `json:"startupType,omitempty"` + + // The current status of the service. + Status *string `json:"status,omitempty"` +} + +// ServiceStatuses - Reports the state and behavior of dependent services. +type ServiceStatuses struct { + // The state of the extension service on the Arc-enabled machine. + ExtensionService *ServiceStatus `json:"extensionService,omitempty"` + + // The state of the guest configuration service on the Arc-enabled machine. + GuestConfigurationService *ServiceStatus `json:"guestConfigurationService,omitempty"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models_serde.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models_serde.go index 5e227db49447..1961b306527c 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models_serde.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_models_serde.go @@ -10,6 +10,7 @@ package armhybridcompute import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) @@ -17,7 +18,12 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AgentConfiguration. func (a AgentConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "extensionsAllowList", a.ExtensionsAllowList) + populate(objectMap, "extensionsBlockList", a.ExtensionsBlockList) + populate(objectMap, "extensionsEnabled", a.ExtensionsEnabled) + populate(objectMap, "guestConfigurationEnabled", a.GuestConfigurationEnabled) populate(objectMap, "incomingConnectionsPorts", a.IncomingConnectionsPorts) + populate(objectMap, "proxyBypass", a.ProxyBypass) populate(objectMap, "proxyUrl", a.ProxyURL) return json.Marshal(objectMap) } @@ -41,6 +47,7 @@ func (m Machine) MarshalJSON() ([]byte, error) { populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) + populate(objectMap, "resources", m.Resources) populate(objectMap, "systemData", m.SystemData) populate(objectMap, "tags", m.Tags) populate(objectMap, "type", m.Type) @@ -75,29 +82,29 @@ func (m MachineExtensionInstanceViewStatus) MarshalJSON() ([]byte, error) { func (m *MachineExtensionInstanceViewStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "code": - err = unpopulate(val, &m.Code) + err = unpopulate(val, "Code", &m.Code) delete(rawMsg, key) case "displayStatus": - err = unpopulate(val, &m.DisplayStatus) + err = unpopulate(val, "DisplayStatus", &m.DisplayStatus) delete(rawMsg, key) case "level": - err = unpopulate(val, &m.Level) + err = unpopulate(val, "Level", &m.Level) delete(rawMsg, key) case "message": - err = unpopulate(val, &m.Message) + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) case "time": - err = unpopulateTimeRFC3339(val, &m.Time) + err = unpopulateTimeRFC3339(val, "Time", &m.Time) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil @@ -118,22 +125,6 @@ func (m MachineExtensionUpgrade) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type MachineExtensionsListResult. -func (m MachineExtensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MachineListResult. -func (m MachineListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type MachineProperties. func (m MachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -160,6 +151,7 @@ func (m MachineProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "parentClusterResourceId", m.ParentClusterResourceID) populate(objectMap, "privateLinkScopeResourceId", m.PrivateLinkScopeResourceID) populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "serviceStatuses", m.ServiceStatuses) populate(objectMap, "status", m.Status) populate(objectMap, "vmId", m.VMID) populate(objectMap, "vmUuid", m.VMUUID) @@ -170,92 +162,95 @@ func (m MachineProperties) MarshalJSON() ([]byte, error) { func (m *MachineProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "adFqdn": - err = unpopulate(val, &m.AdFqdn) + err = unpopulate(val, "AdFqdn", &m.AdFqdn) delete(rawMsg, key) case "agentConfiguration": - err = unpopulate(val, &m.AgentConfiguration) + err = unpopulate(val, "AgentConfiguration", &m.AgentConfiguration) delete(rawMsg, key) case "agentVersion": - err = unpopulate(val, &m.AgentVersion) + err = unpopulate(val, "AgentVersion", &m.AgentVersion) delete(rawMsg, key) case "clientPublicKey": - err = unpopulate(val, &m.ClientPublicKey) + err = unpopulate(val, "ClientPublicKey", &m.ClientPublicKey) delete(rawMsg, key) case "cloudMetadata": - err = unpopulate(val, &m.CloudMetadata) + err = unpopulate(val, "CloudMetadata", &m.CloudMetadata) delete(rawMsg, key) case "dnsFqdn": - err = unpopulate(val, &m.DNSFqdn) + err = unpopulate(val, "DNSFqdn", &m.DNSFqdn) delete(rawMsg, key) case "detectedProperties": - err = unpopulate(val, &m.DetectedProperties) + err = unpopulate(val, "DetectedProperties", &m.DetectedProperties) delete(rawMsg, key) case "displayName": - err = unpopulate(val, &m.DisplayName) + err = unpopulate(val, "DisplayName", &m.DisplayName) delete(rawMsg, key) case "domainName": - err = unpopulate(val, &m.DomainName) + err = unpopulate(val, "DomainName", &m.DomainName) delete(rawMsg, key) case "errorDetails": - err = unpopulate(val, &m.ErrorDetails) + err = unpopulate(val, "ErrorDetails", &m.ErrorDetails) delete(rawMsg, key) case "extensions": - err = unpopulate(val, &m.Extensions) + err = unpopulate(val, "Extensions", &m.Extensions) delete(rawMsg, key) case "lastStatusChange": - err = unpopulateTimeRFC3339(val, &m.LastStatusChange) + err = unpopulateTimeRFC3339(val, "LastStatusChange", &m.LastStatusChange) delete(rawMsg, key) case "locationData": - err = unpopulate(val, &m.LocationData) + err = unpopulate(val, "LocationData", &m.LocationData) delete(rawMsg, key) case "machineFqdn": - err = unpopulate(val, &m.MachineFqdn) + err = unpopulate(val, "MachineFqdn", &m.MachineFqdn) delete(rawMsg, key) case "mssqlDiscovered": - err = unpopulate(val, &m.MssqlDiscovered) + err = unpopulate(val, "MssqlDiscovered", &m.MssqlDiscovered) delete(rawMsg, key) case "osName": - err = unpopulate(val, &m.OSName) + err = unpopulate(val, "OSName", &m.OSName) delete(rawMsg, key) case "osProfile": - err = unpopulate(val, &m.OSProfile) + err = unpopulate(val, "OSProfile", &m.OSProfile) delete(rawMsg, key) case "osSku": - err = unpopulate(val, &m.OSSKU) + err = unpopulate(val, "OSSKU", &m.OSSKU) delete(rawMsg, key) case "osType": - err = unpopulate(val, &m.OSType) + err = unpopulate(val, "OSType", &m.OSType) delete(rawMsg, key) case "osVersion": - err = unpopulate(val, &m.OSVersion) + err = unpopulate(val, "OSVersion", &m.OSVersion) delete(rawMsg, key) case "parentClusterResourceId": - err = unpopulate(val, &m.ParentClusterResourceID) + err = unpopulate(val, "ParentClusterResourceID", &m.ParentClusterResourceID) delete(rawMsg, key) case "privateLinkScopeResourceId": - err = unpopulate(val, &m.PrivateLinkScopeResourceID) + err = unpopulate(val, "PrivateLinkScopeResourceID", &m.PrivateLinkScopeResourceID) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, &m.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "serviceStatuses": + err = unpopulate(val, "ServiceStatuses", &m.ServiceStatuses) delete(rawMsg, key) case "status": - err = unpopulate(val, &m.Status) + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) case "vmId": - err = unpopulate(val, &m.VMID) + err = unpopulate(val, "VMID", &m.VMID) delete(rawMsg, key) case "vmUuid": - err = unpopulate(val, &m.VMUUID) + err = unpopulate(val, "VMUUID", &m.VMUUID) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil @@ -270,26 +265,13 @@ func (m MachineUpdate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } @@ -315,14 +297,6 @@ func (p PrivateLinkScope) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopeListResult. -func (p PrivateLinkScopeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopeProperties. func (p PrivateLinkScopeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -333,15 +307,6 @@ func (p PrivateLinkScopeProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopeValidationDetails. -func (p PrivateLinkScopeValidationDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionDetails", p.ConnectionDetails) - populate(objectMap, "id", p.ID) - populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopesResource. func (p PrivateLinkScopesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -376,32 +341,32 @@ func (s SystemData) MarshalJSON() ([]byte, error) { func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": - err = unpopulate(val, &s.CreatedBy) + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": - err = unpopulate(val, &s.CreatedByType) + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -435,9 +400,12 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil } - return json.Unmarshal(data, v) + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_operations_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_operations_client.go index 0359d51ad708..d16256a21239 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_operations_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_operations_client.go @@ -33,7 +33,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -50,9 +50,10 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of hybrid compute operations. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { return false }, @@ -81,9 +82,9 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privateendpointconnections_client.go index c9fff6369c9d..8f078cda0db7 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privateendpointconnections_client.go @@ -38,7 +38,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,25 +56,27 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // privateEndpointConnectionName - The name of the private endpoint connection. // options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate // method. -func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { +func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } } // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -114,33 +116,35 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // privateEndpointConnectionName - The name of the private endpoint connection. // options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. -func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, options) if err != nil { return nil, err } - return armruntime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, options) if err != nil { @@ -180,14 +184,15 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -232,9 +237,9 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -249,12 +254,13 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByPrivateLinkScopePager - Gets all private endpoint connections on a private link scope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // options - PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByPrivateLinkScope // method. func (client *PrivateEndpointConnectionsClient) NewListByPrivateLinkScopePager(resourceGroupName string, scopeName string, options *PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse] { - return runtime.NewPager(runtime.PageProcessor[PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse]{ + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse]{ More: func(page PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -301,9 +307,9 @@ func (client *PrivateEndpointConnectionsClient) listByPrivateLinkScopeCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkresources_client.go index ddbe41dcd3a4..38b63e916493 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkresources_client.go @@ -38,7 +38,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // groupName - The name of the private link resource. @@ -100,9 +101,9 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -117,12 +118,13 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByPrivateLinkScopePager - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // options - PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByPrivateLinkScope // method. func (client *PrivateLinkResourcesClient) NewListByPrivateLinkScopePager(resourceGroupName string, scopeName string, options *PrivateLinkResourcesClientListByPrivateLinkScopeOptions) *runtime.Pager[PrivateLinkResourcesClientListByPrivateLinkScopeResponse] { - return runtime.NewPager(runtime.PageProcessor[PrivateLinkResourcesClientListByPrivateLinkScopeResponse]{ + return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByPrivateLinkScopeResponse]{ More: func(page PrivateLinkResourcesClientListByPrivateLinkScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -169,9 +171,9 @@ func (client *PrivateLinkResourcesClient) listByPrivateLinkScopeCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkscopes_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkscopes_client.go index 8810bf417efe..f719f4a0d417 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkscopes_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_privatelinkscopes_client.go @@ -38,7 +38,7 @@ func NewPrivateLinkScopesClient(subscriptionID string, credential azcore.TokenCr if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewPrivateLinkScopesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey // nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // parameters - Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. @@ -97,9 +98,9 @@ func (client *PrivateLinkScopesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -114,24 +115,26 @@ func (client *PrivateLinkScopesClient) createOrUpdateHandleResponse(resp *http.R // BeginDelete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // options - PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete // method. -func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*armruntime.Poller[PrivateLinkScopesClientDeleteResponse], error) { +func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*runtime.Poller[PrivateLinkScopesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, scopeName, options) if err != nil { return nil, err } - return armruntime.NewPoller[PrivateLinkScopesClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller[PrivateLinkScopesClientDeleteResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[PrivateLinkScopesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PrivateLinkScopesClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview func (client *PrivateLinkScopesClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, options) if err != nil { @@ -167,14 +170,15 @@ func (client *PrivateLinkScopesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // options - PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. @@ -213,9 +217,9 @@ func (client *PrivateLinkScopesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -230,6 +234,7 @@ func (client *PrivateLinkScopesClient) getHandleResponse(resp *http.Response) (P // GetValidationDetails - Returns a Azure Arc PrivateLinkScope's validation details. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // location - The location of the target resource. // privateLinkScopeID - The id (Guid) of the Azure Arc PrivateLinkScope resource. // options - PrivateLinkScopesClientGetValidationDetailsOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetails @@ -269,9 +274,9 @@ func (client *PrivateLinkScopesClient) getValidationDetailsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -286,6 +291,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsHandleResponse(resp * // GetValidationDetailsForMachine - Returns a Azure Arc PrivateLinkScope's validation details for a given machine. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // machineName - The name of the target machine to get the private link scope validation details for. // options - PrivateLinkScopesClientGetValidationDetailsForMachineOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetailsForMachine @@ -325,9 +331,9 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -342,9 +348,10 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineHandleRespo // NewListPager - Gets a list of all Azure Arc PrivateLinkScopes within a subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // options - PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.List method. func (client *PrivateLinkScopesClient) NewListPager(options *PrivateLinkScopesClientListOptions) *runtime.Pager[PrivateLinkScopesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[PrivateLinkScopesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[PrivateLinkScopesClientListResponse]{ More: func(page PrivateLinkScopesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -383,9 +390,9 @@ func (client *PrivateLinkScopesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -400,11 +407,12 @@ func (client *PrivateLinkScopesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Gets a list of Azure Arc PrivateLinkScopes within a resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.ListByResourceGroup // method. func (client *PrivateLinkScopesClient) NewListByResourceGroupPager(resourceGroupName string, options *PrivateLinkScopesClientListByResourceGroupOptions) *runtime.Pager[PrivateLinkScopesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[PrivateLinkScopesClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[PrivateLinkScopesClientListByResourceGroupResponse]{ More: func(page PrivateLinkScopesClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -447,9 +455,9 @@ func (client *PrivateLinkScopesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -464,6 +472,7 @@ func (client *PrivateLinkScopesClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scopeName - The name of the Azure Arc PrivateLinkScope resource. // privateLinkScopeTags - Updated tag information to set into the PrivateLinkScope instance. @@ -504,9 +513,9 @@ func (client *PrivateLinkScopesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-10-preview") + reqQP.Set("api-version", "2022-05-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateLinkScopeTags) } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_time_rfc3339.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_time_rfc3339.go index c7464c73af25..373fd56188c5 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armhybridcompute import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" @@ -72,13 +73,13 @@ func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { m[k] = (*timeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } var aux timeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { - return err + return fmt.Errorf("struct field %s: %v", fn, err) } *t = (*time.Time)(&aux) return nil