From 87dca7680341d6babcdd47b37a2dc87e3ea5b908 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Jan 2023 18:18:41 +0000 Subject: [PATCH] CodeGen from PR 21737 in Azure/azure-rest-api-specs Merge 5fa7a04fc85c9c8d3ea964eb7f0e62e566483b05 into 7b47689d4efc098f25f46781f05f22179c153314 --- .../CHANGELOG.md | 14 + .../armdeviceprovisioningservices/autorest.md | 6 +- ...zz_generated_constants.go => constants.go} | 3 +- ...ate_client.go => dpscertificate_client.go} | 103 +- .../armdeviceprovisioningservices/go.mod | 16 +- .../armdeviceprovisioningservices/go.sum | 24 +- ...rce_client.go => iotdpsresource_client.go} | 256 +-- .../{zz_generated_models.go => models.go} | 29 +- .../models_serde.go | 1373 +++++++++++++++++ ...rations_client.go => operations_client.go} | 13 +- ...ed_response_types.go => response_types.go} | 21 +- ...erated_time_rfc1123.go => time_rfc1123.go} | 3 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ...ated_example_dpscertificate_client_test.go | 185 --- ...ated_example_iotdpsresource_client_test.go | 429 ----- ...enerated_example_operations_client_test.go | 41 - .../zz_generated_models_serde.go | 237 --- 17 files changed, 1637 insertions(+), 1119 deletions(-) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_dpscertificate_client.go => dpscertificate_client.go} (87%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_iotdpsresource_client.go => iotdpsresource_client.go} (87%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_models.go => models.go} (96%) create mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models_serde.go rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_operations_client.go => operations_client.go} (90%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_response_types.go => response_types.go} (88%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_time_rfc1123.go => time_rfc1123.go} (94%) rename sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md index d7cfc54aa6bb..c058af348871 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 2.0.0 (2023-01-24) +### Breaking Changes + +- Type of `ErrorDetails.Code` has been changed from `*string` to `*int32` + +### Features Added + +- New field `PortalOperationsHostName` in struct `IotDpsPropertiesDescription` +- New field `Resourcegroup` in struct `ProvisioningServiceDescription` +- New field `Subscriptionid` in struct `ProvisioningServiceDescription` +- New field `Resourcegroup` in struct `Resource` +- New field `Subscriptionid` in struct `Resource` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md index 81be3f4008dc..177b7eae1565 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/deviceprovisioningservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/deviceprovisioningservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/deviceprovisioningservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/deviceprovisioningservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/constants.go similarity index 99% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/constants.go index 955c4224b41d..3cb304176d1b 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices const ( moduleName = "armdeviceprovisioningservices" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // AccessRightsDescription - Rights that this key has. diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/dpscertificate_client.go similarity index 87% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/dpscertificate_client.go index 8d635985850d..63504c6fc39f 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/dpscertificate_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -34,9 +35,9 @@ type DpsCertificateClient struct { } // NewDpsCertificateClient creates a new instance of DpsCertificateClient with the specified values. -// subscriptionID - The subscription identifier. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription identifier. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDpsCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DpsCertificateClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,13 +60,14 @@ func NewDpsCertificateClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Add new certificate or update an existing certificate. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - Resource group identifier. -// provisioningServiceName - The name of the provisioning service. -// certificateName - The name of the certificate create or update. -// certificateDescription - The certificate body. -// options - DpsCertificateClientCreateOrUpdateOptions contains the optional parameters for the DpsCertificateClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Resource group identifier. +// - provisioningServiceName - The name of the provisioning service. +// - certificateName - The name of the certificate create or update. +// - certificateDescription - The certificate body. +// - options - DpsCertificateClientCreateOrUpdateOptions contains the optional parameters for the DpsCertificateClient.CreateOrUpdate +// method. func (client *DpsCertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, certificateName string, certificateDescription CertificateResponse, options *DpsCertificateClientCreateOrUpdateOptions) (DpsCertificateClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, provisioningServiceName, certificateName, certificateDescription, options) if err != nil { @@ -105,7 +107,7 @@ func (client *DpsCertificateClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -125,13 +127,14 @@ func (client *DpsCertificateClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes the specified certificate associated with the Provisioning Service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - Resource group identifier. -// ifMatch - ETag of the certificate -// provisioningServiceName - The name of the provisioning service. -// certificateName - This is a mandatory field, and is the logical name of the certificate that the provisioning service will -// access by. -// options - DpsCertificateClientDeleteOptions contains the optional parameters for the DpsCertificateClient.Delete method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Resource group identifier. +// - ifMatch - ETag of the certificate +// - provisioningServiceName - The name of the provisioning service. +// - certificateName - This is a mandatory field, and is the logical name of the certificate that the provisioning service will +// access by. +// - options - DpsCertificateClientDeleteOptions contains the optional parameters for the DpsCertificateClient.Delete method. func (client *DpsCertificateClient) Delete(ctx context.Context, resourceGroupName string, ifMatch string, provisioningServiceName string, certificateName string, options *DpsCertificateClientDeleteOptions) (DpsCertificateClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, ifMatch, provisioningServiceName, certificateName, options) if err != nil { @@ -195,7 +198,7 @@ func (client *DpsCertificateClient) deleteCreateRequest(ctx context.Context, res if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -204,14 +207,15 @@ func (client *DpsCertificateClient) deleteCreateRequest(ctx context.Context, res // GenerateVerificationCode - Generate verification code for Proof of Possession. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// certificateName - The mandatory logical name of the certificate, that the provisioning service uses to access. -// ifMatch - ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand -// new certificate. -// resourceGroupName - name of resource group. -// provisioningServiceName - Name of provisioning service. -// options - DpsCertificateClientGenerateVerificationCodeOptions contains the optional parameters for the DpsCertificateClient.GenerateVerificationCode -// method. +// +// Generated from API version 2022-12-12 +// - certificateName - The mandatory logical name of the certificate, that the provisioning service uses to access. +// - ifMatch - ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand +// new certificate. +// - resourceGroupName - name of resource group. +// - provisioningServiceName - Name of provisioning service. +// - options - DpsCertificateClientGenerateVerificationCodeOptions contains the optional parameters for the DpsCertificateClient.GenerateVerificationCode +// method. func (client *DpsCertificateClient) GenerateVerificationCode(ctx context.Context, certificateName string, ifMatch string, resourceGroupName string, provisioningServiceName string, options *DpsCertificateClientGenerateVerificationCodeOptions) (DpsCertificateClientGenerateVerificationCodeResponse, error) { req, err := client.generateVerificationCodeCreateRequest(ctx, certificateName, ifMatch, resourceGroupName, provisioningServiceName, options) if err != nil { @@ -275,7 +279,7 @@ func (client *DpsCertificateClient) generateVerificationCodeCreateRequest(ctx co if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -293,11 +297,12 @@ func (client *DpsCertificateClient) generateVerificationCodeHandleResponse(resp // Get - Get the certificate from the provisioning service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// certificateName - Name of the certificate to retrieve. -// resourceGroupName - Resource group identifier. -// provisioningServiceName - Name of the provisioning service the certificate is associated with. -// options - DpsCertificateClientGetOptions contains the optional parameters for the DpsCertificateClient.Get method. +// +// Generated from API version 2022-12-12 +// - certificateName - Name of the certificate to retrieve. +// - resourceGroupName - Resource group identifier. +// - provisioningServiceName - Name of the provisioning service the certificate is associated with. +// - options - DpsCertificateClientGetOptions contains the optional parameters for the DpsCertificateClient.Get method. func (client *DpsCertificateClient) Get(ctx context.Context, certificateName string, resourceGroupName string, provisioningServiceName string, options *DpsCertificateClientGetOptions) (DpsCertificateClientGetResponse, error) { req, err := client.getCreateRequest(ctx, certificateName, resourceGroupName, provisioningServiceName, options) if err != nil { @@ -337,7 +342,7 @@ func (client *DpsCertificateClient) getCreateRequest(ctx context.Context, certif return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -357,10 +362,11 @@ func (client *DpsCertificateClient) getHandleResponse(resp *http.Response) (DpsC // List - Get all the certificates tied to the provisioning service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - Name of resource group. -// provisioningServiceName - Name of provisioning service to retrieve certificates for. -// options - DpsCertificateClientListOptions contains the optional parameters for the DpsCertificateClient.List method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Name of resource group. +// - provisioningServiceName - Name of provisioning service to retrieve certificates for. +// - options - DpsCertificateClientListOptions contains the optional parameters for the DpsCertificateClient.List method. func (client *DpsCertificateClient) List(ctx context.Context, resourceGroupName string, provisioningServiceName string, options *DpsCertificateClientListOptions) (DpsCertificateClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, provisioningServiceName, options) if err != nil { @@ -396,7 +402,7 @@ func (client *DpsCertificateClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -414,14 +420,15 @@ func (client *DpsCertificateClient) listHandleResponse(resp *http.Response) (Dps // VerifyCertificate - Verifies the certificate's private key possession by providing the leaf cert issued by the verifying // pre uploaded certificate. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// certificateName - The mandatory logical name of the certificate, that the provisioning service uses to access. -// ifMatch - ETag of the certificate. -// resourceGroupName - Resource group name. -// provisioningServiceName - Provisioning service name. -// request - The name of the certificate -// options - DpsCertificateClientVerifyCertificateOptions contains the optional parameters for the DpsCertificateClient.VerifyCertificate -// method. +// +// Generated from API version 2022-12-12 +// - certificateName - The mandatory logical name of the certificate, that the provisioning service uses to access. +// - ifMatch - ETag of the certificate. +// - resourceGroupName - Resource group name. +// - provisioningServiceName - Provisioning service name. +// - request - The name of the certificate +// - options - DpsCertificateClientVerifyCertificateOptions contains the optional parameters for the DpsCertificateClient.VerifyCertificate +// method. func (client *DpsCertificateClient) VerifyCertificate(ctx context.Context, certificateName string, ifMatch string, resourceGroupName string, provisioningServiceName string, request VerificationCodeRequest, options *DpsCertificateClientVerifyCertificateOptions) (DpsCertificateClientVerifyCertificateResponse, error) { req, err := client.verifyCertificateCreateRequest(ctx, certificateName, ifMatch, resourceGroupName, provisioningServiceName, request, options) if err != nil { @@ -485,7 +492,7 @@ func (client *DpsCertificateClient) verifyCertificateCreateRequest(ctx context.C if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod index 7691e13d240b..21cea64b4803 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/iotdpsresource_client.go similarity index 87% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/iotdpsresource_client.go index 4c9ca912e7f4..85a9197734a7 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/iotdpsresource_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -31,9 +32,9 @@ type IotDpsResourceClient struct { } // NewIotDpsResourceClient creates a new instance of IotDpsResourceClient with the specified values. -// subscriptionID - The subscription identifier. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription identifier. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIotDpsResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotDpsResourceClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +58,11 @@ func NewIotDpsResourceClient(subscriptionID string, credential azcore.TokenCrede // CheckProvisioningServiceNameAvailability - Check if a provisioning service name is available. This will validate if the // name is syntactically valid and if the name is usable // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// arguments - Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. -// options - IotDpsResourceClientCheckProvisioningServiceNameAvailabilityOptions contains the optional parameters for the -// IotDpsResourceClient.CheckProvisioningServiceNameAvailability method. +// +// Generated from API version 2022-12-12 +// - arguments - Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. +// - options - IotDpsResourceClientCheckProvisioningServiceNameAvailabilityOptions contains the optional parameters for the +// IotDpsResourceClient.CheckProvisioningServiceNameAvailability method. func (client *IotDpsResourceClient) CheckProvisioningServiceNameAvailability(ctx context.Context, arguments OperationInputs, options *IotDpsResourceClientCheckProvisioningServiceNameAvailabilityOptions) (IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse, error) { req, err := client.checkProvisioningServiceNameAvailabilityCreateRequest(ctx, arguments, options) if err != nil { @@ -88,7 +90,7 @@ func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, arguments) @@ -107,12 +109,13 @@ func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityHand // is to retrieve the provisioning service metadata and security metadata, and then combine them with the // modified values in a new body to update the provisioning service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - Resource group identifier. -// provisioningServiceName - Name of provisioning service to create or update. -// iotDpsDescription - Description of the provisioning service to create or update. -// options - IotDpsResourceClientBeginCreateOrUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Resource group identifier. +// - provisioningServiceName - Name of provisioning service to create or update. +// - iotDpsDescription - Description of the provisioning service to create or update. +// - options - IotDpsResourceClientBeginCreateOrUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginCreateOrUpdate +// method. func (client *IotDpsResourceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, iotDpsDescription ProvisioningServiceDescription, options *IotDpsResourceClientBeginCreateOrUpdateOptions) (*runtime.Poller[IotDpsResourceClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, provisioningServiceName, iotDpsDescription, options) @@ -129,7 +132,8 @@ func (client *IotDpsResourceClient) BeginCreateOrUpdate(ctx context.Context, res // retrieve the provisioning service metadata and security metadata, and then combine them with the // modified values in a new body to update the provisioning service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 +// +// Generated from API version 2022-12-12 func (client *IotDpsResourceClient) createOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, iotDpsDescription ProvisioningServiceDescription, options *IotDpsResourceClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, provisioningServiceName, iotDpsDescription, options) if err != nil { @@ -165,7 +169,7 @@ func (client *IotDpsResourceClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, iotDpsDescription) @@ -174,13 +178,14 @@ func (client *IotDpsResourceClient) createOrUpdateCreateRequest(ctx context.Cont // BeginCreateOrUpdatePrivateEndpointConnection - Create or update the status of a private endpoint connection with the specified // name // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// privateEndpointConnectionName - The name of the private endpoint connection -// privateEndpointConnection - The private endpoint connection with updated properties -// options - IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions contains the optional parameters for -// the IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - privateEndpointConnectionName - The name of the private endpoint connection +// - privateEndpointConnection - The private endpoint connection with updated properties +// - options - IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions contains the optional parameters for +// the IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection method. func (client *IotDpsResourceClient) BeginCreateOrUpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions) (*runtime.Poller[IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdatePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) @@ -196,7 +201,8 @@ func (client *IotDpsResourceClient) BeginCreateOrUpdatePrivateEndpointConnection // CreateOrUpdatePrivateEndpointConnection - Create or update the status of a private endpoint connection with the specified // name // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 +// +// Generated from API version 2022-12-12 func (client *IotDpsResourceClient) createOrUpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions) (*http.Response, error) { req, err := client.createOrUpdatePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { @@ -236,7 +242,7 @@ func (client *IotDpsResourceClient) createOrUpdatePrivateEndpointConnectionCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnection) @@ -244,11 +250,12 @@ func (client *IotDpsResourceClient) createOrUpdatePrivateEndpointConnectionCreat // BeginDelete - Deletes the Provisioning Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// provisioningServiceName - Name of provisioning service to delete. -// resourceGroupName - Resource group identifier. -// options - IotDpsResourceClientBeginDeleteOptions contains the optional parameters for the IotDpsResourceClient.BeginDelete -// method. +// +// Generated from API version 2022-12-12 +// - provisioningServiceName - Name of provisioning service to delete. +// - resourceGroupName - Resource group identifier. +// - options - IotDpsResourceClientBeginDeleteOptions contains the optional parameters for the IotDpsResourceClient.BeginDelete +// method. func (client *IotDpsResourceClient) BeginDelete(ctx context.Context, provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientBeginDeleteOptions) (*runtime.Poller[IotDpsResourceClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, provisioningServiceName, resourceGroupName, options) @@ -263,7 +270,8 @@ func (client *IotDpsResourceClient) BeginDelete(ctx context.Context, provisionin // Delete - Deletes the Provisioning Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 +// +// Generated from API version 2022-12-12 func (client *IotDpsResourceClient) deleteOperation(ctx context.Context, provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) if err != nil { @@ -299,7 +307,7 @@ func (client *IotDpsResourceClient) deleteCreateRequest(ctx context.Context, pro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,12 +315,13 @@ func (client *IotDpsResourceClient) deleteCreateRequest(ctx context.Context, pro // BeginDeletePrivateEndpointConnection - Delete private endpoint connection with the specified name // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// privateEndpointConnectionName - The name of the private endpoint connection -// options - IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.BeginDeletePrivateEndpointConnection -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - privateEndpointConnectionName - The name of the private endpoint connection +// - options - IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.BeginDeletePrivateEndpointConnection +// method. func (client *IotDpsResourceClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions) (*runtime.Poller[IotDpsResourceClientDeletePrivateEndpointConnectionResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) @@ -327,7 +336,8 @@ func (client *IotDpsResourceClient) BeginDeletePrivateEndpointConnection(ctx con // DeletePrivateEndpointConnection - Delete private endpoint connection with the specified name // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 +// +// Generated from API version 2022-12-12 func (client *IotDpsResourceClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { @@ -367,7 +377,7 @@ func (client *IotDpsResourceClient) deletePrivateEndpointConnectionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,10 +385,11 @@ func (client *IotDpsResourceClient) deletePrivateEndpointConnectionCreateRequest // Get - Get the metadata of the provisioning service without SAS keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// provisioningServiceName - Name of the provisioning service to retrieve. -// resourceGroupName - Resource group name. -// options - IotDpsResourceClientGetOptions contains the optional parameters for the IotDpsResourceClient.Get method. +// +// Generated from API version 2022-12-12 +// - provisioningServiceName - Name of the provisioning service to retrieve. +// - resourceGroupName - Resource group name. +// - options - IotDpsResourceClientGetOptions contains the optional parameters for the IotDpsResourceClient.Get method. func (client *IotDpsResourceClient) Get(ctx context.Context, provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientGetOptions) (IotDpsResourceClientGetResponse, error) { req, err := client.getCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) if err != nil { @@ -414,7 +425,7 @@ func (client *IotDpsResourceClient) getCreateRequest(ctx context.Context, provis return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,13 +442,14 @@ func (client *IotDpsResourceClient) getHandleResponse(resp *http.Response) (IotD // GetOperationResult - Gets the status of a long running operation, such as create, update or delete a provisioning service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// operationID - Operation id corresponding to long running operation. Use this to poll for the status. -// resourceGroupName - Resource group identifier. -// provisioningServiceName - Name of provisioning service that the operation is running on. -// asyncinfo - Async header used to poll on the status of the operation, obtained while creating the long running operation. -// options - IotDpsResourceClientGetOperationResultOptions contains the optional parameters for the IotDpsResourceClient.GetOperationResult -// method. +// +// Generated from API version 2022-12-12 +// - operationID - Operation id corresponding to long running operation. Use this to poll for the status. +// - resourceGroupName - Resource group identifier. +// - provisioningServiceName - Name of provisioning service that the operation is running on. +// - asyncinfo - Async header used to poll on the status of the operation, obtained while creating the long running operation. +// - options - IotDpsResourceClientGetOperationResultOptions contains the optional parameters for the IotDpsResourceClient.GetOperationResult +// method. func (client *IotDpsResourceClient) GetOperationResult(ctx context.Context, operationID string, resourceGroupName string, provisioningServiceName string, asyncinfo string, options *IotDpsResourceClientGetOperationResultOptions) (IotDpsResourceClientGetOperationResultResponse, error) { req, err := client.getOperationResultCreateRequest(ctx, operationID, resourceGroupName, provisioningServiceName, asyncinfo, options) if err != nil { @@ -478,7 +490,7 @@ func (client *IotDpsResourceClient) getOperationResultCreateRequest(ctx context. } reqQP := req.Raw().URL.Query() reqQP.Set("asyncinfo", asyncinfo) - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -495,12 +507,13 @@ func (client *IotDpsResourceClient) getOperationResultHandleResponse(resp *http. // GetPrivateEndpointConnection - Get private endpoint connection properties // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// privateEndpointConnectionName - The name of the private endpoint connection -// options - IotDpsResourceClientGetPrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.GetPrivateEndpointConnection -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - privateEndpointConnectionName - The name of the private endpoint connection +// - options - IotDpsResourceClientGetPrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.GetPrivateEndpointConnection +// method. func (client *IotDpsResourceClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *IotDpsResourceClientGetPrivateEndpointConnectionOptions) (IotDpsResourceClientGetPrivateEndpointConnectionResponse, error) { req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { @@ -540,7 +553,7 @@ func (client *IotDpsResourceClient) getPrivateEndpointConnectionCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -557,12 +570,13 @@ func (client *IotDpsResourceClient) getPrivateEndpointConnectionHandleResponse(r // GetPrivateLinkResources - Get the specified private link resource for the given provisioning service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// groupID - The name of the private link resource -// options - IotDpsResourceClientGetPrivateLinkResourcesOptions contains the optional parameters for the IotDpsResourceClient.GetPrivateLinkResources -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - groupID - The name of the private link resource +// - options - IotDpsResourceClientGetPrivateLinkResourcesOptions contains the optional parameters for the IotDpsResourceClient.GetPrivateLinkResources +// method. func (client *IotDpsResourceClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, resourceName string, groupID string, options *IotDpsResourceClientGetPrivateLinkResourcesOptions) (IotDpsResourceClientGetPrivateLinkResourcesResponse, error) { req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, resourceName, groupID, options) if err != nil { @@ -602,7 +616,7 @@ func (client *IotDpsResourceClient) getPrivateLinkResourcesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -618,11 +632,11 @@ func (client *IotDpsResourceClient) getPrivateLinkResourcesHandleResponse(resp * } // NewListByResourceGroupPager - Get a list of all provisioning services in the given resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - Resource group identifier. -// options - IotDpsResourceClientListByResourceGroupOptions contains the optional parameters for the IotDpsResourceClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Resource group identifier. +// - options - IotDpsResourceClientListByResourceGroupOptions contains the optional parameters for the IotDpsResourceClient.NewListByResourceGroupPager +// method. func (client *IotDpsResourceClient) NewListByResourceGroupPager(resourceGroupName string, options *IotDpsResourceClientListByResourceGroupOptions) *runtime.Pager[IotDpsResourceClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[IotDpsResourceClientListByResourceGroupResponse]{ More: func(page IotDpsResourceClientListByResourceGroupResponse) bool { @@ -667,7 +681,7 @@ func (client *IotDpsResourceClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -683,10 +697,10 @@ func (client *IotDpsResourceClient) listByResourceGroupHandleResponse(resp *http } // NewListBySubscriptionPager - List all the provisioning services for a given subscription id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// options - IotDpsResourceClientListBySubscriptionOptions contains the optional parameters for the IotDpsResourceClient.ListBySubscription -// method. +// +// Generated from API version 2022-12-12 +// - options - IotDpsResourceClientListBySubscriptionOptions contains the optional parameters for the IotDpsResourceClient.NewListBySubscriptionPager +// method. func (client *IotDpsResourceClient) NewListBySubscriptionPager(options *IotDpsResourceClientListBySubscriptionOptions) *runtime.Pager[IotDpsResourceClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[IotDpsResourceClientListBySubscriptionResponse]{ More: func(page IotDpsResourceClientListBySubscriptionResponse) bool { @@ -727,7 +741,7 @@ func (client *IotDpsResourceClient) listBySubscriptionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -743,11 +757,12 @@ func (client *IotDpsResourceClient) listBySubscriptionHandleResponse(resp *http. } // NewListKeysPager - List the primary and secondary keys for a provisioning service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// provisioningServiceName - The provisioning service name to get the shared access keys for. -// resourceGroupName - resource group name -// options - IotDpsResourceClientListKeysOptions contains the optional parameters for the IotDpsResourceClient.ListKeys method. +// +// Generated from API version 2022-12-12 +// - provisioningServiceName - The provisioning service name to get the shared access keys for. +// - resourceGroupName - resource group name +// - options - IotDpsResourceClientListKeysOptions contains the optional parameters for the IotDpsResourceClient.NewListKeysPager +// method. func (client *IotDpsResourceClient) NewListKeysPager(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListKeysOptions) *runtime.Pager[IotDpsResourceClientListKeysResponse] { return runtime.NewPager(runtime.PagingHandler[IotDpsResourceClientListKeysResponse]{ More: func(page IotDpsResourceClientListKeysResponse) bool { @@ -796,7 +811,7 @@ func (client *IotDpsResourceClient) listKeysCreateRequest(ctx context.Context, p return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -813,12 +828,13 @@ func (client *IotDpsResourceClient) listKeysHandleResponse(resp *http.Response) // ListKeysForKeyName - List primary and secondary keys for a specific key name // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// provisioningServiceName - Name of the provisioning service. -// keyName - Logical key name to get key-values for. -// resourceGroupName - The name of the resource group that contains the provisioning service. -// options - IotDpsResourceClientListKeysForKeyNameOptions contains the optional parameters for the IotDpsResourceClient.ListKeysForKeyName -// method. +// +// Generated from API version 2022-12-12 +// - provisioningServiceName - Name of the provisioning service. +// - keyName - Logical key name to get key-values for. +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - options - IotDpsResourceClientListKeysForKeyNameOptions contains the optional parameters for the IotDpsResourceClient.ListKeysForKeyName +// method. func (client *IotDpsResourceClient) ListKeysForKeyName(ctx context.Context, provisioningServiceName string, keyName string, resourceGroupName string, options *IotDpsResourceClientListKeysForKeyNameOptions) (IotDpsResourceClientListKeysForKeyNameResponse, error) { req, err := client.listKeysForKeyNameCreateRequest(ctx, provisioningServiceName, keyName, resourceGroupName, options) if err != nil { @@ -858,7 +874,7 @@ func (client *IotDpsResourceClient) listKeysForKeyNameCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -875,11 +891,12 @@ func (client *IotDpsResourceClient) listKeysForKeyNameHandleResponse(resp *http. // ListPrivateEndpointConnections - List private endpoint connection properties // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// options - IotDpsResourceClientListPrivateEndpointConnectionsOptions contains the optional parameters for the IotDpsResourceClient.ListPrivateEndpointConnections -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - options - IotDpsResourceClientListPrivateEndpointConnectionsOptions contains the optional parameters for the IotDpsResourceClient.ListPrivateEndpointConnections +// method. func (client *IotDpsResourceClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, resourceName string, options *IotDpsResourceClientListPrivateEndpointConnectionsOptions) (IotDpsResourceClientListPrivateEndpointConnectionsResponse, error) { req, err := client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -915,7 +932,7 @@ func (client *IotDpsResourceClient) listPrivateEndpointConnectionsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -932,11 +949,12 @@ func (client *IotDpsResourceClient) listPrivateEndpointConnectionsHandleResponse // ListPrivateLinkResources - List private link resources for the given provisioning service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// resourceGroupName - The name of the resource group that contains the provisioning service. -// resourceName - The name of the provisioning service. -// options - IotDpsResourceClientListPrivateLinkResourcesOptions contains the optional parameters for the IotDpsResourceClient.ListPrivateLinkResources -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - The name of the resource group that contains the provisioning service. +// - resourceName - The name of the provisioning service. +// - options - IotDpsResourceClientListPrivateLinkResourcesOptions contains the optional parameters for the IotDpsResourceClient.ListPrivateLinkResources +// method. func (client *IotDpsResourceClient) ListPrivateLinkResources(ctx context.Context, resourceGroupName string, resourceName string, options *IotDpsResourceClientListPrivateLinkResourcesOptions) (IotDpsResourceClientListPrivateLinkResourcesResponse, error) { req, err := client.listPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -972,7 +990,7 @@ func (client *IotDpsResourceClient) listPrivateLinkResourcesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -988,12 +1006,12 @@ func (client *IotDpsResourceClient) listPrivateLinkResourcesHandleResponse(resp } // NewListValidSKUsPager - Gets the list of valid SKUs and tiers for a provisioning service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// provisioningServiceName - Name of provisioning service. -// resourceGroupName - Name of resource group. -// options - IotDpsResourceClientListValidSKUsOptions contains the optional parameters for the IotDpsResourceClient.ListValidSKUs -// method. +// +// Generated from API version 2022-12-12 +// - provisioningServiceName - Name of provisioning service. +// - resourceGroupName - Name of resource group. +// - options - IotDpsResourceClientListValidSKUsOptions contains the optional parameters for the IotDpsResourceClient.NewListValidSKUsPager +// method. func (client *IotDpsResourceClient) NewListValidSKUsPager(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListValidSKUsOptions) *runtime.Pager[IotDpsResourceClientListValidSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[IotDpsResourceClientListValidSKUsResponse]{ More: func(page IotDpsResourceClientListValidSKUsResponse) bool { @@ -1042,7 +1060,7 @@ func (client *IotDpsResourceClient) listValidSKUsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1059,12 +1077,13 @@ func (client *IotDpsResourceClient) listValidSKUsHandleResponse(resp *http.Respo // BeginUpdate - Update an existing provisioning service'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-02-05 -// resourceGroupName - Resource group identifier. -// provisioningServiceName - Name of provisioning service to create or update. -// provisioningServiceTags - Updated tag information to set into the provisioning service instance. -// options - IotDpsResourceClientBeginUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginUpdate -// method. +// +// Generated from API version 2022-12-12 +// - resourceGroupName - Resource group identifier. +// - provisioningServiceName - Name of provisioning service to create or update. +// - provisioningServiceTags - Updated tag information to set into the provisioning service instance. +// - options - IotDpsResourceClientBeginUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginUpdate +// method. func (client *IotDpsResourceClient) BeginUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, provisioningServiceTags TagsResource, options *IotDpsResourceClientBeginUpdateOptions) (*runtime.Poller[IotDpsResourceClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, provisioningServiceName, provisioningServiceTags, options) @@ -1079,7 +1098,8 @@ func (client *IotDpsResourceClient) BeginUpdate(ctx context.Context, resourceGro // Update - Update an existing provisioning service'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-02-05 +// +// Generated from API version 2022-12-12 func (client *IotDpsResourceClient) update(ctx context.Context, resourceGroupName string, provisioningServiceName string, provisioningServiceTags TagsResource, options *IotDpsResourceClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, provisioningServiceName, provisioningServiceTags, options) if err != nil { @@ -1115,7 +1135,7 @@ func (client *IotDpsResourceClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, provisioningServiceTags) diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models.go similarity index 96% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models.go index c7b19d04f9b6..c834544765a0 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -162,7 +163,7 @@ type DpsCertificateClientVerifyCertificateOptions struct { // ErrorDetails - Error details. type ErrorDetails struct { // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *int32 `json:"code,omitempty" azure:"ro"` // READ-ONLY; The error details. Details *string `json:"details,omitempty" azure:"ro"` @@ -246,6 +247,9 @@ type IotDpsPropertiesDescription struct { // List of IoT hubs associated with this provisioning service. IotHubs []*IotHubDefinitionDescription `json:"iotHubs,omitempty"` + // Portal endpoint to enable CORS for this provisioning service. + PortalOperationsHostName *string `json:"portalOperationsHostName,omitempty"` + // Private endpoint connections created on this IotHub PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` @@ -330,13 +334,13 @@ type IotDpsResourceClientGetPrivateLinkResourcesOptions struct { // placeholder for future optional parameters } -// IotDpsResourceClientListByResourceGroupOptions contains the optional parameters for the IotDpsResourceClient.ListByResourceGroup +// IotDpsResourceClientListByResourceGroupOptions contains the optional parameters for the IotDpsResourceClient.NewListByResourceGroupPager // method. type IotDpsResourceClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// IotDpsResourceClientListBySubscriptionOptions contains the optional parameters for the IotDpsResourceClient.ListBySubscription +// IotDpsResourceClientListBySubscriptionOptions contains the optional parameters for the IotDpsResourceClient.NewListBySubscriptionPager // method. type IotDpsResourceClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -348,7 +352,7 @@ type IotDpsResourceClientListKeysForKeyNameOptions struct { // placeholder for future optional parameters } -// IotDpsResourceClientListKeysOptions contains the optional parameters for the IotDpsResourceClient.ListKeys method. +// IotDpsResourceClientListKeysOptions contains the optional parameters for the IotDpsResourceClient.NewListKeysPager method. type IotDpsResourceClientListKeysOptions struct { // placeholder for future optional parameters } @@ -365,7 +369,8 @@ type IotDpsResourceClientListPrivateLinkResourcesOptions struct { // placeholder for future optional parameters } -// IotDpsResourceClientListValidSKUsOptions contains the optional parameters for the IotDpsResourceClient.ListValidSKUs method. +// IotDpsResourceClientListValidSKUsOptions contains the optional parameters for the IotDpsResourceClient.NewListValidSKUsPager +// method. type IotDpsResourceClientListValidSKUsOptions struct { // placeholder for future optional parameters } @@ -464,7 +469,7 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -535,6 +540,12 @@ type ProvisioningServiceDescription struct { // ETag convention. Etag *string `json:"etag,omitempty"` + // The resource group of the resource. + Resourcegroup *string `json:"resourcegroup,omitempty"` + + // The subscription id of the resource. + Subscriptionid *string `json:"subscriptionid,omitempty"` + // The resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -565,6 +576,12 @@ type Resource struct { // REQUIRED; The resource location. Location *string `json:"location,omitempty"` + // The resource group of the resource. + Resourcegroup *string `json:"resourcegroup,omitempty"` + + // The subscription id of the resource. + Subscriptionid *string `json:"subscriptionid,omitempty"` + // The resource tags. Tags map[string]*string `json:"tags,omitempty"` diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models_serde.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models_serde.go new file mode 100644 index 000000000000..101ac9029961 --- /dev/null +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/models_serde.go @@ -0,0 +1,1373 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armdeviceprovisioningservices + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AsyncOperationResult. +func (a AsyncOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", a.Error) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AsyncOperationResult. +func (a *AsyncOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateBodyDescription. +func (c CertificateBodyDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", c.Certificate) + populate(objectMap, "isVerified", c.IsVerified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateBodyDescription. +func (c *CertificateBodyDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, "IsVerified", &c.IsVerified) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateListDescription. +func (c CertificateListDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateListDescription. +func (c *CertificateListDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateByteArray(objectMap, "certificate", c.Certificate, runtime.Base64StdFormat) + populateTimeRFC1123(objectMap, "created", c.Created) + populateTimeRFC1123(objectMap, "expiry", c.Expiry) + populate(objectMap, "isVerified", c.IsVerified) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + populateTimeRFC1123(objectMap, "updated", c.Updated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. +func (c *CertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = runtime.DecodeByteArray(string(val), &c.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC1123(val, "Created", &c.Created) + delete(rawMsg, key) + case "expiry": + err = unpopulateTimeRFC1123(val, "Expiry", &c.Expiry) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, "IsVerified", &c.IsVerified) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC1123(val, "Updated", &c.Updated) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateResponse. +func (c CertificateResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateResponse. +func (c *CertificateResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetails. +func (e ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "httpStatusCode", e.HTTPStatusCode) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. +func (e *ErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "httpStatusCode": + err = unpopulate(val, "HTTPStatusCode", &e.HTTPStatusCode) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorMessage. +func (e ErrorMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorMessage. +func (e *ErrorMessage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupIDInformation. +func (g GroupIDInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupIDInformation. +func (g *GroupIDInformation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupIDInformationProperties. +func (g GroupIDInformationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "requiredMembers", g.RequiredMembers) + populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupIDInformationProperties. +func (g *GroupIDInformationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &g.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &g.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &g.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPFilterRule. +func (i IPFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", i.Action) + populate(objectMap, "filterName", i.FilterName) + populate(objectMap, "ipMask", i.IPMask) + populate(objectMap, "target", i.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPFilterRule. +func (i *IPFilterRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &i.Action) + delete(rawMsg, key) + case "filterName": + err = unpopulate(val, "FilterName", &i.FilterName) + delete(rawMsg, key) + case "ipMask": + err = unpopulate(val, "IPMask", &i.IPMask) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &i.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsPropertiesDescription. +func (i IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocationPolicy", i.AllocationPolicy) + populate(objectMap, "authorizationPolicies", i.AuthorizationPolicies) + populate(objectMap, "deviceProvisioningHostName", i.DeviceProvisioningHostName) + populate(objectMap, "enableDataResidency", i.EnableDataResidency) + populate(objectMap, "idScope", i.IDScope) + populate(objectMap, "ipFilterRules", i.IPFilterRules) + populate(objectMap, "iotHubs", i.IotHubs) + populate(objectMap, "portalOperationsHostName", i.PortalOperationsHostName) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "publicNetworkAccess", i.PublicNetworkAccess) + populate(objectMap, "serviceOperationsHostName", i.ServiceOperationsHostName) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotDpsPropertiesDescription. +func (i *IotDpsPropertiesDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allocationPolicy": + err = unpopulate(val, "AllocationPolicy", &i.AllocationPolicy) + delete(rawMsg, key) + case "authorizationPolicies": + err = unpopulate(val, "AuthorizationPolicies", &i.AuthorizationPolicies) + delete(rawMsg, key) + case "deviceProvisioningHostName": + err = unpopulate(val, "DeviceProvisioningHostName", &i.DeviceProvisioningHostName) + delete(rawMsg, key) + case "enableDataResidency": + err = unpopulate(val, "EnableDataResidency", &i.EnableDataResidency) + delete(rawMsg, key) + case "idScope": + err = unpopulate(val, "IDScope", &i.IDScope) + delete(rawMsg, key) + case "ipFilterRules": + err = unpopulate(val, "IPFilterRules", &i.IPFilterRules) + delete(rawMsg, key) + case "iotHubs": + err = unpopulate(val, "IotHubs", &i.IotHubs) + delete(rawMsg, key) + case "portalOperationsHostName": + err = unpopulate(val, "PortalOperationsHostName", &i.PortalOperationsHostName) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &i.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &i.PublicNetworkAccess) + delete(rawMsg, key) + case "serviceOperationsHostName": + err = unpopulate(val, "ServiceOperationsHostName", &i.ServiceOperationsHostName) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsSKUDefinition. +func (i IotDpsSKUDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotDpsSKUDefinition. +func (i *IotDpsSKUDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsSKUDefinitionListResult. +func (i IotDpsSKUDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotDpsSKUDefinitionListResult. +func (i *IotDpsSKUDefinitionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsSKUInfo. +func (i IotDpsSKUInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", i.Capacity) + populate(objectMap, "name", i.Name) + populate(objectMap, "tier", i.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotDpsSKUInfo. +func (i *IotDpsSKUInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &i.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &i.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotHubDefinitionDescription. +func (i IotHubDefinitionDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocationWeight", i.AllocationWeight) + populate(objectMap, "applyAllocationPolicy", i.ApplyAllocationPolicy) + populate(objectMap, "connectionString", i.ConnectionString) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotHubDefinitionDescription. +func (i *IotHubDefinitionDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allocationWeight": + err = unpopulate(val, "AllocationWeight", &i.AllocationWeight) + delete(rawMsg, key) + case "applyAllocationPolicy": + err = unpopulate(val, "ApplyAllocationPolicy", &i.ApplyAllocationPolicy) + delete(rawMsg, key) + case "connectionString": + err = unpopulate(val, "ConnectionString", &i.ConnectionString) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityInfo. +func (n NameAvailabilityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", n.Message) + populate(objectMap, "nameAvailable", n.NameAvailable) + populate(objectMap, "reason", n.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityInfo. +func (n *NameAvailabilityInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationInputs. +func (o OperationInputs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationInputs. +func (o *OperationInputs) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResources. +func (p PrivateLinkResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResources. +func (p *PrivateLinkResources) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescription. +func (p ProvisioningServiceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "resourcegroup", p.Resourcegroup) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "subscriptionid", p.Subscriptionid) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningServiceDescription. +func (p *ProvisioningServiceDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "resourcegroup": + err = unpopulate(val, "Resourcegroup", &p.Resourcegroup) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "subscriptionid": + err = unpopulate(val, "Subscriptionid", &p.Subscriptionid) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescriptionListResult. +func (p ProvisioningServiceDescriptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningServiceDescriptionListResult. +func (p *ProvisioningServiceDescriptionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "resourcegroup", r.Resourcegroup) + populate(objectMap, "subscriptionid", r.Subscriptionid) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "resourcegroup": + err = unpopulate(val, "Resourcegroup", &r.Resourcegroup) + delete(rawMsg, key) + case "subscriptionid": + err = unpopulate(val, "Subscriptionid", &r.Subscriptionid) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedAccessSignatureAuthorizationRuleAccessRightsDescription. +func (s SharedAccessSignatureAuthorizationRuleAccessRightsDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", s.KeyName) + populate(objectMap, "primaryKey", s.PrimaryKey) + populate(objectMap, "rights", s.Rights) + populate(objectMap, "secondaryKey", s.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedAccessSignatureAuthorizationRuleAccessRightsDescription. +func (s *SharedAccessSignatureAuthorizationRuleAccessRightsDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &s.KeyName) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) + delete(rawMsg, key) + case "rights": + err = unpopulate(val, "Rights", &s.Rights) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedAccessSignatureAuthorizationRuleListResult. +func (s SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedAccessSignatureAuthorizationRuleListResult. +func (s *SharedAccessSignatureAuthorizationRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagsResource. +func (t TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource. +func (t *TagsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationCodeRequest. +func (v VerificationCodeRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", v.Certificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeRequest. +func (v *VerificationCodeRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = unpopulate(val, "Certificate", &v.Certificate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationCodeResponse. +func (v VerificationCodeResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeResponse. +func (v *VerificationCodeResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationCodeResponseProperties. +func (v VerificationCodeResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateByteArray(objectMap, "certificate", v.Certificate, runtime.Base64StdFormat) + populate(objectMap, "created", v.Created) + populate(objectMap, "expiry", v.Expiry) + populate(objectMap, "isVerified", v.IsVerified) + populate(objectMap, "subject", v.Subject) + populate(objectMap, "thumbprint", v.Thumbprint) + populate(objectMap, "updated", v.Updated) + populate(objectMap, "verificationCode", v.VerificationCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeResponseProperties. +func (v *VerificationCodeResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = runtime.DecodeByteArray(string(val), &v.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "created": + err = unpopulate(val, "Created", &v.Created) + delete(rawMsg, key) + case "expiry": + err = unpopulate(val, "Expiry", &v.Expiry) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, "IsVerified", &v.IsVerified) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &v.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &v.Thumbprint) + delete(rawMsg, key) + case "updated": + err = unpopulate(val, "Updated", &v.Updated) + delete(rawMsg, key) + case "verificationCode": + err = unpopulate(val, "VerificationCode", &v.VerificationCode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/operations_client.go similarity index 90% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/operations_client.go index c351aa833a7c..7394d32558a8 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Microsoft.Devices REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-05 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-12-12 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-05") + reqQP.Set("api-version", "2022-12-12") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/response_types.go similarity index 88% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/response_types.go index d21478f2db81..8d8fbe4b4239 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -43,22 +44,22 @@ type IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse struct NameAvailabilityInfo } -// IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection. +// IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection. type IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse struct { PrivateEndpointConnection } -// IotDpsResourceClientCreateOrUpdateResponse contains the response from method IotDpsResourceClient.CreateOrUpdate. +// IotDpsResourceClientCreateOrUpdateResponse contains the response from method IotDpsResourceClient.BeginCreateOrUpdate. type IotDpsResourceClientCreateOrUpdateResponse struct { ProvisioningServiceDescription } -// IotDpsResourceClientDeletePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.DeletePrivateEndpointConnection. +// IotDpsResourceClientDeletePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.BeginDeletePrivateEndpointConnection. type IotDpsResourceClientDeletePrivateEndpointConnectionResponse struct { PrivateEndpointConnection } -// IotDpsResourceClientDeleteResponse contains the response from method IotDpsResourceClient.Delete. +// IotDpsResourceClientDeleteResponse contains the response from method IotDpsResourceClient.BeginDelete. type IotDpsResourceClientDeleteResponse struct { // placeholder for future response values } @@ -83,12 +84,12 @@ type IotDpsResourceClientGetResponse struct { ProvisioningServiceDescription } -// IotDpsResourceClientListByResourceGroupResponse contains the response from method IotDpsResourceClient.ListByResourceGroup. +// IotDpsResourceClientListByResourceGroupResponse contains the response from method IotDpsResourceClient.NewListByResourceGroupPager. type IotDpsResourceClientListByResourceGroupResponse struct { ProvisioningServiceDescriptionListResult } -// IotDpsResourceClientListBySubscriptionResponse contains the response from method IotDpsResourceClient.ListBySubscription. +// IotDpsResourceClientListBySubscriptionResponse contains the response from method IotDpsResourceClient.NewListBySubscriptionPager. type IotDpsResourceClientListBySubscriptionResponse struct { ProvisioningServiceDescriptionListResult } @@ -98,7 +99,7 @@ type IotDpsResourceClientListKeysForKeyNameResponse struct { SharedAccessSignatureAuthorizationRuleAccessRightsDescription } -// IotDpsResourceClientListKeysResponse contains the response from method IotDpsResourceClient.ListKeys. +// IotDpsResourceClientListKeysResponse contains the response from method IotDpsResourceClient.NewListKeysPager. type IotDpsResourceClientListKeysResponse struct { SharedAccessSignatureAuthorizationRuleListResult } @@ -114,17 +115,17 @@ type IotDpsResourceClientListPrivateLinkResourcesResponse struct { PrivateLinkResources } -// IotDpsResourceClientListValidSKUsResponse contains the response from method IotDpsResourceClient.ListValidSKUs. +// IotDpsResourceClientListValidSKUsResponse contains the response from method IotDpsResourceClient.NewListValidSKUsPager. type IotDpsResourceClientListValidSKUsResponse struct { IotDpsSKUDefinitionListResult } -// IotDpsResourceClientUpdateResponse contains the response from method IotDpsResourceClient.Update. +// IotDpsResourceClientUpdateResponse contains the response from method IotDpsResourceClient.BeginUpdate. type IotDpsResourceClientUpdateResponse struct { ProvisioningServiceDescription } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc1123.go similarity index 94% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc1123.go index 47a263eb7da8..f16e0b173c08 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc1123.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -45,7 +46,7 @@ func (t *timeRFC1123) UnmarshalText(data []byte) error { return err } -func populateTimeRFC1123(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC1123(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc3339.go index a16c7713c2bb..3d0da901282e 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdeviceprovisioningservices @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go deleted file mode 100644 index ffb241f73d0f..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go +++ /dev/null @@ -1,185 +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 armdeviceprovisioningservices_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/deviceprovisioningservices/armdeviceprovisioningservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificate.json -func ExampleDpsCertificateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "cert", - "myResourceGroup", - "myFirstProvisioningService", - &armdeviceprovisioningservices.DpsCertificateClientGetOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCertificateCreateOrUpdate.json -func ExampleDpsCertificateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myFirstProvisioningService", - "cert", - armdeviceprovisioningservices.CertificateResponse{ - Properties: &armdeviceprovisioningservices.CertificateProperties{ - Certificate: []byte("############################################"), - }, - }, - &armdeviceprovisioningservices.DpsCertificateClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeleteCertificate.json -func ExampleDpsCertificateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myResourceGroup", - "AAAAAAAADGk=", - "myFirstProvisioningService", - "cert", - &armdeviceprovisioningservices.DpsCertificateClientDeleteOptions{CertificateName1: nil, - CertificateIsVerified: nil, - CertificatePurpose: nil, - CertificateCreated: nil, - CertificateLastUpdated: nil, - CertificateHasPrivateKey: nil, - CertificateNonce: 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetCertificates.json -func ExampleDpsCertificateClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "myResourceGroup", - "myFirstProvisioningService", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGenerateVerificationCode.json -func ExampleDpsCertificateClient_GenerateVerificationCode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateVerificationCode(ctx, - "cert", - "AAAAAAAADGk=", - "myResourceGroup", - "myFirstProvisioningService", - &armdeviceprovisioningservices.DpsCertificateClientGenerateVerificationCodeOptions{CertificateName1: nil, - CertificateIsVerified: nil, - CertificatePurpose: nil, - CertificateCreated: nil, - CertificateLastUpdated: nil, - CertificateHasPrivateKey: nil, - CertificateNonce: 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSVerifyCertificate.json -func ExampleDpsCertificateClient_VerifyCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewDpsCertificateClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.VerifyCertificate(ctx, - "cert", - "AAAAAAAADGk=", - "myResourceGroup", - "myFirstProvisioningService", - armdeviceprovisioningservices.VerificationCodeRequest{ - Certificate: to.Ptr("#####################################"), - }, - &armdeviceprovisioningservices.DpsCertificateClientVerifyCertificateOptions{CertificateName1: nil, - CertificateIsVerified: nil, - CertificatePurpose: nil, - CertificateCreated: nil, - CertificateLastUpdated: nil, - CertificateHasPrivateKey: nil, - CertificateNonce: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go deleted file mode 100644 index 2a982e5d9463..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go +++ /dev/null @@ -1,429 +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 armdeviceprovisioningservices_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/deviceprovisioningservices/armdeviceprovisioningservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGet.json -func ExampleIotDpsResourceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myFirstProvisioningService", - "myResourceGroup", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreate.json -func ExampleIotDpsResourceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myFirstProvisioningService", - armdeviceprovisioningservices.ProvisioningServiceDescription{ - Location: to.Ptr("East US"), - Tags: map[string]*string{}, - Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{ - EnableDataResidency: to.Ptr(false), - }, - SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{ - Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1), - Capacity: to.Ptr[int64](1), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSPatch.json -func ExampleIotDpsResourceClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myFirstProvisioningService", - armdeviceprovisioningservices.TagsResource{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDelete.json -func ExampleIotDpsResourceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myFirstProvisioningService", - "myResourceGroup", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListBySubscription.json -func ExampleIotDpsResourceClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", 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) - } - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListByResourceGroup.json -func ExampleIotDpsResourceClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetOperationResult.json -func ExampleIotDpsResourceClient_GetOperationResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationResult(ctx, - "MTY5OTNmZDctODI5Yy00N2E2LTkxNDQtMDU1NGIyYzY1ZjRl", - "myResourceGroup", - "myFirstProvisioningService", - "1508265712453", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCheckNameAvailability.json -func ExampleIotDpsResourceClient_CheckProvisioningServiceNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckProvisioningServiceNameAvailability(ctx, - armdeviceprovisioningservices.OperationInputs{ - Name: to.Ptr("test213123"), - }, - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListKeys.json -func ExampleIotDpsResourceClient_NewListKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListKeysPager("myFirstProvisioningService", - "myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetKey.json -func ExampleIotDpsResourceClient_ListKeysForKeyName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeysForKeyName(ctx, - "myFirstProvisioningService", - "testKey", - "myResourceGroup", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListPrivateLinkResources.json -func ExampleIotDpsResourceClient_ListPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPrivateLinkResources(ctx, - "myResourceGroup", - "myFirstProvisioningService", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateLinkResources.json -func ExampleIotDpsResourceClient_GetPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPrivateLinkResources(ctx, - "myResourceGroup", - "myFirstProvisioningService", - "iotDps", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSListPrivateEndpointConnections.json -func ExampleIotDpsResourceClient_ListPrivateEndpointConnections() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPrivateEndpointConnections(ctx, - "myResourceGroup", - "myFirstProvisioningService", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSGetPrivateEndpointConnection.json -func ExampleIotDpsResourceClient_GetPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPrivateEndpointConnection(ctx, - "myResourceGroup", - "myFirstProvisioningService", - "myPrivateEndpointConnection", - 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/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSCreateOrUpdatePrivateEndpointConnection.json -func ExampleIotDpsResourceClient_BeginCreateOrUpdatePrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdatePrivateEndpointConnection(ctx, - "myResourceGroup", - "myFirstProvisioningService", - "myPrivateEndpointConnection", - armdeviceprovisioningservices.PrivateEndpointConnection{ - Properties: &armdeviceprovisioningservices.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armdeviceprovisioningservices.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armdeviceprovisioningservices.PrivateLinkServiceConnectionStatusApproved), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSDeletePrivateEndpointConnection.json -func ExampleIotDpsResourceClient_BeginDeletePrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("91d12660-3dec-467a-be2a-213b5544ddc0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeletePrivateEndpointConnection(ctx, - "myResourceGroup", - "myFirstProvisioningService", - "myPrivateEndpointConnection", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go deleted file mode 100644 index f0affa00e803..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdeviceprovisioningservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/examples/DPSOperations.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 := armdeviceprovisioningservices.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go deleted file mode 100644 index 8a67ef980067..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go +++ /dev/null @@ -1,237 +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 armdeviceprovisioningservices - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. -func (c CertificateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateByteArray(objectMap, "certificate", c.Certificate, runtime.Base64StdFormat) - populateTimeRFC1123(objectMap, "created", c.Created) - populateTimeRFC1123(objectMap, "expiry", c.Expiry) - populate(objectMap, "isVerified", c.IsVerified) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) - populateTimeRFC1123(objectMap, "updated", c.Updated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. -func (c *CertificateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificate": - err = runtime.DecodeByteArray(string(val), &c.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "created": - err = unpopulateTimeRFC1123(val, "Created", &c.Created) - delete(rawMsg, key) - case "expiry": - err = unpopulateTimeRFC1123(val, "Expiry", &c.Expiry) - delete(rawMsg, key) - case "isVerified": - err = unpopulate(val, "IsVerified", &c.IsVerified) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC1123(val, "Updated", &c.Updated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IotDpsPropertiesDescription. -func (i IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocationPolicy", i.AllocationPolicy) - populate(objectMap, "authorizationPolicies", i.AuthorizationPolicies) - populate(objectMap, "deviceProvisioningHostName", i.DeviceProvisioningHostName) - populate(objectMap, "enableDataResidency", i.EnableDataResidency) - populate(objectMap, "idScope", i.IDScope) - populate(objectMap, "ipFilterRules", i.IPFilterRules) - populate(objectMap, "iotHubs", i.IotHubs) - populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "publicNetworkAccess", i.PublicNetworkAccess) - populate(objectMap, "serviceOperationsHostName", i.ServiceOperationsHostName) - populate(objectMap, "state", i.State) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescription. -func (p ProvisioningServiceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TagsResource. -func (t TagsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeResponseProperties. -func (v *VerificationCodeResponseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificate": - err = runtime.DecodeByteArray(string(val), &v.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "created": - err = unpopulate(val, "Created", &v.Created) - delete(rawMsg, key) - case "expiry": - err = unpopulate(val, "Expiry", &v.Expiry) - delete(rawMsg, key) - case "isVerified": - err = unpopulate(val, "IsVerified", &v.IsVerified) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &v.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &v.Thumbprint) - delete(rawMsg, key) - case "updated": - err = unpopulate(val, "Updated", &v.Updated) - delete(rawMsg, key) - case "verificationCode": - err = unpopulate(val, "VerificationCode", &v.VerificationCode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}