diff --git a/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md b/sdk/resourcemanager/resources/armfeatures/CHANGELOG.md index 3beb23d2c9af..787fad05d699 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-10-04) +### 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.go b/sdk/resourcemanager/resources/armfeatures/client.go index 4d8ac38fe166..769aed84d857 100644 --- a/sdk/resourcemanager/resources/armfeatures/client.go +++ b/sdk/resourcemanager/resources/armfeatures/client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures @@ -52,18 +51,21 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // - featureName - The name of the feature to get. // - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientGetOptions) (ClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceProviderNamespace, featureName, options) if err != nil { return ClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,18 +234,21 @@ func (client *Client) listAllHandleResponse(resp *http.Response) (ClientListAllR // - featureName - The name of the feature to register. // - options - ClientRegisterOptions contains the optional parameters for the Client.Register method. func (client *Client) Register(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientRegisterOptions) (ClientRegisterResponse, error) { + var err error req, err := client.registerCreateRequest(ctx, resourceProviderNamespace, featureName, options) if err != nil { return ClientRegisterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClientRegisterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientRegisterResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClientRegisterResponse{}, err } - return client.registerHandleResponse(resp) + resp, err := client.registerHandleResponse(httpResp) + return resp, err } // registerCreateRequest creates the Register request. @@ -289,18 +294,21 @@ func (client *Client) registerHandleResponse(resp *http.Response) (ClientRegiste // - featureName - The name of the feature to unregister. // - options - ClientUnregisterOptions contains the optional parameters for the Client.Unregister method. func (client *Client) Unregister(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientUnregisterOptions) (ClientUnregisterResponse, error) { + var err error req, err := client.unregisterCreateRequest(ctx, resourceProviderNamespace, featureName, options) if err != nil { return ClientUnregisterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClientUnregisterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientUnregisterResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClientUnregisterResponse{}, err } - return client.unregisterHandleResponse(resp) + resp, err := client.unregisterHandleResponse(httpResp) + return resp, err } // unregisterCreateRequest creates the Unregister request. 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/client_factory.go b/sdk/resourcemanager/resources/armfeatures/client_factory.go index cd7593eced42..b4e2bf6a2e74 100644 --- a/sdk/resourcemanager/resources/armfeatures/client_factory.go +++ b/sdk/resourcemanager/resources/armfeatures/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures @@ -38,13 +37,13 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewFeatureClient() *FeatureClient { - subClient, _ := NewFeatureClient(c.credential, c.options) +func (c *ClientFactory) NewClient() *Client { + subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewFeatureClient() *FeatureClient { + subClient, _ := NewFeatureClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/resources/armfeatures/constants.go b/sdk/resourcemanager/resources/armfeatures/constants.go index 30bb2b1692d2..ae49784330ca 100644 --- a/sdk/resourcemanager/resources/armfeatures/constants.go +++ b/sdk/resourcemanager/resources/armfeatures/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. 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.go b/sdk/resourcemanager/resources/armfeatures/feature_client.go index 55795aedf0ea..a1eabe25bbd3 100644 --- a/sdk/resourcemanager/resources/armfeatures/feature_client.go +++ b/sdk/resourcemanager/resources/armfeatures/feature_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures 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..df320921ca39 100644 --- a/sdk/resourcemanager/resources/armfeatures/go.mod +++ b/sdk/resourcemanager/resources/armfeatures/go.mod @@ -3,14 +3,14 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatur 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/azcore v1.6.1 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/internal v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.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 github.com/davecgh/go-spew v1.1.1 // indirect @@ -21,9 +21,9 @@ require ( github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // 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 + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/resources/armfeatures/go.sum b/sdk/resourcemanager/resources/armfeatures/go.sum index b0f97586a165..592e81cc36bb 100644 --- a/sdk/resourcemanager/resources/armfeatures/go.sum +++ b/sdk/resourcemanager/resources/armfeatures/go.sum @@ -1,9 +1,9 @@ -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/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= -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/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= @@ -31,12 +31,12 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -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.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= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/resources/armfeatures/models.go b/sdk/resourcemanager/resources/armfeatures/models.go index 09eab296c3c3..22ce5dfe733c 100644 --- a/sdk/resourcemanager/resources/armfeatures/models.go +++ b/sdk/resourcemanager/resources/armfeatures/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures @@ -14,236 +13,175 @@ import "time" // AuthorizationProfile - Authorization Profile type AuthorizationProfile struct { // READ-ONLY; The approved time - ApprovedTime *time.Time `json:"approvedTime,omitempty" azure:"ro"` + ApprovedTime *time.Time // READ-ONLY; The approver - Approver *string `json:"approver,omitempty" azure:"ro"` + Approver *string // READ-ONLY; The requested time - RequestedTime *time.Time `json:"requestedTime,omitempty" azure:"ro"` + RequestedTime *time.Time // READ-ONLY; The requester - Requester *string `json:"requester,omitempty" azure:"ro"` + Requester *string // READ-ONLY; The requester object id - RequesterObjectID *string `json:"requesterObjectId,omitempty" azure:"ro"` -} - -// ClientGetOptions contains the optional parameters for the Client.Get method. -type ClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClientListAllOptions contains the optional parameters for the Client.NewListAllPager method. -type ClientListAllOptions struct { - // placeholder for future optional parameters -} - -// ClientListOptions contains the optional parameters for the Client.NewListPager method. -type ClientListOptions struct { - // placeholder for future optional parameters -} - -// ClientRegisterOptions contains the optional parameters for the Client.Register method. -type ClientRegisterOptions struct { - // placeholder for future optional parameters -} - -// ClientUnregisterOptions contains the optional parameters for the Client.Unregister method. -type ClientUnregisterOptions struct { - // placeholder for future optional parameters + RequesterObjectID *string } // ErrorDefinition - Error definition. type ErrorDefinition struct { // Internal error details. - Details []*ErrorDefinition `json:"details,omitempty"` + Details []*ErrorDefinition // READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; Description of the error. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string } // ErrorResponse - Error response indicates that the service is not able to process the incoming request. type ErrorResponse struct { // The error details. - Error *ErrorDefinition `json:"error,omitempty"` -} - -// FeatureClientListOperationsOptions contains the optional parameters for the FeatureClient.NewListOperationsPager method. -type FeatureClientListOperationsOptions struct { - // placeholder for future optional parameters + Error *ErrorDefinition } // FeatureOperationsListResult - List of previewed features. type FeatureOperationsListResult struct { // The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The array of features. - Value []*FeatureResult `json:"value,omitempty"` + Value []*FeatureResult } // FeatureProperties - Information about feature. type FeatureProperties struct { // The registration state of the feature for the subscription. - State *string `json:"state,omitempty"` + State *string } // FeatureResult - Previewed feature information. type FeatureResult struct { // The resource ID of the feature. - ID *string `json:"id,omitempty"` + ID *string // The name of the feature. - Name *string `json:"name,omitempty"` + Name *string // Properties of the previewed feature. - Properties *FeatureProperties `json:"properties,omitempty"` + Properties *FeatureProperties // The resource type of the feature. - Type *string `json:"type,omitempty"` + Type *string } // Operation - Microsoft.Features operation type Operation struct { // The object that represents the operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` + Name *string } // OperationDisplay - The object that represents the operation. type OperationDisplay struct { // Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` + Operation *string // Service provider: Microsoft.Features - Provider *string `json:"provider,omitempty"` + Provider *string // Resource on which the operation is performed: Profile, endpoint, etc. - Resource *string `json:"resource,omitempty"` + Resource *string } // OperationListResult - Result of the request to list Microsoft.Features operations. It contains a list of operations and // a URL link to get the next set of results. type OperationListResult struct { // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // List of Microsoft.Features operations. - Value []*Operation `json:"value,omitempty"` + Value []*Operation } // ProxyResource - An Azure proxy resource. type ProxyResource struct { // READ-ONLY; Azure resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SubscriptionFeatureRegistration - Subscription feature registration details type SubscriptionFeatureRegistration struct { - Properties *SubscriptionFeatureRegistrationProperties `json:"properties,omitempty"` + Properties *SubscriptionFeatureRegistrationProperties // READ-ONLY; Azure resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SubscriptionFeatureRegistrationList - The list of subscription feature registrations. type SubscriptionFeatureRegistrationList struct { // The link used to get the next page of subscription feature registrations list. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of subscription feature registrations. - Value []*SubscriptionFeatureRegistration `json:"value,omitempty"` + Value []*SubscriptionFeatureRegistration } type SubscriptionFeatureRegistrationProperties struct { // Authorization Profile - AuthorizationProfile *AuthorizationProfile `json:"authorizationProfile,omitempty"` + AuthorizationProfile *AuthorizationProfile // The feature description. - Description *string `json:"description,omitempty"` + Description *string // Key-value pairs for meta data. - Metadata map[string]*string `json:"metadata,omitempty"` + Metadata map[string]*string // Indicates whether feature should be displayed in Portal. - ShouldFeatureDisplayInPortal *bool `json:"shouldFeatureDisplayInPortal,omitempty"` + ShouldFeatureDisplayInPortal *bool // The state. - State *SubscriptionFeatureRegistrationState `json:"state,omitempty"` + State *SubscriptionFeatureRegistrationState // READ-ONLY; The feature approval type. - ApprovalType *SubscriptionFeatureRegistrationApprovalType `json:"approvalType,omitempty" azure:"ro"` + ApprovalType *SubscriptionFeatureRegistrationApprovalType // READ-ONLY; The featureDisplayName. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The feature documentation link. - DocumentationLink *string `json:"documentationLink,omitempty" azure:"ro"` + DocumentationLink *string // READ-ONLY; The featureName. - FeatureName *string `json:"featureName,omitempty" azure:"ro"` + FeatureName *string // READ-ONLY; The providerNamespace. - ProviderNamespace *string `json:"providerNamespace,omitempty" azure:"ro"` + ProviderNamespace *string // READ-ONLY; The feature registration date. - RegistrationDate *time.Time `json:"registrationDate,omitempty" azure:"ro"` + RegistrationDate *time.Time // READ-ONLY; The feature release date. - ReleaseDate *time.Time `json:"releaseDate,omitempty" azure:"ro"` + ReleaseDate *time.Time // READ-ONLY; The subscriptionId. - SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` + SubscriptionID *string // READ-ONLY; The tenantId. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -// SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.CreateOrUpdate -// method. -type SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions struct { - // Subscription Feature Registration Type details. - SubscriptionFeatureRegistrationType *SubscriptionFeatureRegistration -} - -// SubscriptionFeatureRegistrationsClientDeleteOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Delete -// method. -type SubscriptionFeatureRegistrationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionFeatureRegistrationsClientGetOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Get -// method. -type SubscriptionFeatureRegistrationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.NewListAllBySubscriptionPager -// method. -type SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionFeatureRegistrationsClientListBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.NewListBySubscriptionPager -// method. -type SubscriptionFeatureRegistrationsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + TenantID *string } diff --git a/sdk/resourcemanager/resources/armfeatures/models_serde.go b/sdk/resourcemanager/resources/armfeatures/models_serde.go index 8dc3c194867d..d74fa9a2634e 100644 --- a/sdk/resourcemanager/resources/armfeatures/models_serde.go +++ b/sdk/resourcemanager/resources/armfeatures/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures diff --git a/sdk/resourcemanager/resources/armfeatures/options.go b/sdk/resourcemanager/resources/armfeatures/options.go new file mode 100644 index 000000000000..5092b41920c5 --- /dev/null +++ b/sdk/resourcemanager/resources/armfeatures/options.go @@ -0,0 +1,70 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armfeatures + +// ClientGetOptions contains the optional parameters for the Client.Get method. +type ClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClientListAllOptions contains the optional parameters for the Client.NewListAllPager method. +type ClientListAllOptions struct { + // placeholder for future optional parameters +} + +// ClientListOptions contains the optional parameters for the Client.NewListPager method. +type ClientListOptions struct { + // placeholder for future optional parameters +} + +// ClientRegisterOptions contains the optional parameters for the Client.Register method. +type ClientRegisterOptions struct { + // placeholder for future optional parameters +} + +// ClientUnregisterOptions contains the optional parameters for the Client.Unregister method. +type ClientUnregisterOptions struct { + // placeholder for future optional parameters +} + +// FeatureClientListOperationsOptions contains the optional parameters for the FeatureClient.NewListOperationsPager method. +type FeatureClientListOperationsOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.CreateOrUpdate +// method. +type SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions struct { + // Subscription Feature Registration Type details. + SubscriptionFeatureRegistrationType *SubscriptionFeatureRegistration +} + +// SubscriptionFeatureRegistrationsClientDeleteOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Delete +// method. +type SubscriptionFeatureRegistrationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionFeatureRegistrationsClientGetOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Get +// method. +type SubscriptionFeatureRegistrationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.NewListAllBySubscriptionPager +// method. +type SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionFeatureRegistrationsClientListBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.NewListBySubscriptionPager +// method. +type SubscriptionFeatureRegistrationsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/resources/armfeatures/response_types.go b/sdk/resourcemanager/resources/armfeatures/response_types.go index ab54c7db036f..d30455ab2a55 100644 --- a/sdk/resourcemanager/resources/armfeatures/response_types.go +++ b/sdk/resourcemanager/resources/armfeatures/response_types.go @@ -3,44 +3,51 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures // ClientGetResponse contains the response from method Client.Get. type ClientGetResponse struct { + // Previewed feature information. FeatureResult } // ClientListAllResponse contains the response from method Client.NewListAllPager. type ClientListAllResponse struct { + // List of previewed features. FeatureOperationsListResult } // ClientListResponse contains the response from method Client.NewListPager. type ClientListResponse struct { + // List of previewed features. FeatureOperationsListResult } // ClientRegisterResponse contains the response from method Client.Register. type ClientRegisterResponse struct { + // Previewed feature information. FeatureResult } // ClientUnregisterResponse contains the response from method Client.Unregister. type ClientUnregisterResponse struct { + // Previewed feature information. FeatureResult } // FeatureClientListOperationsResponse contains the response from method FeatureClient.NewListOperationsPager. type FeatureClientListOperationsResponse struct { + // Result of the request to list Microsoft.Features operations. It contains a list of operations and a URL link to get the + // next set of results. OperationListResult } // SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse contains the response from method SubscriptionFeatureRegistrationsClient.CreateOrUpdate. type SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse struct { + // Subscription feature registration details SubscriptionFeatureRegistration } @@ -51,15 +58,18 @@ type SubscriptionFeatureRegistrationsClientDeleteResponse struct { // SubscriptionFeatureRegistrationsClientGetResponse contains the response from method SubscriptionFeatureRegistrationsClient.Get. type SubscriptionFeatureRegistrationsClientGetResponse struct { + // Subscription feature registration details SubscriptionFeatureRegistration } // SubscriptionFeatureRegistrationsClientListAllBySubscriptionResponse contains the response from method SubscriptionFeatureRegistrationsClient.NewListAllBySubscriptionPager. type SubscriptionFeatureRegistrationsClientListAllBySubscriptionResponse struct { + // The list of subscription feature registrations. SubscriptionFeatureRegistrationList } // SubscriptionFeatureRegistrationsClientListBySubscriptionResponse contains the response from method SubscriptionFeatureRegistrationsClient.NewListBySubscriptionPager. type SubscriptionFeatureRegistrationsClientListBySubscriptionResponse struct { + // The list of subscription feature registrations. SubscriptionFeatureRegistrationList } diff --git a/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client.go b/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client.go index 00c3ee6efcea..457923cb5227 100644 --- a/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client.go +++ b/sdk/resourcemanager/resources/armfeatures/subscriptionfeatureregistrations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures @@ -53,18 +52,21 @@ func NewSubscriptionFeatureRegistrationsClient(subscriptionID string, credential // - options - SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.CreateOrUpdate // method. func (client *SubscriptionFeatureRegistrationsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, featureName string, options *SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions) (SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, providerNamespace, featureName, options) if err != nil { return SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -91,7 +93,10 @@ func (client *SubscriptionFeatureRegistrationsClient) createOrUpdateCreateReques req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SubscriptionFeatureRegistrationType != nil { - return req, runtime.MarshalAsJSON(req, *options.SubscriptionFeatureRegistrationType) + if err := runtime.MarshalAsJSON(req, *options.SubscriptionFeatureRegistrationType); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -114,16 +119,18 @@ func (client *SubscriptionFeatureRegistrationsClient) createOrUpdateHandleRespon // - options - SubscriptionFeatureRegistrationsClientDeleteOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Delete // method. func (client *SubscriptionFeatureRegistrationsClient) Delete(ctx context.Context, providerNamespace string, featureName string, options *SubscriptionFeatureRegistrationsClientDeleteOptions) (SubscriptionFeatureRegistrationsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, providerNamespace, featureName, options) if err != nil { return SubscriptionFeatureRegistrationsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionFeatureRegistrationsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SubscriptionFeatureRegistrationsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SubscriptionFeatureRegistrationsClientDeleteResponse{}, err } return SubscriptionFeatureRegistrationsClientDeleteResponse{}, nil } @@ -163,18 +170,21 @@ func (client *SubscriptionFeatureRegistrationsClient) deleteCreateRequest(ctx co // - options - SubscriptionFeatureRegistrationsClientGetOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Get // method. func (client *SubscriptionFeatureRegistrationsClient) Get(ctx context.Context, providerNamespace string, featureName string, options *SubscriptionFeatureRegistrationsClientGetOptions) (SubscriptionFeatureRegistrationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, providerNamespace, featureName, options) if err != nil { return SubscriptionFeatureRegistrationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionFeatureRegistrationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionFeatureRegistrationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionFeatureRegistrationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armfeatures/time_rfc3339.go b/sdk/resourcemanager/resources/armfeatures/time_rfc3339.go index 95a9f1c0cd46..db565f303a02 100644 --- a/sdk/resourcemanager/resources/armfeatures/time_rfc3339.go +++ b/sdk/resourcemanager/resources/armfeatures/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armfeatures