diff --git a/sdk/resourcemanager/iothub/armiothub/CHANGELOG.md b/sdk/resourcemanager/iothub/armiothub/CHANGELOG.md index b6aeb98edd68..80864f8ed50e 100644 --- a/sdk/resourcemanager/iothub/armiothub/CHANGELOG.md +++ b/sdk/resourcemanager/iothub/armiothub/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.2.0-beta.2 (2023-04-27) +### Breaking Changes + +- Field `CollectionName` of struct `RoutingCosmosDBSQLAPIProperties` has been removed +- Field `CosmosDBSQLCollections` of struct `RoutingEndpoints` has been removed + +### Features Added + +- New field `ContainerName` in struct `RoutingCosmosDBSQLAPIProperties` +- New field `CosmosDBSQLContainers` in struct `RoutingEndpoints` + + ## 1.2.0-beta.1 (2023-04-28) ### Features Added diff --git a/sdk/resourcemanager/iothub/armiothub/autorest.md b/sdk/resourcemanager/iothub/armiothub/autorest.md index 33277badb6c6..756c992db1d7 100644 --- a/sdk/resourcemanager/iothub/armiothub/autorest.md +++ b/sdk/resourcemanager/iothub/armiothub/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/iothub/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/iothub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0-beta.1 -tag: package-preview-2022-11 +module-version: 1.2.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/iothub/armiothub/certificates_client.go b/sdk/resourcemanager/iothub/armiothub/certificates_client.go index a94873cc1c82..4a903d526ae3 100644 --- a/sdk/resourcemanager/iothub/armiothub/certificates_client.go +++ b/sdk/resourcemanager/iothub/armiothub/certificates_client.go @@ -47,7 +47,7 @@ func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Adds new or replaces existing certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - certificateName - The name of the certificate @@ -93,7 +93,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -114,7 +114,7 @@ func (client *CertificatesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes an existing X509 certificate or does nothing if it does not exist. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - certificateName - The name of the certificate @@ -159,7 +159,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -170,7 +170,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // to generate a leaf certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - certificateName - The name of the certificate @@ -216,7 +216,7 @@ func (client *CertificatesClient) generateVerificationCodeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -235,7 +235,7 @@ func (client *CertificatesClient) generateVerificationCodeHandleResponse(resp *h // Get - Returns the certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - certificateName - The name of the certificate @@ -279,7 +279,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +297,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // ListByIotHub - Returns the list of certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - CertificatesClientListByIotHubOptions contains the optional parameters for the CertificatesClient.ListByIotHub @@ -337,7 +337,7 @@ func (client *CertificatesClient) listByIotHubCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,7 +356,7 @@ func (client *CertificatesClient) listByIotHubHandleResponse(resp *http.Response // certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - certificateName - The name of the certificate @@ -402,7 +402,7 @@ func (client *CertificatesClient) verifyCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") 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/iothub/armiothub/certificates_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/certificates_client_example_test.go deleted file mode 100644 index 33300119cff6..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/certificates_client_example_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_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/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listcertificates.json -func ExampleCertificatesClient_ListByIotHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().ListByIotHub(ctx, "myResourceGroup", "testhub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateListDescription = armiothub.CertificateListDescription{ - // Value: []*armiothub.CertificateDescription{ - // { - // Name: to.Ptr("cert"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/Certificates"), - // Etag: to.Ptr("AAAAAAExpNs="), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/andbuc-hub/certificates/cert"), - // Properties: &armiothub.CertificateProperties{ - // Certificate: to.Ptr("############################################"), - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Sat, 31 Dec 2039 23:59:59 GMT"); return t}()), - // IsVerified: to.Ptr(false), - // Subject: to.Ptr("CN=testdevice1"), - // Thumbprint: to.Ptr("97388663832D0393C9246CAB4FBA2C8677185A25"), - // Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getcertificate.json -func ExampleCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Get(ctx, "myResourceGroup", "testhub", "cert", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateDescription = armiothub.CertificateDescription{ - // Name: to.Ptr("cert"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/Certificates"), - // Etag: to.Ptr("AAAAAAExpNs="), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/andbuc-hub/certificates/cert"), - // Properties: &armiothub.CertificateProperties{ - // Certificate: to.Ptr("############################################"), - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Sat, 31 Dec 2039 23:59:59 GMT"); return t}()), - // IsVerified: to.Ptr(false), - // Subject: to.Ptr("CN=testdevice1"), - // Thumbprint: to.Ptr("97388663832D0393C9246CAB4FBA2C8677185A25"), - // Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatescreateorupdate.json -func ExampleCertificatesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().CreateOrUpdate(ctx, "myResourceGroup", "iothub", "cert", armiothub.CertificateDescription{ - Properties: &armiothub.CertificateProperties{ - Certificate: to.Ptr("############################################"), - }, - }, &armiothub.CertificatesClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateDescription = armiothub.CertificateDescription{ - // Name: to.Ptr("cert"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/Certificates"), - // Etag: to.Ptr("AAAAAAExpNs="), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServives/myFirstProvisioningService/certificates/cert"), - // Properties: &armiothub.CertificateProperties{ - // Certificate: to.Ptr("############################################"), - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Sat, 31 Dec 2039 23:59:59 GMT"); return t}()), - // IsVerified: to.Ptr(false), - // Subject: to.Ptr("CN=testdevice1"), - // Thumbprint: to.Ptr("97388663832D0393C9246CAB4FBA2C8677185A25"), - // Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatesdelete.json -func ExampleCertificatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCertificatesClient().Delete(ctx, "myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_generateverificationcode.json -func ExampleCertificatesClient_GenerateVerificationCode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().GenerateVerificationCode(ctx, "myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateWithNonceDescription = armiothub.CertificateWithNonceDescription{ - // Name: to.Ptr("cert"), - // Properties: &armiothub.CertificatePropertiesWithNonce{ - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Sat, 31 Dec 2039 23:59:59 GMT"); return t}()), - // IsVerified: to.Ptr(false), - // Subject: to.Ptr("CN=andbucdevice1"), - // Thumbprint: to.Ptr("##############################"), - // Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:26:56 GMT"); return t}()), - // VerificationCode: to.Ptr("##################################"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certverify.json -func ExampleCertificatesClient_Verify() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Verify(ctx, "myResourceGroup", "myFirstProvisioningService", "cert", "AAAAAAAADGk=", armiothub.CertificateVerificationDescription{ - Certificate: to.Ptr("#####################################"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateDescription = armiothub.CertificateDescription{ - // Name: to.Ptr("cert"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/Certificates"), - // Etag: to.Ptr("AAAAAAExpTQ="), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService/certificates/cert"), - // Properties: &armiothub.CertificateProperties{ - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:23:50 GMT"); return t}()), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Sat, 31 Dec 2039 23:59:59 GMT"); return t}()), - // IsVerified: to.Ptr(true), - // Subject: to.Ptr("CN=andbucdevice1"), - // Thumbprint: to.Ptr("97388663832D0393C9246CAB4FBA2C8677185A25"), - // Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 12 Oct 2017 19:26:56 GMT"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/iothub/armiothub/client.go b/sdk/resourcemanager/iothub/armiothub/client.go index 3b69a383173c..513b8c7fba60 100644 --- a/sdk/resourcemanager/iothub/armiothub/client.go +++ b/sdk/resourcemanager/iothub/armiothub/client.go @@ -47,7 +47,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginManualFailover - Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - iotHubName - Name of the IoT hub to failover // - resourceGroupName - Name of the resource group containing the IoT hub resource // - failoverInput - Region to failover to. Must be the Azure paired region. Get the value from the secondary location in the @@ -68,7 +68,7 @@ func (client *Client) BeginManualFailover(ctx context.Context, iotHubName string // ManualFailover - Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview func (client *Client) manualFailover(ctx context.Context, iotHubName string, resourceGroupName string, failoverInput FailoverInput, options *ClientBeginManualFailoverOptions) (*http.Response, error) { req, err := client.manualFailoverCreateRequest(ctx, iotHubName, resourceGroupName, failoverInput, options) if err != nil { @@ -104,7 +104,7 @@ func (client *Client) manualFailoverCreateRequest(ctx context.Context, iotHubNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, failoverInput) diff --git a/sdk/resourcemanager/iothub/armiothub/client_example_test.go b/sdk/resourcemanager/iothub/armiothub/client_example_test.go deleted file mode 100644 index d60ec110115b..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/client_example_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_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/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/IotHub_ManualFailover.json -func ExampleClient_BeginManualFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginManualFailover(ctx, "testHub", "myResourceGroup", armiothub.FailoverInput{ - FailoverRegion: to.Ptr("testHub"), - }, 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) - } -} diff --git a/sdk/resourcemanager/iothub/armiothub/constants.go b/sdk/resourcemanager/iothub/armiothub/constants.go index 516ac605b87c..17cdddcee6f1 100644 --- a/sdk/resourcemanager/iothub/armiothub/constants.go +++ b/sdk/resourcemanager/iothub/armiothub/constants.go @@ -11,7 +11,7 @@ package armiothub const ( moduleName = "armiothub" - moduleVersion = "v1.2.0-beta.1" + moduleVersion = "v1.2.0-beta.2" ) // AccessRights - The permissions assigned to the shared access policy. diff --git a/sdk/resourcemanager/iothub/armiothub/go.mod b/sdk/resourcemanager/iothub/armiothub/go.mod index ef8440c9d437..f764126269b5 100644 --- a/sdk/resourcemanager/iothub/armiothub/go.mod +++ b/sdk/resourcemanager/iothub/armiothub/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/iothub/armiothub/go.sum b/sdk/resourcemanager/iothub/armiothub/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/iothub/armiothub/go.sum +++ b/sdk/resourcemanager/iothub/armiothub/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -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/iothub/armiothub/models.go b/sdk/resourcemanager/iothub/armiothub/models.go index 0bae03fd62e3..552fbf14cd54 100644 --- a/sdk/resourcemanager/iothub/armiothub/models.go +++ b/sdk/resourcemanager/iothub/armiothub/models.go @@ -1113,10 +1113,10 @@ type RouteProperties struct { Condition *string } -// RoutingCosmosDBSQLAPIProperties - The properties related to a cosmos DB sql collection endpoint. +// RoutingCosmosDBSQLAPIProperties - The properties related to a cosmos DB sql container endpoint. type RoutingCosmosDBSQLAPIProperties struct { - // REQUIRED; The name of the cosmos DB sql collection in the cosmos DB database. - CollectionName *string + // REQUIRED; The name of the cosmos DB sql container in the cosmos DB database. + ContainerName *string // REQUIRED; The name of the cosmos DB database in the cosmos DB account. DatabaseName *string @@ -1129,22 +1129,22 @@ type RoutingCosmosDBSQLAPIProperties struct { // events, fileNotifications, $default. Endpoint names must be unique across endpoint types. Name *string - // Method used to authenticate against the cosmos DB sql collection endpoint + // Method used to authenticate against the cosmos DB sql container endpoint AuthenticationType *AuthenticationType - // Id of the cosmos DB sql collection endpoint + // Id of the cosmos DB sql container endpoint ID *string - // Managed identity properties of routing cosmos DB collection endpoint. + // Managed identity properties of routing cosmos DB container endpoint. Identity *ManagedIdentity - // The name of the partition key associated with this cosmos DB sql collection if one exists. This is an optional parameter. + // The name of the partition key associated with this cosmos DB sql container if one exists. This is an optional parameter. PartitionKeyName *string - // The template for generating a synthetic partition key value for use with this cosmos DB sql collection. The template must - // include at least one of the following placeholders: {iothub}, {deviceid}, - // {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are - // arbitrary. This parameter is only required if PartitionKeyName is specified. + // The template for generating a synthetic partition key value for use with this cosmos DB sql container. The template must + // include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, + // {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. + // This parameter is only required if PartitionKeyName is specified. PartitionKeyTemplate *string // The primary key of the cosmos DB account. @@ -1164,8 +1164,8 @@ type RoutingCosmosDBSQLAPIProperties struct { // rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs // and only 1 custom endpoint is allowed across all endpoint types for free hubs. type RoutingEndpoints struct { - // The list of Cosmos DB collection endpoints that IoT hub routes messages to, based on the routing rules. - CosmosDBSQLCollections []*RoutingCosmosDBSQLAPIProperties + // The list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing rules. + CosmosDBSQLContainers []*RoutingCosmosDBSQLAPIProperties // The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include // the built-in Event Hubs endpoint. diff --git a/sdk/resourcemanager/iothub/armiothub/models_serde.go b/sdk/resourcemanager/iothub/armiothub/models_serde.go index 349b538e0e49..69dd3a13b776 100644 --- a/sdk/resourcemanager/iothub/armiothub/models_serde.go +++ b/sdk/resourcemanager/iothub/armiothub/models_serde.go @@ -2346,7 +2346,7 @@ func (r *RouteProperties) UnmarshalJSON(data []byte) error { func (r RoutingCosmosDBSQLAPIProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationType", r.AuthenticationType) - populate(objectMap, "collectionName", r.CollectionName) + populate(objectMap, "containerName", r.ContainerName) populate(objectMap, "databaseName", r.DatabaseName) populate(objectMap, "endpointUri", r.EndpointURI) populate(objectMap, "id", r.ID) @@ -2373,8 +2373,8 @@ func (r *RoutingCosmosDBSQLAPIProperties) UnmarshalJSON(data []byte) error { case "authenticationType": err = unpopulate(val, "AuthenticationType", &r.AuthenticationType) delete(rawMsg, key) - case "collectionName": - err = unpopulate(val, "CollectionName", &r.CollectionName) + case "containerName": + err = unpopulate(val, "ContainerName", &r.ContainerName) delete(rawMsg, key) case "databaseName": err = unpopulate(val, "DatabaseName", &r.DatabaseName) @@ -2420,7 +2420,7 @@ func (r *RoutingCosmosDBSQLAPIProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RoutingEndpoints. func (r RoutingEndpoints) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cosmosDBSqlCollections", r.CosmosDBSQLCollections) + populate(objectMap, "cosmosDBSqlContainers", r.CosmosDBSQLContainers) populate(objectMap, "eventHubs", r.EventHubs) populate(objectMap, "serviceBusQueues", r.ServiceBusQueues) populate(objectMap, "serviceBusTopics", r.ServiceBusTopics) @@ -2437,8 +2437,8 @@ func (r *RoutingEndpoints) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cosmosDBSqlCollections": - err = unpopulate(val, "CosmosDBSQLCollections", &r.CosmosDBSQLCollections) + case "cosmosDBSqlContainers": + err = unpopulate(val, "CosmosDBSQLContainers", &r.CosmosDBSQLContainers) delete(rawMsg, key) case "eventHubs": err = unpopulate(val, "EventHubs", &r.EventHubs) diff --git a/sdk/resourcemanager/iothub/armiothub/operations_client.go b/sdk/resourcemanager/iothub/armiothub/operations_client.go index 6039a35b13ba..67262b3a79e3 100644 --- a/sdk/resourcemanager/iothub/armiothub/operations_client.go +++ b/sdk/resourcemanager/iothub/armiothub/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available IoT Hub REST API operations. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - 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]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/iothub/armiothub/operations_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/operations_client_example_test.go deleted file mode 100644 index 7fc8008cda24..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/operations_client_example_test.go +++ /dev/null @@ -1,361 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_operations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armiothub.OperationListResult{ - // Value: []*armiothub.Operation{ - // { - // Name: to.Ptr("Microsoft.Devices/register/action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Register the subscription for the IotHub resource provider and enables the creation of IotHub resources"), - // Operation: to.Ptr("Register Resource Provider"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/IotHubs/diagnosticSettings/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource"), - // Operation: to.Ptr("Get Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/IotHubs/diagnosticSettings/write"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Set Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/IotHubs/metricDefinitions/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for the IotHub service"), - // Operation: to.Ptr("Read IotHub service metric definitions"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/IotHubs/logDefinitions/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the available log definitions for the IotHub Service"), - // Operation: to.Ptr("Read IotHub service log definitions"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/operations/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get All ResourceProvider Operations"), - // Operation: to.Ptr("Get All ResourceProvider Operations"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/checkNameAvailability/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Check If IotHub name is available"), - // Operation: to.Ptr("Check If IotHub name is available"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/usages/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get subscription usage details for this provider."), - // Operation: to.Ptr("Get Subscription Usages"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the IotHub resource(s)"), - // Operation: to.Ptr("Get IotHub(s)"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/Write"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Create or update IotHub Resource"), - // Operation: to.Ptr("Create or update IotHub Resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/Delete"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Delete IotHub Resource"), - // Operation: to.Ptr("Delete IotHub Resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/iotHubStats/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get IotHub Statistics"), - // Operation: to.Ptr("Get IotHub Statistics"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/skus/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get valid IotHub Skus"), - // Operation: to.Ptr("Get valid IotHub Skus"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/listkeys/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get all IotHub Keys"), - // Operation: to.Ptr("Get all IotHub Keys"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/iotHubKeys/listkeys/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get IotHub Key for the given name"), - // Operation: to.Ptr("Get IotHub Key for the given name"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Write"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Create EventHub Consumer Group"), - // Operation: to.Ptr("Create EventHub Consumer Group"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get EventHub Consumer Group(s)"), - // Operation: to.Ptr("Get EventHub Consumer Group(s)"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Delete"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Delete EventHub Consumer Group"), - // Operation: to.Ptr("Delete EventHub Consumer Group"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/exportDevices/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Export Devices"), - // Operation: to.Ptr("Export Devices"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/importDevices/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Import Devices"), - // Operation: to.Ptr("Import Devices"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/jobs/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get Job(s) details submitted on given IotHub"), - // Operation: to.Ptr("Get the Job(s) on IotHub"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/quotaMetrics/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get Quota Metrics"), - // Operation: to.Ptr("Get Quota Metrics"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/routing/routes/$testall/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Test a message against all existing Routes"), - // Operation: to.Ptr("Routing Rule Test All"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/routing/routes/$testnew/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Test a message against a provided test Route"), - // Operation: to.Ptr("Routing Rule Test Route"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/iotHubs/routingEndpointsHealth/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the health of all routing Endpoints for an IotHub"), - // Operation: to.Ptr("Get Endpoint Health"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/ProvisioningServices/diagnosticSettings/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource"), - // Operation: to.Ptr("Get Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/ProvisioningServices/diagnosticSettings/write"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Set Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/ProvisioningServices/metricDefinitions/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for the DPS service"), - // Operation: to.Ptr("Read DPS service metric definitions"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/ProvisioningServices/logDefinitions/read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Gets the available log definitions for the DPS Service"), - // Operation: to.Ptr("Read DPS service log definitions"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("IotHubs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/checkProvisioningServiceNameAvailability/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Check If Provisioning Service name is available"), - // Operation: to.Ptr("Check If Provisioning Service name is available"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServives"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/provisioningServices/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Get Provisioning Service resource"), - // Operation: to.Ptr("Get Provisioning Service resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServices"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/provisioningServices/Write"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Create Provisioning Service resource"), - // Operation: to.Ptr("Create Provisioning Service resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServices"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/provisioningServices/Delete"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Delete Provisioning Service resource"), - // Operation: to.Ptr("Delete Provisioning Service resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServices"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/provisioningServices/skus/Read"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("Delete Provisioning Service resource"), - // Operation: to.Ptr("Delete Provisioning Service resource"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServices"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Devices/provisioningServices/listkeys/Action"), - // Display: &armiothub.OperationDisplay{ - // Description: to.Ptr("get security related metadata"), - // Operation: to.Ptr("get security related metadata"), - // Provider: to.Ptr("Microsoft Devices"), - // Resource: to.Ptr("ProvisioningServices"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client.go b/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client.go index efcd3c6e8385..e6748e3854a3 100644 --- a/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client.go +++ b/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client.go @@ -47,7 +47,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Delete private endpoint connection with the specified name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - privateEndpointConnectionName - The name of the private endpoint connection @@ -68,7 +68,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Delete private endpoint connection with the specified name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { @@ -108,7 +108,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get private endpoint connection properties // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - privateEndpointConnectionName - The name of the private endpoint connection @@ -162,7 +162,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - List private endpoint connection properties // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -220,7 +220,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +238,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // BeginUpdate - 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-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - privateEndpointConnectionName - The name of the private endpoint connection @@ -260,7 +260,7 @@ func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, // Update - 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-11-15-preview +// Generated from API version 2023-06-30-preview func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { @@ -300,7 +300,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnection) diff --git a/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client_example_test.go deleted file mode 100644 index 702faa368ba2..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_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/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivateendpointconnections.json -func ExamplePrivateEndpointConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().List(ctx, "myResourceGroup", "testHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionArray = []*armiothub.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateEndpointConnections/myPrivateEndpointConnection"), - // Properties: &armiothub.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armiothub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/a9eba280-4734-4d49-878f-b5549d1d0453/resourceGroups/networkResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armiothub.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Please approve my request!"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armiothub.PrivateLinkServiceConnectionStatusPending), - // }, - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivateendpointconnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "testHub", "myPrivateEndpointConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armiothub.PrivateEndpointConnection{ - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateEndpointConnections/myPrivateEndpointConnection"), - // Properties: &armiothub.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armiothub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/a9eba280-4734-4d49-878f-b5549d1d0453/resourceGroups/networkResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armiothub.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Please approve my request!"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armiothub.PrivateLinkServiceConnectionStatusPending), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_updateprivateendpointconnection.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdate(ctx, "myResourceGroup", "testHub", "myPrivateEndpointConnection", armiothub.PrivateEndpointConnection{ - Properties: &armiothub.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armiothub.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armiothub.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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armiothub.PrivateEndpointConnection{ - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateEndpointConnections/myPrivateEndpointConnection"), - // Properties: &armiothub.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armiothub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/a9eba280-4734-4d49-878f-b5549d1d0453/resourceGroups/networkResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armiothub.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armiothub.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteprivateendpointconnection.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "testHub", "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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armiothub.PrivateEndpointConnection{ - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateEndpointConnections/myPrivateEndpointConnection"), - // Properties: &armiothub.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armiothub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/a9eba280-4734-4d49-878f-b5549d1d0453/resourceGroups/networkResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armiothub.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Deleted"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armiothub.PrivateLinkServiceConnectionStatusDisconnected), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client.go b/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client.go index 85400964155a..b43e236a74f5 100644 --- a/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client.go +++ b/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client.go @@ -47,7 +47,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Get the specified private link resource for the given IotHub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - groupID - The name of the private link resource @@ -92,7 +92,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // List - List private link resources for the given IotHub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List @@ -150,7 +150,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client_example_test.go deleted file mode 100644 index af89a22e54a1..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivatelinkresources.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().List(ctx, "myResourceGroup", "testHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResources = armiothub.PrivateLinkResources{ - // Value: []*armiothub.GroupIDInformation{ - // { - // Name: to.Ptr("iotHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateLinkResources"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateLinkResources/iotHub"), - // Properties: &armiothub.GroupIDInformationProperties{ - // GroupID: to.Ptr("iotHub"), - // RequiredMembers: []*string{ - // to.Ptr("iotHub")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azure-devices.net")}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivatelinkresources.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "myResourceGroup", "testHub", "iotHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GroupIDInformation = armiothub.GroupIDInformation{ - // Name: to.Ptr("iotHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/PrivateLinkResources"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/PrivateLinkResources/iotHub"), - // Properties: &armiothub.GroupIDInformationProperties{ - // GroupID: to.Ptr("iotHub"), - // RequiredMembers: []*string{ - // to.Ptr("iotHub")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azure-devices.net")}, - // }, - // } -} diff --git a/sdk/resourcemanager/iothub/armiothub/resource_client.go b/sdk/resourcemanager/iothub/armiothub/resource_client.go index d220839a267c..e760d49858fc 100644 --- a/sdk/resourcemanager/iothub/armiothub/resource_client.go +++ b/sdk/resourcemanager/iothub/armiothub/resource_client.go @@ -47,7 +47,7 @@ func NewResourceClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Check if an IoT hub name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - operationInputs - Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. // - options - ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability // method. @@ -78,7 +78,7 @@ func (client *ResourceClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, operationInputs) @@ -96,7 +96,7 @@ func (client *ResourceClient) checkNameAvailabilityHandleResponse(resp *http.Res // CreateEventHubConsumerGroup - Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - eventHubEndpointName - The name of the Event Hub-compatible endpoint in the IoT hub. @@ -147,7 +147,7 @@ func (client *ResourceClient) createEventHubConsumerGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, consumerGroupBody) @@ -167,7 +167,7 @@ func (client *ResourceClient) createEventHubConsumerGroupHandleResponse(resp *ht // body to update the IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - iotHubDescription - The IoT hub metadata and security metadata. @@ -190,7 +190,7 @@ func (client *ResourceClient) BeginCreateOrUpdate(ctx context.Context, resourceG // body to update the IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview func (client *ResourceClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotHubDescription Description, options *ResourceClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, iotHubDescription, options) if err != nil { @@ -226,7 +226,7 @@ func (client *ResourceClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -238,7 +238,7 @@ func (client *ResourceClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientBeginDeleteOptions contains the optional parameters for the ResourceClient.BeginDelete method. @@ -257,7 +257,7 @@ func (client *ResourceClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview func (client *ResourceClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ResourceClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -293,7 +293,7 @@ func (client *ResourceClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +302,7 @@ func (client *ResourceClient) deleteCreateRequest(ctx context.Context, resourceG // DeleteEventHubConsumerGroup - Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - eventHubEndpointName - The name of the Event Hub-compatible endpoint in the IoT hub. @@ -352,7 +352,7 @@ func (client *ResourceClient) deleteEventHubConsumerGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +363,7 @@ func (client *ResourceClient) deleteEventHubConsumerGroupCreateRequest(ctx conte // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - exportDevicesParameters - The parameters that specify the export devices operation. @@ -403,7 +403,7 @@ func (client *ResourceClient) exportDevicesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, exportDevicesParameters) @@ -421,7 +421,7 @@ func (client *ResourceClient) exportDevicesHandleResponse(resp *http.Response) ( // Get - Get the non-security related metadata of an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientGetOptions contains the optional parameters for the ResourceClient.Get method. @@ -460,7 +460,7 @@ func (client *ResourceClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +477,7 @@ func (client *ResourceClient) getHandleResponse(resp *http.Response) (ResourceCl // NewGetEndpointHealthPager - Get the health for routing endpoints. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - options - ResourceClientGetEndpointHealthOptions contains the optional parameters for the ResourceClient.NewGetEndpointHealthPager // method. func (client *ResourceClient) NewGetEndpointHealthPager(resourceGroupName string, iotHubName string, options *ResourceClientGetEndpointHealthOptions) *runtime.Pager[ResourceClientGetEndpointHealthResponse] { @@ -528,7 +528,7 @@ func (client *ResourceClient) getEndpointHealthCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -546,7 +546,7 @@ func (client *ResourceClient) getEndpointHealthHandleResponse(resp *http.Respons // GetEventHubConsumerGroup - Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - eventHubEndpointName - The name of the Event Hub-compatible endpoint in the IoT hub. @@ -596,7 +596,7 @@ func (client *ResourceClient) getEventHubConsumerGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -614,7 +614,7 @@ func (client *ResourceClient) getEventHubConsumerGroupHandleResponse(resp *http. // GetJob - Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - jobID - The job identifier. @@ -658,7 +658,7 @@ func (client *ResourceClient) getJobCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -676,7 +676,7 @@ func (client *ResourceClient) getJobHandleResponse(resp *http.Response) (Resourc // GetKeysForKeyName - Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - keyName - The name of the shared access policy. @@ -721,7 +721,7 @@ func (client *ResourceClient) getKeysForKeyNameCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -738,7 +738,7 @@ func (client *ResourceClient) getKeysForKeyNameHandleResponse(resp *http.Respons // NewGetQuotaMetricsPager - Get the quota metrics for an IoT hub. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientGetQuotaMetricsOptions contains the optional parameters for the ResourceClient.NewGetQuotaMetricsPager @@ -791,7 +791,7 @@ func (client *ResourceClient) getQuotaMetricsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -809,7 +809,7 @@ func (client *ResourceClient) getQuotaMetricsHandleResponse(resp *http.Response) // GetStats - Get the statistics from an IoT hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientGetStatsOptions contains the optional parameters for the ResourceClient.GetStats method. @@ -848,7 +848,7 @@ func (client *ResourceClient) getStatsCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -865,7 +865,7 @@ func (client *ResourceClient) getStatsHandleResponse(resp *http.Response) (Resou // NewGetValidSKUsPager - Get the list of valid SKUs for an IoT hub. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientGetValidSKUsOptions contains the optional parameters for the ResourceClient.NewGetValidSKUsPager @@ -918,7 +918,7 @@ func (client *ResourceClient) getValidSKUsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -938,7 +938,7 @@ func (client *ResourceClient) getValidSKUsHandleResponse(resp *http.Response) (R // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - importDevicesParameters - The parameters that specify the import devices operation. @@ -978,7 +978,7 @@ func (client *ResourceClient) importDevicesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, importDevicesParameters) @@ -995,7 +995,7 @@ func (client *ResourceClient) importDevicesHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Get all the IoT hubs in a resource group. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - options - ResourceClientListByResourceGroupOptions contains the optional parameters for the ResourceClient.NewListByResourceGroupPager // method. @@ -1043,7 +1043,7 @@ func (client *ResourceClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1060,7 +1060,7 @@ func (client *ResourceClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Get all the IoT hubs in a subscription. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - options - ResourceClientListBySubscriptionOptions contains the optional parameters for the ResourceClient.NewListBySubscriptionPager // method. func (client *ResourceClient) NewListBySubscriptionPager(options *ResourceClientListBySubscriptionOptions) *runtime.Pager[ResourceClientListBySubscriptionResponse] { @@ -1103,7 +1103,7 @@ func (client *ResourceClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1121,7 +1121,7 @@ func (client *ResourceClient) listBySubscriptionHandleResponse(resp *http.Respon // NewListEventHubConsumerGroupsPager - Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint // in an IoT hub. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - eventHubEndpointName - The name of the Event Hub-compatible endpoint. @@ -1179,7 +1179,7 @@ func (client *ResourceClient) listEventHubConsumerGroupsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1196,7 +1196,7 @@ func (client *ResourceClient) listEventHubConsumerGroupsHandleResponse(resp *htt // NewListJobsPager - Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientListJobsOptions contains the optional parameters for the ResourceClient.NewListJobsPager method. @@ -1248,7 +1248,7 @@ func (client *ResourceClient) listJobsCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1265,7 +1265,7 @@ func (client *ResourceClient) listJobsHandleResponse(resp *http.Response) (Resou // NewListKeysPager - Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - The name of the resource group that contains the IoT hub. // - resourceName - The name of the IoT hub. // - options - ResourceClientListKeysOptions contains the optional parameters for the ResourceClient.NewListKeysPager method. @@ -1317,7 +1317,7 @@ func (client *ResourceClient) listKeysCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1335,7 +1335,7 @@ func (client *ResourceClient) listKeysHandleResponse(resp *http.Response) (Resou // TestAllRoutes - Test all routes configured in this Iot Hub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - iotHubName - IotHub to be tested // - resourceGroupName - resource group which Iot Hub belongs to // - input - Input for testing all routes @@ -1375,7 +1375,7 @@ func (client *ResourceClient) testAllRoutesCreateRequest(ctx context.Context, io return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, input) @@ -1393,7 +1393,7 @@ func (client *ResourceClient) testAllRoutesHandleResponse(resp *http.Response) ( // TestRoute - Test the new route for this Iot Hub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - iotHubName - IotHub to be tested // - resourceGroupName - resource group which Iot Hub belongs to // - input - Route that needs to be tested @@ -1433,7 +1433,7 @@ func (client *ResourceClient) testRouteCreateRequest(ctx context.Context, iotHub return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, input) @@ -1451,7 +1451,7 @@ func (client *ResourceClient) testRouteHandleResponse(resp *http.Response) (Reso // BeginUpdate - Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - resourceGroupName - Resource group identifier. // - resourceName - Name of iot hub to update. // - iotHubTags - Updated tag information to set into the iot hub instance. @@ -1471,7 +1471,7 @@ func (client *ResourceClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview func (client *ResourceClient) update(ctx context.Context, resourceGroupName string, resourceName string, iotHubTags TagsResource, options *ResourceClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, iotHubTags, options) if err != nil { @@ -1507,7 +1507,7 @@ func (client *ResourceClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, iotHubTags) diff --git a/sdk/resourcemanager/iothub/armiothub/resource_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/resource_client_example_test.go deleted file mode 100644 index 4f4585375150..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/resource_client_example_test.go +++ /dev/null @@ -1,1535 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_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/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_get.json -func ExampleResourceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().Get(ctx, "myResourceGroup", "testHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Description = armiothub.Description{ - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // DeviceStreams: &armiothub.PropertiesDeviceStreams{ - // StreamingEndpoints: []*string{ - // to.Ptr("https://streams.azure-devices-int.net:9443")}, - // }, - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // IPVersion: to.Ptr(armiothub.IPVersionIPv4IPv6), - // Locations: []*armiothub.LocationDescription{ - // { - // Location: to.Ptr("West US"), - // Role: to.Ptr(armiothub.IotHubReplicaRoleTypePrimary), - // }, - // { - // Location: to.Ptr("East US"), - // Role: to.Ptr(armiothub.IotHubReplicaRoleTypeSecondary), - // }}, - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // MinTLSVersion: to.Ptr("1.2"), - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createOrUpdate.json -func ExampleResourceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "testHub", armiothub.Description{ - Location: to.Ptr("centraluseuap"), - Tags: map[string]*string{}, - Etag: to.Ptr("AAAAAAFD6M4="), - Properties: &armiothub.Properties{ - CloudToDevice: &armiothub.CloudToDeviceProperties{ - DefaultTTLAsIso8601: to.Ptr("PT1H"), - Feedback: &armiothub.FeedbackProperties{ - LockDurationAsIso8601: to.Ptr("PT1M"), - MaxDeliveryCount: to.Ptr[int32](10), - TTLAsIso8601: to.Ptr("PT1H"), - }, - MaxDeliveryCount: to.Ptr[int32](10), - }, - EnableDataResidency: to.Ptr(true), - EnableFileUploadNotifications: to.Ptr(false), - EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - "events": { - PartitionCount: to.Ptr[int32](2), - RetentionTimeInDays: to.Ptr[int64](1), - }, - }, - Features: to.Ptr(armiothub.CapabilitiesNone), - IPFilterRules: []*armiothub.IPFilterRule{}, - IPVersion: to.Ptr(armiothub.IPVersionIPv4IPv6), - MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - "fileNotifications": { - LockDurationAsIso8601: to.Ptr("PT1M"), - MaxDeliveryCount: to.Ptr[int32](10), - TTLAsIso8601: to.Ptr("PT1H"), - }, - }, - MinTLSVersion: to.Ptr("1.2"), - NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - IPRules: []*armiothub.NetworkRuleSetIPRule{ - { - Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - FilterName: to.Ptr("rule1"), - IPMask: to.Ptr("131.117.159.53"), - }, - { - Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - FilterName: to.Ptr("rule2"), - IPMask: to.Ptr("157.55.59.128/25"), - }}, - }, - RootCertificate: &armiothub.RootCertificateProperties{ - EnableRootCertificateV2: to.Ptr(true), - }, - Routing: &armiothub.RoutingProperties{ - Endpoints: &armiothub.RoutingEndpoints{ - EventHubs: []*armiothub.RoutingEventHubProperties{}, - ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{}, - ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{}, - StorageContainers: []*armiothub.RoutingStorageContainerProperties{}, - }, - FallbackRoute: &armiothub.FallbackRouteProperties{ - Name: to.Ptr("$fallback"), - Condition: to.Ptr("true"), - EndpointNames: []*string{ - to.Ptr("events")}, - IsEnabled: to.Ptr(true), - Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - }, - Routes: []*armiothub.RouteProperties{}, - }, - StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - "$default": { - ConnectionString: to.Ptr(""), - ContainerName: to.Ptr(""), - SasTTLAsIso8601: to.Ptr("PT1H"), - }, - }, - }, - SKU: &armiothub.SKUInfo{ - Name: to.Ptr(armiothub.IotHubSKUS1), - Capacity: to.Ptr[int64](1), - }, - }, &armiothub.ResourceClientBeginCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Description = armiothub.Description{ - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // EnableDataResidency: to.Ptr(true), - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // IPVersion: to.Ptr(armiothub.IPVersionIPv4IPv6), - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // MinTLSVersion: to.Ptr("1.2"), - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RootCertificate: &armiothub.RootCertificateProperties{ - // EnableRootCertificateV2: to.Ptr(true), - // LastUpdatedTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-08T11:16:49.0748958-07:00"); return t}()), - // }, - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Name: to.Ptr("$fallback"), - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_patch.json -func ExampleResourceClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceClient().BeginUpdate(ctx, "myResourceGroup", "myHub", armiothub.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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Description = armiothub.Description{ - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/ae24ff83-d2ca-4fc8-9717-05dae4bba489/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "foo": to.Ptr("bar"), - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Name: to.Ptr("$fallback"), - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_delete.json -func ExampleResourceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceClient().BeginDelete(ctx, "myResourceGroup", "testHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Description = armiothub.Description{ - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbysubscription.json -func ExampleResourceClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DescriptionListResult = armiothub.DescriptionListResult{ - // Value: []*armiothub.Description{ - // { - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Name: to.Ptr("$fallback"), - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbyrg.json -func ExampleResourceClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DescriptionListResult = armiothub.DescriptionListResult{ - // Value: []*armiothub.Description{ - // { - // Name: to.Ptr("testHub"), - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // ID: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("AAAAAAFD6M4="), - // Properties: &armiothub.Properties{ - // CloudToDevice: &armiothub.CloudToDeviceProperties{ - // DefaultTTLAsIso8601: to.Ptr("PT1H"), - // Feedback: &armiothub.FeedbackProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // MaxDeliveryCount: to.Ptr[int32](10), - // }, - // EnableFileUploadNotifications: to.Ptr(false), - // EventHubEndpoints: map[string]*armiothub.EventHubProperties{ - // "events": &armiothub.EventHubProperties{ - // Path: to.Ptr("iot-dps-cit-hub-1"), - // Endpoint: to.Ptr("sb://iothub-ns-iot-dps-ci-245306-76aca8e13b.servicebus.windows.net/"), - // PartitionCount: to.Ptr[int32](2), - // PartitionIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // RetentionTimeInDays: to.Ptr[int64](1), - // }, - // }, - // Features: to.Ptr(armiothub.CapabilitiesNone), - // HostName: to.Ptr("iot-dps-cit-hub-1.azure-devices.net"), - // IPFilterRules: []*armiothub.IPFilterRule{ - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.IPFilterActionTypeAccept), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // MessagingEndpoints: map[string]*armiothub.MessagingEndpointProperties{ - // "fileNotifications": &armiothub.MessagingEndpointProperties{ - // LockDurationAsIso8601: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // TTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // NetworkRuleSets: &armiothub.NetworkRuleSetProperties{ - // ApplyToBuiltInEventHubEndpoint: to.Ptr(true), - // DefaultAction: to.Ptr(armiothub.DefaultActionDeny), - // IPRules: []*armiothub.NetworkRuleSetIPRule{ - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule1"), - // IPMask: to.Ptr("131.117.159.53"), - // }, - // { - // Action: to.Ptr(armiothub.NetworkRuleIPActionAllow), - // FilterName: to.Ptr("rule2"), - // IPMask: to.Ptr("157.55.59.128/25"), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Routing: &armiothub.RoutingProperties{ - // Endpoints: &armiothub.RoutingEndpoints{ - // EventHubs: []*armiothub.RoutingEventHubProperties{ - // }, - // ServiceBusQueues: []*armiothub.RoutingServiceBusQueueEndpointProperties{ - // }, - // ServiceBusTopics: []*armiothub.RoutingServiceBusTopicEndpointProperties{ - // }, - // StorageContainers: []*armiothub.RoutingStorageContainerProperties{ - // }, - // }, - // FallbackRoute: &armiothub.FallbackRouteProperties{ - // Name: to.Ptr("$fallback"), - // Condition: to.Ptr("true"), - // EndpointNames: []*string{ - // to.Ptr("events")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // Routes: []*armiothub.RouteProperties{ - // }, - // }, - // State: to.Ptr("Active"), - // StorageEndpoints: map[string]*armiothub.StorageEndpointProperties{ - // "$default": &armiothub.StorageEndpointProperties{ - // ConnectionString: to.Ptr(""), - // ContainerName: to.Ptr(""), - // SasTTLAsIso8601: to.Ptr("PT1H"), - // }, - // }, - // }, - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Capacity: to.Ptr[int64](1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // SystemData: &armiothub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-30T00:28:38.963Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_stats.json -func ExampleResourceClient_GetStats() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().GetStats(ctx, "myResourceGroup", "testHub", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryStatistics = armiothub.RegistryStatistics{ - // DisabledDeviceCount: to.Ptr[int64](0), - // EnabledDeviceCount: to.Ptr[int64](0), - // TotalDeviceCount: to.Ptr[int64](0), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getskus.json -func ExampleResourceClient_NewGetValidSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewGetValidSKUsPager("myResourceGroup", "testHub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUDescriptionListResult = armiothub.SKUDescriptionListResult{ - // Value: []*armiothub.SKUDescription{ - // { - // Capacity: &armiothub.Capacity{ - // Default: to.Ptr[int64](1), - // ScaleType: to.Ptr(armiothub.IotHubScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.Devices/IotHubs"), - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS1), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // }, - // { - // Capacity: &armiothub.Capacity{ - // Default: to.Ptr[int64](1), - // Maximum: to.Ptr[int64](200), - // Minimum: to.Ptr[int64](1), - // ScaleType: to.Ptr(armiothub.IotHubScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.Devices/IotHubs"), - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS2), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // }, - // { - // Capacity: &armiothub.Capacity{ - // Default: to.Ptr[int64](1), - // Maximum: to.Ptr[int64](10), - // Minimum: to.Ptr[int64](1), - // ScaleType: to.Ptr(armiothub.IotHubScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.Devices/IotHubs"), - // SKU: &armiothub.SKUInfo{ - // Name: to.Ptr(armiothub.IotHubSKUS3), - // Tier: to.Ptr(armiothub.IotHubSKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listehgroups.json -func ExampleResourceClient_NewListEventHubConsumerGroupsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewListEventHubConsumerGroupsPager("myResourceGroup", "testHub", "events", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventHubConsumerGroupsListResult = armiothub.EventHubConsumerGroupsListResult{ - // Value: []*armiothub.EventHubConsumerGroupInfo{ - // { - // Name: to.Ptr("$Default"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups"), - // Etag: to.Ptr("AAAAAAFD6M4="), - // ID: to.Ptr("/subscriptions/cmd-sub-1/resourceGroups/cmd-rg-1/providers/Microsoft.Devices/IotHubs/test-hub-2/eventHubEndpoints/events/ConsumerGroups/%24Default"), - // Properties: map[string]any{ - // "created": "Thu, 15 Jun 2017 19:20:58 GMT", - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getconsumergroup.json -func ExampleResourceClient_GetEventHubConsumerGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().GetEventHubConsumerGroup(ctx, "myResourceGroup", "testHub", "events", "test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventHubConsumerGroupInfo = armiothub.EventHubConsumerGroupInfo{ - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups"), - // Etag: to.Ptr("AAAAAAFD6M4="), - // ID: to.Ptr("/subscriptions/cmd-sub-1/resourceGroups/cmd-rg-1/providers/Microsoft.Devices/IotHubs/test-hub-2/eventHubEndpoints/events/ConsumerGroups/%24Default"), - // Properties: map[string]any{ - // "created": "Thu, 15 Jun 2017 19:20:58 GMT", - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createconsumergroup.json -func ExampleResourceClient_CreateEventHubConsumerGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().CreateEventHubConsumerGroup(ctx, "myResourceGroup", "testHub", "events", "test", armiothub.EventHubConsumerGroupBodyDescription{ - Properties: &armiothub.EventHubConsumerGroupName{ - Name: to.Ptr("test"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventHubConsumerGroupInfo = armiothub.EventHubConsumerGroupInfo{ - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups"), - // Etag: to.Ptr("AAAAAAFD6M4="), - // ID: to.Ptr("/subscriptions/cmd-sub-1/resourceGroups/cmd-rg-1/providers/Microsoft.Devices/IotHubs/test-hub-2/eventHubEndpoints/events/ConsumerGroups/%24Default"), - // Properties: map[string]any{ - // "created": "Thu, 15 Jun 2017 19:20:58 GMT", - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteconsumergroup.json -func ExampleResourceClient_DeleteEventHubConsumerGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewResourceClient().DeleteEventHubConsumerGroup(ctx, "myResourceGroup", "testHub", "events", "test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listjobs.json -func ExampleResourceClient_NewListJobsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewListJobsPager("myResourceGroup", "testHub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResponseListResult = armiothub.JobResponseListResult{ - // Value: []*armiothub.JobResponse{ - // { - // Type: to.Ptr(armiothub.JobTypeUnknown), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // JobID: to.Ptr("test"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // Status: to.Ptr(armiothub.JobStatusUnknown), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getjob.json -func ExampleResourceClient_GetJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().GetJob(ctx, "myResourceGroup", "testHub", "test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResponse = armiothub.JobResponse{ - // Type: to.Ptr(armiothub.JobTypeUnknown), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // JobID: to.Ptr("test"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // Status: to.Ptr(armiothub.JobStatusUnknown), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_quotametrics.json -func ExampleResourceClient_NewGetQuotaMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewGetQuotaMetricsPager("myResourceGroup", "testHub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QuotaMetricInfoListResult = armiothub.QuotaMetricInfoListResult{ - // Value: []*armiothub.QuotaMetricInfo{ - // { - // Name: to.Ptr("TotalMessages"), - // CurrentValue: to.Ptr[int64](0), - // MaxValue: to.Ptr[int64](400000), - // }, - // { - // Name: to.Ptr("TotalDeviceCount"), - // CurrentValue: to.Ptr[int64](0), - // MaxValue: to.Ptr[int64](500000), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_routingendpointhealth.json -func ExampleResourceClient_NewGetEndpointHealthPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewGetEndpointHealthPager("myResourceGroup", "testHub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EndpointHealthDataListResult = armiothub.EndpointHealthDataListResult{ - // Value: []*armiothub.EndpointHealthData{ - // { - // EndpointID: to.Ptr("id1"), - // HealthStatus: to.Ptr(armiothub.EndpointHealthStatusHealthy), - // LastSendAttemptTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Wed, 13 Sep 2017 18:04:32 GMT"); return t}()), - // LastSuccessfulSendAttemptTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Wed, 13 Sep 2017 18:04:32 GMT"); return t}()), - // }, - // { - // EndpointID: to.Ptr("id2"), - // HealthStatus: to.Ptr(armiothub.EndpointHealthStatusUnknown), - // }, - // { - // EndpointID: to.Ptr("id3"), - // HealthStatus: to.Ptr(armiothub.EndpointHealthStatusUnhealthy), - // LastKnownError: to.Ptr("NotFound"), - // LastKnownErrorTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Wed, 13 Sep 2017 18:04:32 GMT"); return t}()), - // LastSendAttemptTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Wed, 13 Sep 2017 18:04:32 GMT"); return t}()), - // LastSuccessfulSendAttemptTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Wed, 13 Sep 2017 18:04:32 GMT"); return t}()), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/checkNameAvailability.json -func ExampleResourceClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().CheckNameAvailability(ctx, armiothub.OperationInputs{ - Name: to.Ptr("test-request"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailabilityInfo = armiothub.NameAvailabilityInfo{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armiothub.IotHubNameUnavailabilityReasonInvalid), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testallroutes.json -func ExampleResourceClient_TestAllRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().TestAllRoutes(ctx, "testHub", "myResourceGroup", armiothub.TestAllRoutesInput{ - Message: &armiothub.RoutingMessage{ - AppProperties: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Body: to.Ptr("Body of message"), - SystemProperties: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - RoutingSource: to.Ptr(armiothub.RoutingSourceDeviceMessages), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestAllRoutesResult = armiothub.TestAllRoutesResult{ - // Routes: []*armiothub.MatchedRoute{ - // { - // Properties: &armiothub.RouteProperties{ - // Name: to.Ptr("Routeid"), - // EndpointNames: []*string{ - // to.Ptr("id1")}, - // IsEnabled: to.Ptr(true), - // Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testnewroute.json -func ExampleResourceClient_TestRoute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().TestRoute(ctx, "testHub", "myResourceGroup", armiothub.TestRouteInput{ - Message: &armiothub.RoutingMessage{ - AppProperties: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Body: to.Ptr("Body of message"), - SystemProperties: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - Route: &armiothub.RouteProperties{ - Name: to.Ptr("Routeid"), - EndpointNames: []*string{ - to.Ptr("id1")}, - IsEnabled: to.Ptr(true), - Source: to.Ptr(armiothub.RoutingSourceDeviceMessages), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestRouteResult = armiothub.TestRouteResult{ - // Result: to.Ptr(armiothub.TestResultStatusFalse), - // Details: &armiothub.TestRouteResultDetails{ - // CompilationErrors: []*armiothub.RouteCompilationError{ - // { - // Location: &armiothub.RouteErrorRange{ - // End: &armiothub.RouteErrorPosition{ - // Column: to.Ptr[int32](24), - // Line: to.Ptr[int32](12), - // }, - // Start: &armiothub.RouteErrorPosition{ - // Column: to.Ptr[int32](12), - // Line: to.Ptr[int32](12), - // }, - // }, - // Message: to.Ptr("string response"), - // Severity: to.Ptr(armiothub.RouteErrorSeverityError), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listkeys.json -func ExampleResourceClient_NewListKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceClient().NewListKeysPager("myResourceGroup", "testHub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SharedAccessSignatureAuthorizationRuleListResult = armiothub.SharedAccessSignatureAuthorizationRuleListResult{ - // Value: []*armiothub.SharedAccessSignatureAuthorizationRule{ - // { - // KeyName: to.Ptr("iothubowner"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsRegistryWriteServiceConnectDeviceConnect), - // SecondaryKey: to.Ptr(""), - // }, - // { - // KeyName: to.Ptr("service"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsServiceConnect), - // SecondaryKey: to.Ptr(""), - // }, - // { - // KeyName: to.Ptr("device"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsDeviceConnect), - // SecondaryKey: to.Ptr(""), - // }, - // { - // KeyName: to.Ptr("registryRead"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsRegistryRead), - // SecondaryKey: to.Ptr(""), - // }, - // { - // KeyName: to.Ptr("registryReadWrite"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsRegistryWrite), - // SecondaryKey: to.Ptr(""), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getkey.json -func ExampleResourceClient_GetKeysForKeyName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().GetKeysForKeyName(ctx, "myResourceGroup", "testHub", "iothubowner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedAccessSignatureAuthorizationRule = armiothub.SharedAccessSignatureAuthorizationRule{ - // KeyName: to.Ptr("iothubowner"), - // PrimaryKey: to.Ptr(""), - // Rights: to.Ptr(armiothub.AccessRightsRegistryWriteServiceConnectDeviceConnect), - // SecondaryKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_exportdevices.json -func ExampleResourceClient_ExportDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().ExportDevices(ctx, "myResourceGroup", "testHub", armiothub.ExportDevicesRequest{ - AuthenticationType: to.Ptr(armiothub.AuthenticationTypeIdentityBased), - ExcludeKeys: to.Ptr(true), - ExportBlobContainerURI: to.Ptr("testBlob"), - Identity: &armiothub.ManagedIdentity{ - UserAssignedIdentity: to.Ptr("/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResponse = armiothub.JobResponse{ - // Type: to.Ptr(armiothub.JobTypeUnknown), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // JobID: to.Ptr("test"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // Status: to.Ptr(armiothub.JobStatusUnknown), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_importdevices.json -func ExampleResourceClient_ImportDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().ImportDevices(ctx, "myResourceGroup", "testHub", armiothub.ImportDevicesRequest{ - InputBlobContainerURI: to.Ptr("testBlob"), - OutputBlobContainerURI: to.Ptr("testBlob"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResponse = armiothub.JobResponse{ - // Type: to.Ptr(armiothub.JobTypeUnknown), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // JobID: to.Ptr("test"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "Thu, 15 Jun 2017 19:20:58 GMT"); return t}()), - // Status: to.Ptr(armiothub.JobStatusUnknown), - // } -} diff --git a/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client.go b/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client.go index 878891404e55..689d2b4ee26d 100644 --- a/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client.go +++ b/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client.go @@ -47,7 +47,7 @@ func NewResourceProviderCommonClient(subscriptionID string, credential azcore.To // GetSubscriptionQuota - Get the number of free and paid iot hubs in the subscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-15-preview +// Generated from API version 2023-06-30-preview // - options - ResourceProviderCommonClientGetSubscriptionQuotaOptions contains the optional parameters for the ResourceProviderCommonClient.GetSubscriptionQuota // method. func (client *ResourceProviderCommonClient) GetSubscriptionQuota(ctx context.Context, options *ResourceProviderCommonClientGetSubscriptionQuotaOptions) (ResourceProviderCommonClientGetSubscriptionQuotaResponse, error) { @@ -77,7 +77,7 @@ func (client *ResourceProviderCommonClient) getSubscriptionQuotaCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-15-preview") + reqQP.Set("api-version", "2023-06-30-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client_example_test.go b/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client_example_test.go deleted file mode 100644 index fac287f21d38..000000000000 --- a/sdk/resourcemanager/iothub/armiothub/resourceprovidercommon_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armiothub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_usages.json -func ExampleResourceProviderCommonClient_GetSubscriptionQuota() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armiothub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceProviderCommonClient().GetSubscriptionQuota(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UserSubscriptionQuotaListResult = armiothub.UserSubscriptionQuotaListResult{ - // Value: []*armiothub.UserSubscriptionQuota{ - // { - // Name: &armiothub.Name{ - // LocalizedValue: to.Ptr("Free Hub Count"), - // Value: to.Ptr("FreeHubCount"), - // }, - // Type: to.Ptr("/subscription/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/usages"), - // CurrentValue: to.Ptr[int32](1), - // ID: to.Ptr("/subscription/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/usages/freeHubCount"), - // Limit: to.Ptr[int32](1), - // Unit: to.Ptr("count"), - // }}, - // } -}