From f109aa60fca01e038956e84e5ad4fe238c9f96a5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 29 Mar 2023 20:24:28 +0000 Subject: [PATCH] CodeGen from PR 23292 in Azure/azure-rest-api-specs Merge 7da53492a21fd2ef7be5aea90dc3a7f4a939b387 into e5d60da002b234ddaf61d8a4176a832f9d2b14ea --- .../resources/armfeatures/CHANGELOG.md | 4 + .../resources/armfeatures/autorest.md | 6 +- .../armfeatures/client_example_test.go | 190 ----------------- .../resources/armfeatures/constants.go | 2 +- .../feature_client_example_test.go | 62 ------ .../resources/armfeatures/go.mod | 2 +- ...eatureregistrations_client_example_test.go | 198 ------------------ 7 files changed, 9 insertions(+), 455 deletions(-) delete mode 100644 sdk/resourcemanager/resources/armfeatures/client_example_test.go delete mode 100644 sdk/resourcemanager/resources/armfeatures/feature_client_example_test.go delete mode 100644 sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client_example_test.go diff --git a/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md b/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md index 3beb23d2c9af..7b0c44c2e656 100644 --- a/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.1 (2023-03-29) +### Other Changes + + ## 1.1.0 (2023-03-27) ### Features Added diff --git a/sdk/resourcemanager/resources/armfeatures/autorest.md b/sdk/resourcemanager/resources/armfeatures/autorest.md index e5ed13cb7e7d..4d45681bb208 100644 --- a/sdk/resourcemanager/resources/armfeatures/autorest.md +++ b/sdk/resourcemanager/resources/armfeatures/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 1.1.1 package-features: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armfeatures/client_example_test.go b/sdk/resourcemanager/resources/armfeatures/client_example_test.go deleted file mode 100644 index 3a2e23b144cb..000000000000 --- a/sdk/resourcemanager/resources/armfeatures/client_example_test.go +++ /dev/null @@ -1,190 +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 armfeatures_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listSubscriptionFeatures.json -func ExampleClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListAllPager(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.FeatureOperationsListResult = armfeatures.FeatureOperationsListResult{ - // Value: []*armfeatures.FeatureResult{ - // { - // Name: to.Ptr("Feature1"), - // Type: to.Ptr("type1"), - // ID: to.Ptr("feature_id1"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("registered"), - // }, - // }, - // { - // Name: to.Ptr("Feature2"), - // Type: to.Ptr("type2"), - // ID: to.Ptr("feature_id2"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("unregistered"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listProviderFeatures.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListPager("Resource Provider Namespace", 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.FeatureOperationsListResult = armfeatures.FeatureOperationsListResult{ - // Value: []*armfeatures.FeatureResult{ - // { - // Name: to.Ptr("Feature1"), - // Type: to.Ptr("type1"), - // ID: to.Ptr("feature_id1"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("registered"), - // }, - // }, - // { - // Name: to.Ptr("Feature2"), - // Type: to.Ptr("type2"), - // ID: to.Ptr("feature_id2"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("unregistered"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/getFeature.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "Resource Provider Namespace", "feature", 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.FeatureResult = armfeatures.FeatureResult{ - // Name: to.Ptr("Feature1"), - // Type: to.Ptr("type1"), - // ID: to.Ptr("feature_id1"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("registered"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/registerFeature.json -func ExampleClient_Register() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Register(ctx, "Resource Provider Namespace", "feature", 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.FeatureResult = armfeatures.FeatureResult{ - // Name: to.Ptr("Feature1"), - // Type: to.Ptr("type1"), - // ID: to.Ptr("feature_id1"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("registered"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/unregisterFeature.json -func ExampleClient_Unregister() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Unregister(ctx, "Resource Provider Namespace", "feature", 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.FeatureResult = armfeatures.FeatureResult{ - // Name: to.Ptr("Feature1"), - // Type: to.Ptr("Microsoft.Features/providers/features"), - // ID: to.Ptr("/subscriptions/ff23096b-f5a2-46ea-bd62-59c3e93fef9a/providers/Microsoft.Features/providers/Microsoft.Test/features/Feature1"), - // Properties: &armfeatures.FeatureProperties{ - // State: to.Ptr("unregistered"), - // }, - // } -} diff --git a/sdk/resourcemanager/resources/armfeatures/constants.go b/sdk/resourcemanager/resources/armfeatures/constants.go index 30bb2b1692d2..514e4cffd504 100644 --- a/sdk/resourcemanager/resources/armfeatures/constants.go +++ b/sdk/resourcemanager/resources/armfeatures/constants.go @@ -11,7 +11,7 @@ package armfeatures const ( moduleName = "armfeatures" - moduleVersion = "v1.1.0" + moduleVersion = "v1.1.1" ) // SubscriptionFeatureRegistrationApprovalType - The feature approval type. diff --git a/sdk/resourcemanager/resources/armfeatures/feature_client_example_test.go b/sdk/resourcemanager/resources/armfeatures/feature_client_example_test.go deleted file mode 100644 index bd2c269e9cdb..000000000000 --- a/sdk/resourcemanager/resources/armfeatures/feature_client_example_test.go +++ /dev/null @@ -1,62 +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 armfeatures_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listFeaturesOperations.json -func ExampleFeatureClient_NewListOperationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFeatureClient().NewListOperationsPager(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 = armfeatures.OperationListResult{ - // Value: []*armfeatures.Operation{ - // { - // Name: to.Ptr("FeaturesOpeartion1"), - // Display: &armfeatures.OperationDisplay{ - // Operation: to.Ptr("Read"), - // Provider: to.Ptr("Microsoft.ResourceProvider"), - // Resource: to.Ptr("Resource1"), - // }, - // }, - // { - // Name: to.Ptr("FeaturesOpeartion2"), - // Display: &armfeatures.OperationDisplay{ - // Operation: to.Ptr("Write"), - // Provider: to.Ptr("Microsoft.ResourceProvider"), - // Resource: to.Ptr("Resource2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armfeatures/go.mod b/sdk/resourcemanager/resources/armfeatures/go.mod index 9765db5877e2..fdad42203fe8 100644 --- a/sdk/resourcemanager/resources/armfeatures/go.mod +++ b/sdk/resourcemanager/resources/armfeatures/go.mod @@ -4,12 +4,12 @@ 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.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect diff --git a/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client_example_test.go b/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client_example_test.go deleted file mode 100644 index 57e005b9b609..000000000000 --- a/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client_example_test.go +++ /dev/null @@ -1,198 +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 armfeatures_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationGET.json -func ExampleSubscriptionFeatureRegistrationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionFeatureRegistrationsClient().Get(ctx, "subscriptionFeatureRegistrationGroupTestRG", "testFeature", 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.SubscriptionFeatureRegistration = armfeatures.SubscriptionFeatureRegistration{ - // Name: to.Ptr("testFeature"), - // Type: to.Ptr("Microsoft.Features/featureProviders/subscriptionFeatureRegistrations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Features/featureProviders/Microsoft.TestRP/subscriptionFeatureRegistrations/testFeature"), - // Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{ - // ApprovalType: to.Ptr(armfeatures.SubscriptionFeatureRegistrationApprovalTypeApprovalRequired), - // AuthorizationProfile: &armfeatures.AuthorizationProfile{ - // }, - // FeatureName: to.Ptr("testFeature"), - // ProviderNamespace: to.Ptr("Microsoft.TestRP"), - // RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T01:57:51.734777Z"); return t}()), - // ReleaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-05T00:34:53.1243228Z"); return t}()), - // State: to.Ptr(armfeatures.SubscriptionFeatureRegistrationStatePending), - // SubscriptionID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationPUT.json -func ExampleSubscriptionFeatureRegistrationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionFeatureRegistrationsClient().CreateOrUpdate(ctx, "subscriptionFeatureRegistrationGroupTestRG", "testFeature", &armfeatures.SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions{SubscriptionFeatureRegistrationType: &armfeatures.SubscriptionFeatureRegistration{ - Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{}, - }, - }) - 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.SubscriptionFeatureRegistration = armfeatures.SubscriptionFeatureRegistration{ - // Name: to.Ptr("testFeature"), - // Type: to.Ptr("Microsoft.Features/featureProviders/subscriptionFeatureRegistrations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Features/featureProviders/Microsoft.TestRP/subscriptionFeatureRegistrations/testFeature"), - // Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{ - // ApprovalType: to.Ptr(armfeatures.SubscriptionFeatureRegistrationApprovalTypeApprovalRequired), - // AuthorizationProfile: &armfeatures.AuthorizationProfile{ - // }, - // FeatureName: to.Ptr("testFeature"), - // ProviderNamespace: to.Ptr("Microsoft.TestRP"), - // RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T01:57:51.734777Z"); return t}()), - // ReleaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-05T00:34:53.1243228Z"); return t}()), - // State: to.Ptr(armfeatures.SubscriptionFeatureRegistrationStatePending), - // SubscriptionID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationDELETE.json -func ExampleSubscriptionFeatureRegistrationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSubscriptionFeatureRegistrationsClient().Delete(ctx, "subscriptionFeatureRegistrationGroupTestRG", "testFeature", 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/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationLIST.json -func ExampleSubscriptionFeatureRegistrationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionFeatureRegistrationsClient().NewListBySubscriptionPager("subscriptionFeatureRegistrationGroupTestRG", 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.SubscriptionFeatureRegistrationList = armfeatures.SubscriptionFeatureRegistrationList{ - // Value: []*armfeatures.SubscriptionFeatureRegistration{ - // { - // Name: to.Ptr("testFeature"), - // Type: to.Ptr("Microsoft.Features/featureProviders/subscriptionFeatureRegistrations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Features/featureProviders/Microsoft.TestRP/subscriptionFeatureRegistrations/testFeature"), - // Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{ - // ApprovalType: to.Ptr(armfeatures.SubscriptionFeatureRegistrationApprovalTypeApprovalRequired), - // AuthorizationProfile: &armfeatures.AuthorizationProfile{ - // }, - // FeatureName: to.Ptr("testFeature"), - // ProviderNamespace: to.Ptr("Microsoft.TestRP"), - // RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T01:57:51.734777Z"); return t}()), - // ReleaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-05T00:34:53.1243228Z"); return t}()), - // State: to.Ptr(armfeatures.SubscriptionFeatureRegistrationStatePending), - // SubscriptionID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationLISTALL.json -func ExampleSubscriptionFeatureRegistrationsClient_NewListAllBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armfeatures.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionFeatureRegistrationsClient().NewListAllBySubscriptionPager(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.SubscriptionFeatureRegistrationList = armfeatures.SubscriptionFeatureRegistrationList{ - // Value: []*armfeatures.SubscriptionFeatureRegistration{ - // { - // Name: to.Ptr("testFeature"), - // Type: to.Ptr("Microsoft.Features/featureProviders/subscriptionFeatureRegistrations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Features/featureProviders/Microsoft.TestRP/subscriptionFeatureRegistrations/testFeature"), - // Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{ - // ApprovalType: to.Ptr(armfeatures.SubscriptionFeatureRegistrationApprovalTypeApprovalRequired), - // AuthorizationProfile: &armfeatures.AuthorizationProfile{ - // }, - // FeatureName: to.Ptr("testFeature"), - // ProviderNamespace: to.Ptr("Microsoft.TestRP"), - // RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T01:57:51.734777Z"); return t}()), - // ReleaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-05T00:34:53.1243228Z"); return t}()), - // State: to.Ptr(armfeatures.SubscriptionFeatureRegistrationStatePending), - // SubscriptionID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }}, - // } - } -}